@floless/app 0.149.1 → 0.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/floless-server.cjs +101814 -88311
  2. package/dist/schemas/drawing-check.profile.v1.schema.json +45 -2
  3. package/dist/schemas/steel.model.v2.schema.json +9 -0
  4. package/dist/skills/floless-app-approval/SKILL.md +79 -4
  5. package/dist/skills/floless-app-onboarding/SKILL.md +4 -4
  6. package/dist/skills/floless-app-onboarding/references/aware-runtime.md +1 -1
  7. package/dist/skills/floless-app-onboarding/references/floless-app-tour.md +15 -13
  8. package/dist/skills/floless-app-routines/SKILL.md +4 -1
  9. package/dist/skills/floless-app-routines/references/routines-api.md +14 -2
  10. package/dist/skills/floless-app-steel-model/SKILL.md +4 -2
  11. package/dist/skills/floless-app-steel-takeoff/SKILL.md +14 -9
  12. package/dist/skills/floless-app-workflows/SKILL.md +2 -2
  13. package/dist/templates/tekla-parser.flo +13 -3
  14. package/dist/web/agents.js +887 -0
  15. package/dist/web/app.css +458 -23
  16. package/dist/web/app.js +20 -5
  17. package/dist/web/aware.js +1339 -134
  18. package/dist/web/chat.css +50 -1
  19. package/dist/web/chat.js +1582 -52
  20. package/dist/web/commands-drawing-check.js +15 -0
  21. package/dist/web/commands-revit.js +5 -0
  22. package/dist/web/commands-shell.js +761 -47
  23. package/dist/web/commands-tekla-parser.js +8 -1
  24. package/dist/web/connections.js +57 -14
  25. package/dist/web/drawing-check-editor.html +10 -2
  26. package/dist/web/drawing-check-editor.js +569 -40
  27. package/dist/web/drawing-check-overlay.js +45 -2
  28. package/dist/web/index.html +98 -27
  29. package/dist/web/instructor.js +85 -8
  30. package/dist/web/leave-guard.js +1 -0
  31. package/dist/web/left-pane.js +20 -1
  32. package/dist/web/local-discovery.js +12 -2
  33. package/dist/web/model-editor.css +32 -32
  34. package/dist/web/model-panel-bridge.js +11 -3
  35. package/dist/web/model-viewport-lighting.js +4 -2
  36. package/dist/web/model-viewport-revit-adapter.js +3 -0
  37. package/dist/web/model-viewport-toolbar.js +6 -3
  38. package/dist/web/model-viewport.js +11 -1
  39. package/dist/web/revit-editor.css +14 -14
  40. package/dist/web/revit-editor.js +64 -12
  41. package/dist/web/steel-3d-core.js +133 -0
  42. package/dist/web/steel-3d-view.js +10 -0
  43. package/dist/web/steel-editor.html +171 -39
  44. package/dist/web/steel-model-v2-client-validation.js +11 -0
  45. package/dist/web/steel-model-v2-commands.js +80 -5
  46. package/dist/web/tool-updates.js +367 -0
  47. package/dist/web/workspaces.js +679 -59
  48. package/package.json +1 -1
