@floless/app 0.168.0 → 0.169.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 (49) hide show
  1. package/cli-actions.mjs +8 -1
  2. package/dist/floless-server.cjs +83100 -68895
  3. package/dist/skills/floless-app-rfi/SKILL.md +4 -2
  4. package/dist/templates/college-phase-exporter.flo +7 -2
  5. package/dist/templates/trimble-list-projects.flo +10 -2
  6. package/dist/web/agent-steps.js +2 -2
  7. package/dist/web/agents.js +49 -13
  8. package/dist/web/app.css +44 -3
  9. package/dist/web/app.js +47 -4
  10. package/dist/web/aware-update-client.js +4 -4
  11. package/dist/web/aware.js +401 -31
  12. package/dist/web/chat.css +10 -0
  13. package/dist/web/chat.js +223 -22
  14. package/dist/web/commands-drawing-check.js +3 -0
  15. package/dist/web/commands-shell.js +111 -4
  16. package/dist/web/commands-steel.js +9 -2
  17. package/dist/web/commands-vector.js +69 -0
  18. package/dist/web/drawing-check-editor.html +10 -0
  19. package/dist/web/drawing-check-editor.js +502 -182
  20. package/dist/web/failure-copy.js +20 -2
  21. package/dist/web/flo-3d.js +310 -0
  22. package/dist/web/flo-card.js +72 -0
  23. package/dist/web/guide.js +3 -1
  24. package/dist/web/index.html +26 -4
  25. package/dist/web/instructor.js +3 -0
  26. package/dist/web/model-editor-steel-adapter.js +41 -1
  27. package/dist/web/model-viewport-toolbar.js +11 -0
  28. package/dist/web/pages.js +17 -14
  29. package/dist/web/panels.js +1 -1
  30. package/dist/web/project-history.js +2 -2
  31. package/dist/web/project-modules.js +3 -3
  32. package/dist/web/project-reconciliation.js +1 -1
  33. package/dist/web/project-rfis.js +2 -2
  34. package/dist/web/project-workflows.js +6 -4
  35. package/dist/web/renderers.js +6 -0
  36. package/dist/web/report-csp.js +68 -0
  37. package/dist/web/revit-editor.js +1 -1
  38. package/dist/web/run-history.js +2 -3
  39. package/dist/web/steel-3d-flo.js +309 -0
  40. package/dist/web/steel-3d-view.js +159 -0
  41. package/dist/web/steel-editor.html +130 -9
  42. package/dist/web/terminal-requests.js +78 -0
  43. package/dist/web/tool-updates.js +3 -2
  44. package/dist/web/vector-3d.html +1 -1
  45. package/dist/web/vector-editor.html +50 -8
  46. package/dist/web/workspace-root-management.js +1 -1
  47. package/dist/web/workspaces.js +626 -140
  48. package/launch.mjs +5 -0
  49. package/package.json +8 -8
package/dist/web/chat.css CHANGED
@@ -605,6 +605,12 @@
605
605
  dashed muted box sets the tone. Inline so text-align centres it; the grid placement the shared
606
606
  class carries is inert outside the settings grid. */
607
607
  .ai-chat-empty-signin { display: inline-flex; margin-top: 10px; padding: 4px 10px; font-size: 11px; }
608
+ /* The same control under an error that says to sign in to Claude: its own line inside the error row, same size. */
609
+ .ai-chat-error-signin { display: flex; width: fit-content; margin-top: 7px; padding: 4px 10px; font-size: 11px; color: var(--text); }
610
+ /* Waiting on the window: --text-dim on --surface is 3.4:1 dark and 3.0:1 light, too faint for the only words saying the
611
+ window is open; --text-muted is 6.8:1 and 4.75:1. */
612
+ .ai-chat-provider-switch.ai-chat-error-signin[aria-disabled="true"] { color: var(--text-muted); }
613
+ .ai-chat-error-signin-done { margin-top: 7px; color: var(--text-muted); font: 11px/1.4 var(--ui); }
608
614
  /* Flo building FloLess's three parts on the chat's start screens (web/chat-landing-scene.js), in the parts' own
609
615
  colours (app.css --part-*: bright on dark, ink on light). --scene-* draws and names; --scene-*-mark is
610
616
  the underline, which stays bright in both themes. */
@@ -2000,6 +2006,10 @@
2000
2006
  .assistant-card-result-full { max-height: 260px; }
2001
2007
  .assistant-card-result-full[hidden] { display: none; }
2002
2008
  .assistant-card-result-full .assistant-card-result-list .assistant-card-result-list { padding-left: 4px; border-left: 1px solid var(--border); }
2009
+ /* #3131 F2: a card's exact inputs. Text keeps its own line breaks (an agent's instructions), as the AI sent it. */
2010
+ .ai-chat-action-inputs-body dd { white-space: pre-wrap; }
2011
+ .ai-chat-action-inputs-note { margin: 0 0 6px; }
2012
+ .ai-chat-action-input-literal { color: var(--text-muted); font-family: var(--mono); }
2003
2013
  .assistant-card-compose { margin-top: 8px; }
2004
2014
  .assistant-card-compose .ai-chat-filter-note { margin-top: 0; color: var(--text); }
2005
2015
  .assistant-card-recovered { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; margin-top: 8px; }
package/dist/web/chat.js CHANGED
@@ -64,7 +64,7 @@
64
64
  // #1890 PR 3b: the workspace history's pointer rows, the move notice on screen, and moves being followed now.
65
65
  movedChats: [], movedChatsKnown: null, moveNotice: null, moveNoticeTimer: null, followingMoves: new Set(), movingPoll: null,
66
66
  sessionReady: false, sessionOperation: null, sessionLifecycle: 0, sessionDisposed: false, sessionRecoveryHint: null,
67
- scope: null, chats: [], archivedChats: [], unreadableChats: [], chat: null, events: [], capability: null, signInPending: new Set(), desktop: null,
67
+ scope: null, chats: [], archivedChats: [], unreadableChats: [], chat: null, events: [], capability: null, signInPending: new Set(), signInLandedAt: new Map(), desktop: null,
68
68
  source: null, eventReconnectTimer: null, eventReconnectAttempt: 0, eventReconnectChatId: null, attachments: [], imageLimitChatId: null, followupSubmitting: false, followupUnknownId: null, resolvingFollowupIds: new Set(), retryingFollowupIds: new Set(), integrations: null, historyOpen: false, historyOpenings: 0, historyFilter: 'all', archivedHistoryOpen: false,
69
69
  instructorAnswers: [], historyLoading: false, historyRequestGeneration: 0, picker: null, loading: false,
70
70
  draftTimer: null, localDraft: null, backgroundDrafts: new Map(), draftWrites: new Map(), draftVersions: new Map(), unknownFollowups: new Map(), refreshTimer: null, scopeGeneration: 0, selectionGeneration: 0, openInGeneration: 0, choosingProvider: false,
@@ -219,7 +219,7 @@
219
219
  // HTML error page, a proxy's plain text) is not FloLess's JSON, so it goes to the console, never into the message.
220
220
  const json = body && typeof body === 'object' ? body : null;
221
221
  if (!json) console.warn('[chat] a request was answered with something other than FloLess JSON', path, response.status, String(body ?? '').slice(0, 200));
222
- const said = typeof json?.error === 'string' && json.error ? json.error : '';
222
+ const said = personText(json);
223
223
  const error = new Error(said || failureCopy({ status: response.status, body: json || {} }, { retrySafe: readOnly }).text);
224
224
  error.code = body?.code || null;
225
225
  error.reason = body?.reason || null;
@@ -452,6 +452,23 @@
452
452
  || /^(?:Claude Code returned an error result: )?No conversation found with session ID: [0-9a-f-]{36}$/i.test(raw.trim())) {
453
453
  return `${providerLabels[state.chat?.provider] || 'This AI app'} can no longer open this conversation’s saved history. Start a new conversation to continue.`;
454
454
  }
455
+ // Claude Code's own sign-in failures, in a Claude conversation only. Anchored at the start (the CLI's sentence runs on
456
+ // past what is matched), so quoted or nested text such as "Bash output: …" never matches. errorNeedingSignIn offers
457
+ // its Sign in… button wherever this copy says "sign in to Claude again", and tells the busy renewal apart by its
458
+ // opening words: keep both, or move its tests with them.
459
+ if (state.chat?.provider === 'claude') {
460
+ // Another Claude process held the sign-in renewal (busy, or one that died mid-renewal) and Claude gave up. It
461
+ // clears itself within a minute (the CLI treats a lock as abandoned 60 s after its last update), so waiting and
462
+ // resending comes first; signing in again is the fallback.
463
+ if (/^(?:Claude Code returned an error result: )?(?:Failed to refresh OAuth token: another Claude Code process is refreshing it|Could not refresh your login because another Claude Code process is refreshing it)/.test(raw.trim())) {
464
+ return 'Claude couldn’t finish renewing its sign-in, so its reply stopped. Check anything it already did above, wait a minute, then send your message again. If it keeps happening, sign in to Claude again.';
465
+ }
466
+ // Claude's service refused its sign-in (an invalid, revoked or expired token it could not renew): reloading never
467
+ // fixes that, signing in does.
468
+ if (/^(?:Claude Code returned an error result: )?Failed to authenticate\b/.test(raw.trim())) {
469
+ return 'Claude couldn’t sign in, so its reply stopped. Sign in to Claude again, check anything it already did above, then send your message again.';
470
+ }
471
+ }
455
472
  if (/process exited|app-server|command-line runtime|did not return a session|provider .* unavailable/i.test(raw)) {
456
473
  return 'The selected AI service could not complete this request. Check your sign-in and try again.';
457
474
  }
@@ -5180,7 +5197,9 @@
5180
5197
  }
5181
5198
  if (done.body?.code === 'request-held' && done.body.hold) { entry.busy = null; askStopThenDismiss(requestId, done.body.hold); return; }