@@ -18,6 +18,11 @@
18
18
  def('tekla-parser.ghost-unselected', { label: 'Ghost unselected', actsOn: 'Fades every object outside the current selection', group: 'In the Tekla Parser model toolbar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
19
19
  def('tekla-parser.hide-selected', { label: 'Hide selected', actsOn: 'Temporarily hides the selected model object', group: 'In the Tekla Parser model toolbar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
20
20
  def('tekla-parser.saved-views', { label: 'Saved views', actsOn: 'Stores or restores a camera view for this exact snapshot', group: 'In the Tekla Parser model toolbar', persistence: 'working', interaction: 'dialog', risk: [], guidance: 'on-demand' });
21
+ def('tekla-parser.saved-view-close', { label: 'Close saved views', actsOn: 'Closes Saved views and returns focus to its toolbar button', group: 'In the Tekla Parser Saved views panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
22
+ def('tekla-parser.saved-view-name', { label: 'Saved view name', actsOn: 'Names the camera view to save for this exact model revision', group: 'In the Tekla Parser Saved views panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
23
+ def('tekla-parser.saved-view-save', { label: 'Save current view', actsOn: 'Saves the current camera and visible model settings under the entered name', group: 'In the Tekla Parser Saved views panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
24
+ def('tekla-parser.saved-view-restore', { label: 'Restore saved view', actsOn: 'Restores {instance} for this exact model revision', group: 'In the Tekla Parser Saved views panel', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
25
+ def('tekla-parser.saved-view-delete', { label: 'Delete saved view', actsOn: 'Removes {instance} from this exact model revision', group: 'In the Tekla Parser Saved views panel', persistence: 'working', interaction: 'instant', risk: ['destructive'], guidance: 'on-demand' });
21
26
  def('tekla-parser.spatial-controls', { label: 'Spatial controls', actsOn: 'Opens coordinate frame, working plane, clip, and work-area controls', group: 'In the Tekla Parser coordinate HUD', persistence: 'local', interaction: 'dialog', risk: [], guidance: 'on-demand' });
22
27
  def('tekla-parser.clip', { label: 'Clipping', actsOn: 'Opens shared clip-plane and clip-box actions', group: 'In the Tekla Parser model toolbar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
23
28
  def('tekla-parser.clip-action', { label: 'Change clipping', actsOn: 'Applies {instance} to the visible snapshot', group: 'In the Tekla Parser model toolbar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
@@ -41,13 +46,15 @@
41
46
  def('tekla-parser.inspector-toggle', { label: 'Toggle the Properties panel', actsOn: 'Collapses or opens the read-only Properties panel', group: 'In the Properties panel', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
42
47
  def('tekla-parser.authority', { label: 'Model authority', actsOn: 'Switches between an available working and approved snapshot', group: 'In the Tekla Parser header', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
43
48
  def('tekla-parser.audit-filter', { label: 'Filter import findings', actsOn: 'Shows {instance} findings in the read-only import audit', anyInstance: 'all', group: 'In the Tekla Parser Audit pane', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
49
+ // #1840: beside the authority toggle while the approved snapshot is shown, when that approval accepted open findings.
50
+ def('tekla-parser.audit-open', { label: 'Show accepted findings', actsOn: 'Shows the open import findings this approved snapshot was approved with, in the Audit tab', group: 'In the Tekla Parser header', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The approver accepted these findings as stated assumptions; they stay open and listed so anyone using the approved model can see what was not verified.' });
44
51
  def('tekla-parser.audit-finding', { label: 'Show import finding', actsOn: 'Selects and frames {instance} when verified geometry is available', group: 'In the Tekla Parser Audit pane', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
45
52
  def('tekla-parser.open-model', { label: 'Open Model tab', actsOn: 'Opens the new read-only snapshot on the Model tab', group: 'In the Tekla Parser workspace', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
46
53
  def('tekla-parser.replace-source', { label: 'Choose or replace Tekla source', actsOn: 'Chooses a Tekla model folder or ZIP; an existing snapshot stays available until replacement succeeds', group: 'In the Tekla Parser workspace', persistence: 'working', interaction: 'dialog', risk: [], guidance: 'on-demand' });
47
54
  def('tekla-parser.report-import-failure', { label: 'Report this problem', actsOn: 'Opens Report an issue for this failed read, listing the failure details you can choose to include', group: 'In the Tekla Parser workspace', persistence: 'none', interaction: 'dialog', risk: [], guidance: 'on-demand' });
48
55
  // #1836: the question FloLess asks when a copied model is missing Tekla catalogue files.
49
56
  def('tekla-parser.add-catalogue-files', { label: 'Add catalogue files', actsOn: 'Adds the missing Tekla catalogue files to this read, then checks the model again', group: 'In the Tekla Parser workspace', persistence: 'working', interaction: 'dialog', risk: [], guidance: 'on-demand', why: 'Without profdb.bin, screwdb.db or assdb.db, some parts and bolts cannot be drawn faithfully. matdb.bin is kept with the model but changes nothing drawn.' });
50
- def('tekla-parser.continue-without-catalogues', { label: 'Continue without the missing files', actsOn: 'Reads the model without the missing catalogue files; everything they affect is listed in the Audit tab and approval stays blocked', group: 'In the Tekla Parser workspace', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
57
+ def('tekla-parser.continue-without-catalogues', { label: 'Continue without the missing files', actsOn: 'Reads the model without the missing catalogue files; everything they affect is listed in the Audit tab, and approving that copy asks you to accept those findings first', group: 'In the Tekla Parser workspace', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
51
58
  def('tekla-parser.cancel-import', { label: 'Cancel Tekla read', actsOn: 'Cancels the in-progress read without removing the current snapshot', group: 'In the Tekla Parser workspace', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
52
59
  // Questions in chat (#1653): the card in the Properties panel, worded as the Steel Model's (web/model-chat-questions.js).
53
60
  def('tekla-parser.chat-question-show', { label: 'Show in chat', actsOn: 'Opens AI Chat at the question “{instance}”', anyInstance: 'a question asked about this object', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A question stays linked to the objects selected when it was asked, and to the objects the AI’s answer named.' });
@@ -71,6 +71,8 @@
71
71
  if (!receipt) return null;
72
72
  if (receipt.state === 'failed' || !receipt.ok) return { label: 'Couldn’t confirm', cls: 'is-chat-unavailable' };
73
73
  if (receipt.state === 'stale') return { label: 'Check again', cls: 'is-chat-warning' };
74
+ // A result kept in a transcript, not known to still hold: what it was, never "Verified" (#1900 review).
75
+ if (receipt.historical) return { label: receipt.reviewed ? 'Checked' : 'Checked, not reviewed', cls: '' };
74
76
  if (!receipt.reviewed) return { label: 'Checked, not reviewed', cls: 'is-chat-warning' };
75
77
  return { label: 'Verified', cls: 'is-chat-ready' };
76
78
  }
@@ -84,6 +86,38 @@
84
86
  return row;
85
87
  }
86
88
 
89
+ /**
90
+ * A tool with no connection check whose newer version may add one (#1986): the server's sentence, what updating
91
+ * means for approved workflows, and a button that opens the Tools library on that tool. The update itself is the
92
+ * library's own Update button — one place that owns it, its progress and its outcome — and stays the person's click.
93
+ */
94
+ function updateOfferNode(sentence, update, note, announce, nextStep = 'then check again') {
95
+ const say = (text) => { if (typeof announce === 'function') announce(text); };
96
+ const node = make('div', 'int-account conn-receipt-row conn-blocked conn-update-offer is-chat-warning');
97
+ const copy = make('div', 'int-account-copy');
98
+ const noteNode = make('span', 'int-account-origin', note || '');
99
+ noteNode.id = `conn-update-note-${Math.random().toString(36).slice(2)}`;
100
+ const actions = make('div', 'conn-confirm-actions');
101
+ const button = make('button', 'lib-update conn-update', `↑ Update to v${update.version}`);
102
+ button.type = 'button';
103
+ button.dataset.commandId = `shell.connection-update#${update.agent}`;
104
+ button.dataset.commandInstanceLabel = update.name;
105
+ button.setAttribute('aria-label', `Open the Tools library to update ${update.name} to version ${update.version}`);
106
+ button.setAttribute('aria-describedby', noteNode.id);
107
+ button.addEventListener('click', () => {
108
+ if (typeof window.openLibrary !== 'function') {
109
+ say(`FloLess couldn’t open the Tools library here. Open Tools from the ≡ menu and update ${update.name} there.`);
110
+ return;
111
+ }
112
+ window.openLibrary(update.agent);
113
+ say(`Update ${update.name} in the Tools library, ${nextStep}.`);
114
+ });
115
+ actions.append(button);
116
+ copy.append(make('span', 'int-account-name', sentence), noteNode, actions);
117
+ node.append(copy);
118
+ return node;
119
+ }
120
+
87
121
  /** One receipt, rendered the same in every surface. */
88
122
  function receiptNode(receipt, failureSentence) {
89
123
  const wrap = make('div', 'conn-receipt');
@@ -140,7 +174,9 @@
140
174
  }
141
175
 
142
176
  /** An inline "are you sure" row under the actions. Resolves true on Run, false on Cancel/Escape. */
143
- function confirmInline(host, opener, check) {
177
+ function confirmInline(host, opener, check, commandId = 'shell.connection-check') {
178
+ // The question sits on the same screen as its check button, so its ids follow that button's (#1939).
179
+ const confirmId = commandId.replace('connection-check', 'connection-confirm');
144
180
  return new Promise((resolve) => {
145
181
  const id = `conn-confirm-${Math.random().toString(36).slice(2)}`;
146
182
  const row = make('div', 'int-account is-chat-warning conn-confirm');
@@ -162,9 +198,9 @@
162
198
  }
163
199
  const actions = make('div', 'conn-confirm-actions');
164
200
  const run = make('button', 'int-action', sendsKey ? 'Send key and check' : 'Run it');
165
- run.type = 'button'; run.dataset.commandId = 'shell.connection-confirm-run';
201
+ run.type = 'button'; run.dataset.commandId = `${confirmId}-run`;
166
202
  const cancel = make('button', 'int-action', 'Cancel');
167
- cancel.type = 'button'; cancel.dataset.commandId = 'shell.connection-confirm-cancel';
203
+ cancel.type = 'button'; cancel.dataset.commandId = `${confirmId}-cancel`;
168
204
  actions.append(run, cancel);
169
205
  row.append(copy, actions);
170
206
  host.replaceChildren(row);
@@ -190,13 +226,18 @@
190
226
  }
191
227
 
192
228
  /**
193
- * A "Check it works" button for (agent, alias). `receiptHost` shows the receipt, `confirmHost`
229
+ * A "Check it works" button for (agent, alias). `commandId` is the Instructor id of the screen it sits on
230
+ * (Discover by default), so narration names that screen (#1939). `receiptHost` shows the receipt, `confirmHost`
194
231
  * holds the inline confirmation, `announce(text)` reports the outcome to a polite live region.
232
+ * `integration` + `expectedChoiceRevision` (AI Chat's card, #1900) ask the server to check only the account
233
+ * chosen for that service at that revision, and to refuse a card that is out of date; without them the
234
+ * requests are exactly as before (the person picked the account on the screen itself).
195
235
  */
196
- function checkButton({ agent, alias = null, label, receiptHost, confirmHost, announce, onReceipt }) {
236
+ function checkButton({ commandId = 'shell.connection-check', agent, alias = null, label, receiptHost, confirmHost, announce, onReceipt, integration, expectedChoiceRevision }) {
237
+ const pinned = integration ? { integration, expectedChoiceRevision } : {};
197
238
  const button = make('button', 'int-action conn-check', 'Check it works');
198
239
  button.type = 'button';
199
- button.dataset.commandId = `shell.connection-check#${agent}${alias ? `.${alias}` : ''}`;
240
+ button.dataset.commandId = `${commandId}#${agent}${alias ? `.${alias}` : ''}`;
200
241
  button.dataset.commandInstanceLabel = label || agent;
201
242
  button.setAttribute('aria-label', `Check that ${label || agent} works`);
202
243
  button.setAttribute('aria-expanded', 'false');
@@ -211,25 +252,27 @@
211
252
  setBusy(true);
212
253
  try {
213
254
  // A check that could not start keeps the last receipt and adds why, in the card itself.
214
- const blocked = (sentence) => {
255
+ const blocked = (sentence, update, note) => {
215
256
  receiptHost?.querySelector('.conn-blocked')?.remove();
216
- receiptHost?.prepend(blockedNode(sentence));
257
+ receiptHost?.prepend(update && typeof update.agent === 'string' && typeof update.version === 'string'
258
+ ? updateOfferNode(sentence, { ...update, name: update.name || label || agent }, note, say)
259
+ : blockedNode(sentence));
217
260
  say(sentence);
218
261
  };
219
- const prepared = await call(`/api/connections/${encodeURIComponent(agent)}/probe/prepare`, { method: 'POST', body: { alias } });
262
+ const prepared = await call(`/api/connections/${encodeURIComponent(agent)}/probe/prepare`, { method: 'POST', body: { alias, ...pinned } });
220
263
  if (!prepared.ok) { blocked(prepared.error || 'FloLess could not prepare this check. Try again.'); return; }
221
- if (!prepared.available) { blocked(prepared.message); return; }
264
+ if (!prepared.available) { blocked(prepared.message, prepared.update, prepared.updateNote); return; }
222
265
  // This check can start, so an earlier attempt's reason it couldn't is no longer true.
223
266
  receiptHost?.querySelector('.conn-blocked')?.remove();
224
267
  let confirmToken = null;
225
268
  if (prepared.confirmToken) {
226
269
  setBusy(false);
227
- const agreed = confirmHost ? await confirmInline(confirmHost, button, prepared.check) : false;
270
+ const agreed = confirmHost ? await confirmInline(confirmHost, button, prepared.check, commandId) : false;
228
271
  if (!agreed) { say('Check cancelled. Nothing was run.'); return; }
229
272
  confirmToken = prepared.confirmToken;
230
273
  setBusy(true);
231
274
  }
232
- const result = await call(`/api/connections/${encodeURIComponent(agent)}/probe`, { method: 'POST', body: { alias, confirmToken } });
275
+ const result = await call(`/api/connections/${encodeURIComponent(agent)}/probe`, { method: 'POST', body: { alias, confirmToken, ...pinned } });
233
276
  const receipt = result.receipt || null;
234
277
  if (!receipt) { blocked(result.error || 'The check did not succeed. Try again.'); return; }
235
278
  receiptCache.set(receiptKey(agent, alias), receipt);
@@ -365,7 +408,7 @@
365
408
  if (alias === undefined) { note.textContent = 'Choose the account FloLess uses above, then check it works.'; return; }
366
409
  for (const check of checks) {
367
410
  const label = check.name === service.name ? service.name : `${service.name} (${check.name})`;
368
- actions.append(checkButton({ agent: check.id, alias, label, receiptHost, confirmHost, announce: say }));
411
+ actions.append(checkButton({ commandId: 'shell.integrations-connection-check', agent: check.id, alias, label, receiptHost, confirmHost, announce: say }));
369
412
  const latest = cachedReceipt(check.id, alias);
370
413
  if (latest) receiptHost.replaceChildren(receiptNode(latest));
371
414
  }
@@ -376,7 +419,7 @@
376
419
  }
377
420
 
378
421
  window.flolessConnections = {
379
- loadReceipts, cachedReceipt, receiptNode, receiptChip, checkButton, loadServices, accountChoiceNode, checkAccountOf, sentenceOf,
422
+ loadReceipts, cachedReceipt, receiptNode, receiptChip, checkButton, updateOfferNode, loadServices, accountChoiceNode, checkAccountOf, sentenceOf,
380
423
  serviceConnectionNode, signInExpired, EXPIRED_SENTENCE,
381
424
  };
382
425
  })();
@@ -65,8 +65,9 @@ button:hover{background:var(--btn-hover)} button:disabled{opacity:.5;cursor:defa
65
65
  button.primary{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)} button.primary:hover{background:var(--brand-hover)}
66
66
  button.link{background:none;border:none;color:var(--brand);padding:0;text-decoration:underline;text-underline-offset:2px}
67
67
  :focus-visible{outline:2px solid var(--brand);outline-offset:2px}
68
- input[type=text]{background:var(--bg);color:var(--text);border:1px solid var(--ctrl-border);border-radius:6px;padding:5px 8px;font:12px var(--ui);width:100%}
69
- input[type=text]:focus{border-color:var(--brand);outline:none}
68
+ input[type=text],textarea{background:var(--bg);color:var(--text);border:1px solid var(--ctrl-border);border-radius:6px;padding:5px 8px;font:12px var(--ui);width:100%}
69
+ input[type=text]:focus,textarea:focus{border-color:var(--brand);outline:none}
70
+ textarea{display:block;resize:vertical;line-height:1.45;min-height:3.2em}
70
71
  /* Every checkbox and radio is drawn here — no browser widget in either theme. */
71
72
  input[type=checkbox],input[type=radio]{-webkit-appearance:none;appearance:none;width:15px;height:15px;flex:none;margin:0;border:1px solid var(--ctrl-border);background:var(--bg);cursor:pointer;vertical-align:middle}
72
73
  input[type=checkbox]{border-radius:3px}
@@ -183,6 +184,8 @@ button.icon:hover{color:var(--text)}
183
184
  .runbar{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid var(--line);background:var(--panel);flex:none;flex-wrap:wrap}
184
185
  .runbar .title{font-weight:600}
185
186
  .runbar .sp{flex:1}
187
+ #rb-sign,#lg-accepted{display:contents}
188
+ .sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
186
189
  .chip{font-size:11px;border-radius:999px;padding:2px 8px;border:1px solid var(--line);color:var(--mut);white-space:nowrap;background:none}
187
190
  .chip.warn{border-color:var(--warn);color:var(--text)}
188
191
  .runview{flex:1;min-height:0;display:grid;grid-template-columns:200px 1fr 340px}
@@ -218,6 +221,11 @@ button.icon:hover{color:var(--text)}
218
221
  .item .why{grid-column:2;color:var(--text);font-size:12px;line-height:1.45;margin-top:4px}
219
222
  .tag{width:20px;height:20px;border-radius:50%;background:#fff;border:2px solid currentColor;color:hsl(222.2 84% 4.9%);font:700 11px var(--ui);display:inline-flex;align-items:center;justify-content:center}
220
223
  .swatch{display:inline-block;width:16px;height:0;border-top:2px solid}
224
+ .findings{margin:2px 0 8px 30px;display:flex;flex-direction:column;gap:6px}
225
+ .finding{border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:12px;line-height:1.45;background:var(--bg)}
226
+ .finding .fh{display:flex;gap:6px;align-items:center}.finding .fst{color:var(--mut);font-size:11px}
227
+ .finding .freason{margin:2px 0 6px}.finding .decided{margin:0 0 6px;color:var(--text)}.finding .unv{color:var(--warn)}
228
+ .finding .carry{margin:0 0 6px}.finding .row-actions{margin:0}
221
229
  .qcard{border:1px solid var(--warn);background:color-mix(in srgb,var(--warn) 12%,transparent);border-radius:8px;padding:8px 10px;margin-bottom:6px;font-size:12px;line-height:1.45}
222
230
  .hatched{display:inline-block;width:16px;height:12px;border:1px dashed var(--text-dim);background:repeating-linear-gradient(45deg,transparent 0 3px,var(--text-dim) 3px 4px);vertical-align:middle;opacity:.7}
223
231
  .export-card{border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin-top:8px;font-size:12px;line-height:1.45;background:var(--bg)}