5182
5199
  if (done.status === 404 || done.body?.code === 'request-already-set-aside') { void refreshRequestCards({ force: true }); return; }
5183
- cardNotice(requestId, done.body?.error || 'FloLess couldn’t dismiss that request. It is still in Requests; try Dismiss again.');
5200
+ cardNotice(requestId, personText(done.body) || (done.body?.diagnostic
5201
+ ? 'FloLess couldn’t tell whether that request was dismissed. Check Requests before trying Dismiss again.'
5202
+ : 'FloLess couldn’t dismiss that request. It is still in Requests; try Dismiss again.'));
5184
5203
  } catch {
5185
5204
  cardNotice(requestId, 'FloLess couldn’t reach the server, so the request was not dismissed. Try Dismiss again in a moment.');
5186
5205
  } finally {
@@ -5277,7 +5296,12 @@
5277
5296
  let restored = false;
5278
5297
  try {
5279
5298
  const done = await lifecycleCall(requestId, 'restore');
5280
- if (!done.ok) { cardNotice(requestId, done.body?.error || 'FloLess couldn’t put that request back. It is still in Requests → Done; try Undo again.'); return; }
5299
+ if (!done.ok) {
5300
+ cardNotice(requestId, personText(done.body) || (done.body?.diagnostic
5301
+ ? 'FloLess couldn’t tell whether that request was put back. Check Requests before trying Undo again.'
5302
+ : 'FloLess couldn’t put that request back. It is still in Requests → Done; try Undo again.'));
5303
+ return;
5304
+ }
5281
5305
  item = liveRequestCard(requestId);
5282
5306
  if (item) forgetHiddenRequestCard(item.dataset.cardEventId);
5283
5307
  await refreshRequestCards({ force: true });
@@ -5400,6 +5424,19 @@
5400
5424
  const label = document.createElement('strong');
5401
5425
  label.textContent = autoReceiptLabel(event);
5402
5426
  const payload = event.payload || {};
5427
+ if (payload.protectedCommand === true) {
5428
+ // A "don't ask again" choice let a protected command run: say so plainly, with the command in its tooltip.
5429
+ label.textContent = 'Ran without asking';
5430
+ const grant = String(payload.grantLabel || 'This exact command');
5431
+ const about = grant.startsWith('This exact command') ? 'this exact command' : `${grant.charAt(0).toLowerCase()}${grant.slice(1)}`;
5432
+ item.append(label, document.createTextNode(` · because you said not to ask again ${payload.scope === 'request' ? 'during this reply' : 'in this conversation'} about ${about}.`));
5433
+ // Newer servers send the command alone; an older receipt carried the card text cut short, often before its command.
5434
+ const summary = String(payload.summary || '');
5435
+ const command = summary.includes('\nCommand: ') ? summary.split('\nCommand: ').slice(1).join('\nCommand: ')
5436
+ : summary.includes('\nWhy: ') ? '' : summary;
5437
+ if (command) item.dataset.tip = command.slice(0, 300);
5438
+ return item;
5439
+ }
5403
5440
  const what = payload.scopeAdd ? `Added ${payload.scopeAdd.target?.kind || 'project'} “${payload.scopeAdd.label}” to this chat`
5404
5441
  : payload.create ? `Created the workflow “${payload.create.name}”`
5405
5442
  : String(payload.summary || payload.grantLabel || 'An action').slice(0, 200);
@@ -5869,6 +5906,78 @@
5869
5906
  return control;
5870
5907
  }
5871
5908
 
5909
+ /**
5910
+ * #3131 F2: an action's inputs exactly as they run: each key as it is spelled, each text as written, and a number, yes/no
5911
+ * or empty value as its literal (a text that reads like one is quoted), and a list says it is one, so two different
5912
+ * inputs never look the same.
5913
+ */
5914
+ function exactInputsTree(data) {
5915
+ const literal = (text) => assistantNode('span', 'ai-chat-action-input-literal', text);
5916
+ const value = (v) => {
5917
+ if (v !== null && typeof v === 'object') return exactInputsTree(v);
5918
+ if (typeof v !== 'string') return literal(JSON.stringify(v));
5919
+ return v === '' || v.trim() !== v || /^(true|false|null|-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?)$/.test(v) ? literal(JSON.stringify(v)) : document.createTextNode(v);
5920
+ };
5921
+ const list = document.createElement('dl');
5922
+ list.className = 'assistant-card-result-list';
5923
+ const entries = Array.isArray(data) ? data.map((v, i) => [`${i + 1}`, v]) : Object.entries(data);
5924
+ if (!entries.length) return literal(Array.isArray(data) ? '[]' : '{}');
5925
+ for (const [key, v] of entries) {
5926
+ const dd = document.createElement('dd');
5927
+ dd.append(value(v));
5928
+ list.append(assistantNode('dt', '', key), dd);
5929
+ }
5930
+ if (!Array.isArray(data)) return list;
5931
+ const items = document.createDocumentFragment();
5932
+ items.append(literal(`list of ${data.length}`), list);
5933
+ return items;
5934
+ }
5935
+
5936
+ /**
5937
+ * #3131 F2: every input the action uses, as FloLess stored it with the card: each value whole, or one too long to read
5938
+ * named by its size and fingerprint (and listed by name). The summary may be shortened; this never is, so what the person
5939
+ * confirms is what runs. Open from the start when the summary was cut or a value is named, and kept as the person left it
5940
+ * when the card repaints.
5941
+ */
5942
+ function actionInputs(payload, proposalId, summaryText, entry) {
5943
+ const inputs = payload.inputs;
5944
+ if (inputs === undefined || inputs === null || (typeof inputs === 'object' && !Object.keys(inputs).length)) return null;
5945
+ const named = Array.isArray(payload.inputsNamed) ? payload.inputsNamed.map(String) : [];
5946
+ const withheld = Array.isArray(payload.inputsWithheld) ? payload.inputsWithheld.map(String) : [];
5947
+ if (typeof entry.inputsOpen !== 'boolean') entry.inputsOpen = payload.summaryCut === true || named.length > 0;
5948
+ const wrap = document.createElement('div');
5949
+ wrap.className = 'ai-chat-action-inputs';
5950
+ const label = (open) => (open ? 'Hide exact inputs' : 'Show exact inputs');
5951
+ const toggle = actionButton(label(entry.inputsOpen), 'shell.chat-action-inputs', proposalId, summaryText, 'assistant-card-result-more');
5952
+ toggle.dataset.tip = 'Shows every input this action uses.';
5953
+ const body = assistantNode('div', 'assistant-card-result-body assistant-card-result-full ai-chat-action-inputs-body');
5954
+ body.id = `ai-chat-action-inputs-${proposalId}`;
5955
+ body.tabIndex = 0;
5956
+ body.setAttribute('role', 'group');
5957
+ body.setAttribute('aria-label', 'Exact inputs');
5958
+ if (payload.summaryCut === true) body.append(assistantNode('p', 'ai-chat-filter-note ai-chat-action-inputs-note', 'The summary above is shortened. Every input this action uses is listed here.'));
5959
+ if (named.length) {
5960
+ body.append(assistantNode('p', 'ai-chat-filter-note ai-chat-action-inputs-note',
5961
+ `Too long to show here, but sent whole: ${named.join(', ')}. Each is named by its size and a fingerprint of its exact content.`));
5962
+ }
5963
+ if (withheld.length) {
5964
+ body.append(assistantNode('p', 'ai-chat-filter-note ai-chat-action-inputs-note',
5965
+ `Not shown because it looks like a password or key, but sent as given: ${withheld.join(', ')}.`));
5966
+ }
5967
+ body.append(typeof inputs === 'object' ? exactInputsTree(inputs) : assistantNode('p', 'ai-chat-filter-note', String(inputs)));
5968
+ const show = (open) => {
5969
+ entry.inputsOpen = open;
5970
+ body.hidden = !open;
5971
+ toggle.textContent = label(open);
5972
+ toggle.setAttribute('aria-expanded', String(open));
5973
+ };
5974
+ toggle.setAttribute('aria-controls', body.id);
5975
+ toggle.addEventListener('click', () => show(!entry.inputsOpen));
5976
+ show(entry.inputsOpen);
5977
+ wrap.append(toggle, body);
5978
+ return wrap;
5979
+ }
5980
+
5872
5981
  /**
5873
5982
  * Show one connection in its project's model editor, selected and framed (#2450). Resolves the editor's
5874
5983
  * own outcome (see `openConnection` in workspaces.js), or null when the shell cannot do it here. Throws
@@ -6168,6 +6277,8 @@
6168
6277
  terms.append(label, document.createTextNode(String(payload.terms)));
6169
6278
  card.append(terms);
6170
6279
  }
6280
+ const inputs = actionInputs(payload, proposalId, summaryText, entry);
6281
+ if (inputs) card.append(inputs);
6171
6282
 
6172
6283
  if (handedOver) {
6173
6284
  card.classList.add('is-handed-over');
@@ -9058,10 +9169,11 @@
9058
9169
  else if (!response.ok) {
9059
9170
  const body = (response.headers.get('content-type') || '').includes('application/json') ? await response.json().catch(() => null) : null;
9060
9171
  // #3097: the server's own sentence when it wrote one; otherwise why and what to do, never the status number.
9061
- if (!body?.error) console.warn('[chat] a recorded picture could not be shown', url, response.status);
9172
+ const said = personText(body);
9173
+ if (!said) console.warn('[chat] a recorded picture could not be shown', url, response.status, body?.error || '');
9062
9174
  // The shared sentence's cause and next step; for an unexplained failure its "couldn’t tell why" is kept too.
9063
- const parts = body?.error ? null : failureParts({ status: response.status, body: body || {} }, { action: 'show this picture', retrySafe: true });
9064
- text = body?.error ? `could not be shown: ${body.error}`
9175
+ const parts = said ? null : failureParts({ status: response.status, body: body || {} }, { action: 'show this picture', retrySafe: true });
9176
+ text = said ? `could not be shown: ${said}`
9065
9177
  : `could not be shown${parts.kind === 'unexpected' ? ', and FloLess couldn’t tell why' : ''}. ${parts.detail}`;
9066
9178
  }
9067
9179
  } catch { text = 'could not be shown: FloLess did not answer. Make sure it is still running.'; }
@@ -10808,14 +10920,14 @@
10808
10920
  }
10809
10921
 
10810
10922
  // paintEvents rebuilds every control in the feed, so a control that held keyboard focus is put
10811
- // back on its replacement. The empty state's sign-in is one of them: the repaint that follows its
10923
+ // back on its replacement. The empty state's and a failed reply's error-row sign-in are among them: the repaint that follows its
10812
10924
  // own click would otherwise drop focus to the page just as it turns to "Sign-in window open".
10813
10925
  // That button is `aria-disabled`, not `disabled`, so it passes the filter (#1514).
10814
10926
  function restoreFeedFocus(focusedCommand) {
10815
10927
  if (!focusedCommand?.startsWith('shell.chat-followup-') && !focusedCommand?.startsWith('shell.chat-filter-')
10816
10928
  && !focusedCommand?.startsWith('shell.chat-question') && !focusedCommand?.startsWith('shell.chat-height-')
10817
10929
  && !focusedCommand?.startsWith('shell.chat-setup-') && !focusedCommand?.startsWith('shell.chat-answer-')
10818
- && focusedCommand !== 'shell.chat-sign-in') return null;
10930
+ && focusedCommand !== 'shell.chat-sign-in' && focusedCommand !== 'shell.chat-error-sign-in') return null;
10819
10931
  const control = [...ui.feed.querySelectorAll('[data-command-id]')]
10820
10932
  .find(control => control.dataset.commandId === focusedCommand && !control.disabled);
10821
10933
  control?.focus({ preventScroll: true });
@@ -10880,6 +10992,7 @@
10880
10992
  if (node) { if (links.length && links[0].turnId !== turnId) flushLinks(); links.push({ turnId, node }); }
10881
10993
  };
10882
10994
  const flushLinks = () => { if (links.length) { ui.feed.append(...receiptFold(links)); links = []; } };
10995
+ const signInError = errorNeedingSignIn();
10883
10996
  for (const event of state.events) {
10884
10997
  // #2642/#2643: the person's assumption or chosen source is painted on its claim's chip; it never starts or ends an answer group (it has no turn).
10885
10998
  if (event.type === 'citation-assumption' || event.type === 'citation-choice') continue;
@@ -10951,6 +11064,7 @@
10951
11064
  // #2678: a card comes in its shell, with its chevron, or as the one line it left (an ordinary message or a one-line row comes
10952
11065
  // as it is).
10953
11066
  const node = feedCard(renderEvent(event), event);
11067
+ if (node && event === signInError) node.append(errorSignIn(event));
10954
11068
  if (node) ui.feed.append(node);
10955
11069
  if (event.type === 'assistant-message') holdUncitedClaims(event.turnId);
10956
11070
  }
@@ -11108,6 +11222,51 @@
11108
11222
  return signIn;
11109
11223
  }
11110
11224
 
11225
+ // Owner, 2026-11-04: a reply that failed because Claude could not sign in must offer the sign-in right there. The
11226
+ // newest error in a Claude conversation, written after the newest message the person sent, whose sentence tells them
11227
+ // to sign in to Claude, while nothing is running or held in recovery: that error carries the same sign-in as the empty
11228
+ // state (one switchAccount(), one pending set). Receipts the failed turn writes after it (a queued follow-up marked not
11229
+ // sent) do not move on from it; a new message does, so an older error stays text only. Keyed on the sentence
11230
+ // errorMessage wrote, so the button appears exactly where the advice to sign in does.
11231
+ //
11232
+ // Owner ruling, 2026-11-04: a busy renewal (another Claude process holds it; it clears within a minute) offers the
11233
+ // button only when it has happened before in this conversation, as its own sentence says ("If it keeps happening").
11234
+ // Signing in signs Claude Code out first, and that sign-in is shared with every Claude Code session on the computer,
11235
+ // so a one-off transient lock must not invite signing them all out.
11236
+ function errorNeedingSignIn() {
11237
+ const chat = state.chat;
11238
+ if (chat?.provider !== 'claude' || chat.activeTurn || chat.state === 'recovery' || turnIsVisiblyActive()) return null;
11239
+ const advice = (event) => event.type === 'error' && event.payload?.plain !== true ? errorMessage(payloadText(event)) : '';
11240
+ // An earlier busy renewal counts whatever became of it; it is the evidence that it keeps happening.
11241
+ const renewing = (event) => advice(event).startsWith('Claude couldn’t finish renewing its sign-in');
11242
+ const lastMessage = state.events.findLastIndex((event) => event.type === 'user-message');
11243
+ const index = state.events.findLastIndex((event) => event.type === 'error');
11244
+ const error = index > lastMessage ? state.events[index] : null;
11245
+ // The error the button sits on must be a turn FloLess knows has ended (outcome failed): one left by a recovery the
11246
+ // person ended is of unknown outcome, and "send your message again" is not advice to give over it.
11247
+ if (error?.payload?.outcome !== 'failed' || !/\bsign in to Claude again\b/i.test(advice(error))) return null;
11248
+ if (renewing(error) && !state.events.slice(0, index).some(renewing)) return null;
11249
+ return error;
11250
+ }
11251
+
11252
+ // Its own command id: its own carrier, in its own place (the empty state's rule). Once a sign-in landed after this
11253
+ // error, and Claude still reads as signed in, the error says so instead: another click would sign the CLI out again
11254
+ // for nothing. Both times come from this computer's clock.
11255
+ function errorSignIn(error) {
11256
+ const landedAt = state.signInLandedAt.get('claude') || 0;
11257
+ if (landedAt > Date.parse(error.createdAt || '') && capabilityAnswer(state.capability).state !== 'signed-out') {
11258
+ const done = document.createElement('div');
11259
+ done.className = 'ai-chat-error-signin-done';
11260
+ done.setAttribute('role', 'status');
11261
+ done.textContent = 'Signed in. Send your message again.';
11262
+ return done;
11263
+ }
11264
+ const signIn = emptySignInButton(providerLabels.claude || 'Claude', state.signInPending.has('claude'));
11265
+ signIn.className = 'ai-chat-provider-switch ai-chat-error-signin';
11266
+ signIn.dataset.commandId = 'shell.chat-error-sign-in';
11267
+ return signIn;
11268
+ }
11269
+
11111
11270
  /*
11112
11271
  * Owner, 2026-10-23: "Any card should have that functionality". An approval, a proposal or the AI's own question above the
11113
11272
  * message box hides to one line by hand (× or Esc), like a drawing read's card. Hiding answers, allows or denies nothing:
@@ -11307,9 +11466,12 @@
11307
11466
  // #2224 item 1: why it asks although actions may be approved for this request or conversation.
11308
11467
  const why = document.createElement('p');
11309
11468
  why.className = 'ai-chat-approval-note';
11310
- const always = 'FloLess asks every time, even when actions are approved for this request or conversation.';
11469
+ // A card FloLess can remember says how to stop the question; one that names a record asks every time.
11470
+ const always = protectedGrantable(approval)
11471
+ ? 'Approve for this request or conversation also lets this exact command run again without asking.'
11472
+ : 'FloLess asks every time about this one: a wider choice covers your other actions and approves just this command.';
11311
11473
  why.textContent = matchedAt >= 0 ? `${head.slice(matchedAt + '\nWhy: '.length)} ${always}`
11312
- : `This command names, or could match, a workflow’s approved lock, record or conversations, so ${always}`;
11474
+ : `This command names, or might reach, a workflow’s approved version, its approval record or its saved chats. ${always}`;
11313
11475
  nodes.push(why);
11314
11476
  const block = document.createElement('pre');
11315
11477
  block.className = 'ai-chat-approval-cmd';
@@ -11860,6 +12022,17 @@
11860
12022
  return list;
11861
12023
  }
11862
12024
 
12025
+ /**
12026
+ * The server's reading of a protected command when a "don't ask again" choice may remember it (the same rule as
12027
+ * `protectedGrantKey` in server/chat-approval-grants.ts), else null: a command that names a record, one whose folder is
12028
+ * unknown, or a card from a server that sent no reading, keeps today's choices.
12029
+ */
12030
+ function protectedGrantable(approval) {
12031
+ const analysis = approval?.protectedCommand === true ? approval.protectedAnalysis : null;
12032
+ if (!analysis || analysis.v !== 1 || analysis.namesRecord !== false || analysis.pinned !== true) return null;
12033
+ return analysis;
12034
+ }
12035
+
11863
12036
  /*
11864
12037
  * Epic #2185 Slice A (owner ruling 7): EVERY approval card offers Deny, Approve once, Approve for this request and
11865
12038
  * Approve for this conversation. `approvalOffer` says, for the card on screen, exactly WHAT each wider choice covers (the
@@ -11875,12 +12048,20 @@
11875
12048
  const create = approval.create && typeof approval.create === 'object' ? approval.create : null;
11876
12049
  const check = approval.connectionCheck && typeof approval.connectionCheck === 'object' ? approval.connectionCheck : null;
11877
12050
  const connector = approval.connector && typeof approval.connector === 'object' ? approval.connector : null;
11878
- // #2196 follow-up: a command that names, or could match, a workflow's records is outside every grant. Its card keeps
11879
- // the full set of choices (owner ruling 7), and the wider ones say plainly that they approve THIS command once and
11880
- // cover other actions only.
12051
+ // #2196 follow-up: a command that names, or might reach, a workflow's records is outside every ordinary grant. Its card
12052
+ // keeps the full set of choices (owner ruling 7). A card FloLess can remember (plan 2026-11-03, "don't ask again")
12053
+ // offers exactly that; one that names a record approves THIS command once and covers other actions only.
11881
12054
  const protectedCommand = approval.protectedCommand === true
11882
- ? { protectedNote: ' This command is approved once: a command that names or could match a workflow’s records still asks every time.' } : {};
12055
+ ? { protectedNote: ' This command is approved once. FloLess asks again whenever a command names, or might reach, a workflow’s approved version, its approval record or its saved chats.' } : {};
11883
12056
  const base = { requestRevision, decision: 'allow-chat', warning: '', ...protectedCommand };
12057
+ if (protectedGrantable(approval)) {
12058
+ // The click also approves the command on screen: say so first (UX review). Only the identical command, in the same
12059
+ // folder, is remembered (server: protectedGrantKey).
12060
+ return { ...base, kind: 'protected', key: 'protected', revision: chat.approvalGrants?.revision ?? 0,
12061
+ what: 'Approve this and don’t ask again for this exact command',
12062
+ protectedNote: ' Any other command, even a small edit to this one, still asks. Commands that name a workflow’s approved version, its approval record or its saved chats always ask.',
12063
+ commandId: 'shell.chat-approval-grant-chat', instance: 'this exact command' };
12064
+ }
11884
12065
  const PROTECTED_NOTE = ' A workflow’s own records (its .lock, settings and conversations) always ask.';
11885
12066
  if (change) {
11886
12067
  if (change.refused || change.busy) return null;
@@ -12976,9 +13157,10 @@
12976
13157
  const snapshot = captureChat();
12977
13158
  const before = answerKey(state.capability?.account);
12978
13159
  state.signInPending.add(chat.provider);
12979
- // Both carriers of this action flip to waiting at the click, not at the next 5 s poll — the
13160
+ // Every carrier of this action flips to waiting at the click, not at the next 5 s poll — the
12980
13161
  // settings strip to "Waiting for sign-in…", the empty state to its "Waiting for sign-in…" title
12981
- // over a "Sign-in window open" button: that button is the one a new user just pressed.
13162
+ // over a "Sign-in window open" button (that button is the one a new user just pressed), and a
13163
+ // failed reply's error row to its own "Sign-in window open".
12982
13164
  paintSettings(); paintEvents();
12983
13165
  try {
12984
13166
  await request(`/api/terminal-runtimes/${encodeURIComponent(chat.provider)}/sign-in`, { method: 'POST' });
@@ -12986,7 +13168,8 @@
12986
13168
  // much of the empty state a short panel still paints (#1514). Only now: before this await
12987
13169
  // resolves there is no window to point at.
12988
13170
  if (sameChat(snapshot)) announce(`Waiting for sign-in. Finish signing in to ${providerLabels[chat.provider] || 'AI'} using the window FloLess opened.`);
12989
- await waitForSignIn(chat.provider, before);
13171
+ // A sign-in that landed answers an error that asked for it (errorSignIn): that error stops offering another one.
13172
+ if (await waitForSignIn(chat.provider, before)) state.signInLandedAt.set(chat.provider, Date.now());
12990
13173
  if (sameChat(snapshot)) await loadCapability();
12991
13174
  } catch (error) {
12992
13175
  const code = String(error && error.code || '');
@@ -13001,7 +13184,8 @@
13001
13184
  state.signInPending.delete(chat.provider);
13002
13185
  // This runs outside every try above, and the click handler calls switchAccount() with `void`:
13003
13186
  // a throw from the repaint would surface as an unhandled rejection with nothing to catch it.
13004
- // The feed's empty state carries the same button and the waiting copy, so it repaints too.
13187
+ // The feed's empty state carries the same button and the waiting copy, and so does a failed reply's error row, so
13188
+ // the feed repaints too.
13005
13189
  try { if (sameChat(snapshot)) { paintSettings(); paintEvents(); updateSendState(); } } catch (error) {
13006
13190
  console.warn('floless: could not repaint the provider row after a sign-in', error);
13007
13191
  }
@@ -13031,8 +13215,9 @@
13031
13215
  if (answer.state === 'unknown') continue;
13032
13216
  // A 'signed-out' is FloLess's own doing (above), not the sign-in the user went off to make.
13033
13217
  if (answer.state === 'signed-out') { signedOutSeen = true; continue; }
13034
- if (signedOutSeen || answerKey(answer) !== before) return;
13218
+ if (signedOutSeen || answerKey(answer) !== before) return true;
13035
13219
  }
13220
+ return false;
13036
13221
  }
13037
13222
 
13038
13223
  /**
@@ -13571,7 +13756,12 @@
13571
13756
  if (index >= 0) state.chats[index] = chat;
13572
13757
  paintConversation();
13573
13758
  if (reconnect) connectEvents();
13574
- } catch (error) { if (sameChat(snapshot)) report(error, 'Could not refresh chat'); }
13759
+ } catch (error) {
13760
+ if (!sameChat(snapshot)) return;
13761
+ // #3123: a timeout here means FloLess is busy, not stopped, and what the person already sees stays.
13762
+ if (error?.code === 'local-timeout') report(error, '', { 'local-timeout': 'FloLess is busy, so this conversation hasn’t refreshed yet. Your messages are still here. Reopen the conversation in a moment to see anything new.' });
13763
+ else report(error, 'Could not refresh chat');
13764
+ }
13575
13765
  }
13576
13766
 
13577
13767
  function showConversationLoading(chatId) {
@@ -17257,7 +17447,9 @@
17257
17447
  const revoke = button('Revoke', grant.which === 'request' ? 'shell.chat-request-grant-revoke' : 'shell.chat-approval-grant-revoke', 'ai-chat-connector-revoke');
17258
17448
  revoke.dataset.commandInstanceLabel = grant.label;
17259
17449
  revoke.setAttribute('aria-label', `Revoke: ${grant.label}, ${grant.which === 'request' ? 'this reply' : 'this conversation'}`);
17260
- revoke.dataset.tip = `${grant.label} will ask you again. Something already approved may finish.`;
17450
+ revoke.dataset.tip = grant.kind === 'protected'
17451
+ ? 'This command will ask you again. Something already approved may finish.'
17452
+ : `${grant.label} will ask you again. Something already approved may finish.`;
17261
17453
  revoke.disabled = state.grantRevoking === id;
17262
17454
  revoke.addEventListener('click', () => { void revokeApprovalGrant(grant); });
17263
17455
  pill.append(name, revoke);
@@ -17935,6 +18127,15 @@
17935
18127
  currentProvider: () => state.chat?.provider ?? null,
17936
18128
  // #2926: the conversation on screen, so the Drawing Filter's Flo knows a question shown here is its read's.
17937
18129
  currentChatId: () => state.chat?.chatId ?? null,
18130
+ // What the 3D model's Flo shows for this conversation (workspaces.js syncModelFlo): Your call while a suggested
18131
+ // action waits on its card, the live row's own mood (thinking / working) while the AI replies, else idle. A
18132
+ // pending approval or question is read from the shell's approvalPending, as the other indicators are.
18133
+ floMood: () => {
18134
+ const proposed = state.events.some((event) => event.type === 'action-proposal'
18135
+ && actionProposalState(String(event.payload?.proposalId || event.eventId || '')).state === 'proposed');
18136
+ if (proposed) return 'yourcall';
18137
+ return turnIsVisiblyActive() ? liveFloMood() : 'idle';
18138
+ },
17938
18139
  // The project this panel's conversations belong to; an object card offers Show in chat only for it (#1653).
17939
18140
  scopeProjectId: () => (state.scope?.owner?.kind === 'project' ? state.scope.owner.projectId : null),
17940
18141
  // #3003: a Knowledge page rendered the way the chat viewers show it, for the Knowledge step's page panel.
@@ -49,6 +49,9 @@
49
49
  def('drawing-check.check-with-version', { label: 'Check with an earlier approved version', actsOn: 'Checks the drawings against the newest earlier approved checklist when the latest cannot be read; every sheet says which version it used', group: G, persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
50
50
  def('drawing-check.go-to-question', { label: 'Go to the title-block question', actsOn: 'Opens the title block and moves to the first unanswered question', group: G, persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
51
51
  def('drawing-check.typed-label', { label: 'Type the label', actsOn: 'Takes the label exactly as it is printed on this client’s drawings, for a question none of the choices answers', group: G, persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
52
+ def('drawing-check.unsaved-apply', { label: 'Apply my changes again', actsOn: 'Makes again, on the version now shown, the checklist changes that were not saved because the checklist changed before they went in', group: G, persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
53
+ def('drawing-check.unsaved-dismiss', { label: 'Dismiss the changes not saved', actsOn: 'Discards the list of checklist changes that were not saved; nothing more is sent', group: G, persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
54
+ def('drawing-check.unsaved-show-all', { label: 'Show all changes not saved', actsOn: 'Shows or hides the full list of checklist changes that were not saved', group: G, persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
52
55
  def('drawing-check.reload', { label: 'Reload the profile', actsOn: 'Reads this client profile again, after it changed in another window or could not be read', group: G, persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
53
56
  def('drawing-check.fill-clearances', { label: 'Fill bolt clearances from a standard', actsOn: 'Replaces the hole-size check’s clearance table with starter values from {instance}', anyInstance: 'a standard', group: G, persistence: 'working', interaction: 'dialog', risk: [], guidance: 'on-demand', why: 'Starter values are a starting point: confirm them against your design standard.' });
54
57
  def('drawing-check.main-part', { label: 'Main part: is its mark the assembly mark?', actsOn: 'Sets the main part of the part list to {instance}', anyInstance: 'one answer', group: G, persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Normally the main part’s mark is the assembly mark; the part-list check and “Every part is located” both find the main part this way.' });