@floless/app 0.158.0 → 0.160.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 (43) hide show
  1. package/dist/floless-server.cjs +140655 -117708
  2. package/dist/schemas/drawing-check.profile.v1.schema.json +33 -1
  3. package/dist/schemas/steel.model.v2.schema.json +1 -0
  4. package/dist/skills/floless-app-actions/SKILL.md +23 -5
  5. package/dist/skills/floless-app-bridge/SKILL.md +5 -3
  6. package/dist/skills/floless-app-onboarding/SKILL.md +69 -5
  7. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +8 -6
  8. package/dist/skills/floless-app-queue/SKILL.md +3 -1
  9. package/dist/skills/floless-app-rfi/SKILL.md +29 -1
  10. package/dist/skills/floless-app-steel-model/SKILL.md +11 -5
  11. package/dist/skills/floless-app-steel-takeoff/SKILL.md +28 -8
  12. package/dist/skills/floless-app-workflows/SKILL.md +6 -3
  13. package/dist/web/agents.js +12 -5
  14. package/dist/web/app.css +266 -159
  15. package/dist/web/app.js +23 -51
  16. package/dist/web/aware.js +533 -546
  17. package/dist/web/chat-question-card.js +24 -1
  18. package/dist/web/chat.css +170 -48
  19. package/dist/web/chat.js +1406 -208
  20. package/dist/web/commands-shell.js +1104 -177
  21. package/dist/web/commands-steel.js +2 -0
  22. package/dist/web/drawing-check-editor.html +10 -0
  23. package/dist/web/drawing-check-editor.js +44 -0
  24. package/dist/web/guide.js +12 -2
  25. package/dist/web/index.html +62 -48
  26. package/dist/web/instructor.js +33 -12
  27. package/dist/web/pages.js +186 -31
  28. package/dist/web/panels.js +19 -1
  29. package/dist/web/project-access.js +67 -8
  30. package/dist/web/project-modules.js +474 -0
  31. package/dist/web/project-rfis.js +715 -0
  32. package/dist/web/project-workflows.js +506 -0
  33. package/dist/web/run-history.js +198 -0
  34. package/dist/web/run-page-view.js +12 -2
  35. package/dist/web/steel-3d-core.js +75 -1
  36. package/dist/web/steel-3d-view.js +8 -38
  37. package/dist/web/steel-editor.html +263 -59
  38. package/dist/web/steel-model-v2-projection.js +7 -0
  39. package/dist/web/workspace-root-recovery.js +119 -0
  40. package/dist/web/workspaces.js +493 -161
  41. package/launch-starting-page.mjs +5 -2
  42. package/launch.mjs +136 -78
  43. package/package.json +6 -1
package/dist/web/app.js CHANGED
@@ -79,10 +79,16 @@ let dagResizeObserver = null;
79
79
  function currentPrompt() { return (state.promptKey != null && PROMPTS[state.promptKey]) || null; }
80
80
  function isDag() { const p = currentPrompt(); return !!p && p.layout === 'dag'; }
81
81
 
82
+ // A padlock in currentColor (no emoji: those render in the OS's own colours in both themes). Shared with the picker's
83
+ // Locked badge (web/aware.js), so the two always match.
84
+ const LOCK_ICON_SVG = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true" focusable="false"><rect x="3" y="7" width="10" height="7" rx="1.5"/><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"/></svg>';
85
+ globalThis.FLOLESS_LOCK_ICON_SVG = LOCK_ICON_SVG;
86
+
82
87
  // Honest canvas state when there's no workflow to draw. `kind` is one of
83
88
  // 'offline' (server unreachable), 'empty' (no workflow open / none installed),
84
- // or 'loading'. NEVER renders fake nodes — that bleed-through is the bug this fixes.
85
- function renderCanvasPlaceholder(kind) {
89
+ // 'loading', or 'locked' (#2644: a module workflow this account's plan does not include; `body` is the server's
90
+ // own sentence). NEVER renders fake nodes — that bleed-through is the bug this fixes.
91
+ function renderCanvasPlaceholder(kind, body) {
86
92
  if (dagResizeObserver) { dagResizeObserver.disconnect(); dagResizeObserver = null; }
87
93
  $topology.className = 'topology placeholder';
88
94
  $topology.style.cssText = '';
@@ -93,13 +99,15 @@ function renderCanvasPlaceholder(kind) {
93
99
  const views = {
94
100
  offline: { icon: '⚠', title: 'Server offline', body: 'The local FloLess server isn’t responding. Start it to load your workflows.' },
95
101
  loading: { icon: '…', title: 'Loading…', body: 'Reading your installed workflows.' },
102
+ locked: { icon: LOCK_ICON_SVG, title: 'This workflow is locked', body: 'This workflow is part of a module this account’s plan does not include.' },
96
103
  };
97
104
  const v = views[kind] || views.offline;
105
+ const text = kind === 'locked' && typeof body === 'string' && body.trim() ? escapeHtml(body.trim()) : v.body;
98
106
  $topology.innerHTML =
99
- `<div class="canvas-empty" data-kind="${kind}">` +
107
+ `<div class="canvas-empty" data-kind="${kind}"${kind === 'locked' ? ' role="status"' : ''}>` +
100
108
  `<div class="canvas-empty-icon">${v.icon}</div>` +
101
109
  `<div class="canvas-empty-title">${v.title}</div>` +
102
- `<div class="canvas-empty-body">${v.body}</div>` +
110
+ `<div class="canvas-empty-body">${text}</div>` +
103
111
  `<div class="canvas-empty-actions" id="canvas-empty-actions"></div>` +
104
112
  `</div>`;
105
113
  }
@@ -188,44 +196,6 @@ function msgEl(cls, who, html, timestamp = new Date()) {
188
196
  div.innerHTML = `<div class="who"><span class="who-name">${who}</span><span class="who-time">${nowStamp(Number.isFinite(when.getTime()) ? when : new Date())}</span></div><div class="body">${html}</div>`;
189
197
  return div;
190
198
  }
191
- function mdInline(s) {
192
- // CODE SPANS COME OUT FIRST and go back last. Emphasis used to run over them, rewriting the inside
193
- // of a <code>: `demos/*/*.flo` came out as `demos/<em>/</em>.flo` — the asterisks GONE from a path
194
- // a reader copies, and the same for globs (`**/*.ts`), flags, regexes and pointer code, which is a
195
- // large share of what an Instructor answer is made of. Markdown never processes emphasis inside a
196
- // code span. Lifting them out also keeps emphasis able to WRAP one (`*see `foo` now*`), which
197
- // per-segment processing would have broken instead.
198
- //
199
- // Bold FIRST among what remains, so the single-asterisk pass that follows sees only real italics.
200
- // That pass may span the <strong> markup the earlier one produced — `*"the **first** point"*` is
201
- // ordinary prose, and a guard against `<` left its asterisks on screen.
202
- //
203
- // WHAT MAKES THAT SAFE HAS TWO SHAPES, and only one of them is a call-site rule. `answerProse`
204
- // (aware.js) and the guide description escape the WHOLE string before calling in. The narration
205
- // lines cannot: they carry authored `**`/`` ` `` on purpose, so their producer escapes each
206
- // INTERPOLATED VALUE where the line is assembled (see transform() in aware.js) and hands the line
207
- // over already safe. Adding a narration line means escaping every interpolation there — nothing at
208
- // this end will catch it for you. Either way no `<` here came from a user, so no pass can build a
209
- // tag or an attribute out of one.
210
- //
211
- // Crossing tags CAN misnest (`<strong>a <em>b</strong> c</em>` from overlapping markers); the
212
- // parser reparents it into valid-but-different DOM. Acceptable for prose, and the reason this is a
213
- // pass chain rather than a parser.
214
- const NUL = String.fromCharCode(0);
215
- const code = [];
216
- // NUL is stripped from the input BEFORE any placeholder is minted, so the sentinel cannot collide
217
- // with text that happened to contain one — the single hazard a mask-and-restore carries. Restored
218
- // by split parity rather than a regex: placeholders are then the only NULs present, so every odd
219
- // segment is one, and neither emphasis pass adds or removes a NUL.
220
- const masked = String(s).split(NUL).join('')
221
- .replace(/`([^`]+)`/g, (_, body) => NUL + (code.push(body) - 1) + NUL);
222
- return masked
223
- .replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
224
- .replace(/\*(?!\s)([^*]+?)\*/g, '<em>$1</em>')
225
- .split(NUL)
226
- .map((part, i) => (i % 2 ? `<code>${code[Number(part)]}</code>` : part))
227
- .join('');
228
- }
229
199
 
230
200
  function renderTopology() {
231
201
  const p = currentPrompt();
@@ -682,7 +652,7 @@ function renderFavBar() {
682
652
  } else {
683
653
  chip.style.borderColor = 'var(--warn)';
684
654
  setTimeout(() => chip.style.borderColor = '', 600);
685
- appendNarration(`<em>${AGENTS[id].title}</em> is favorited but isn't in the current app. Switch prompts or compose a new app to use it.`);
655
+ showToast(`${AGENTS[id].title} is favorited but isn't in the current app. Switch prompts or compose a new app to use it.`, 'warn');
686
656
  }
687
657
  };
688
658
  chip.querySelector('.del').onclick = (e) => {
@@ -1227,7 +1197,6 @@ $runBtn.onclick = async () => {
1227
1197
  state.currentTab = 'execution';
1228
1198
  document.querySelectorAll('.tabs button').forEach(b => b.classList.toggle('active', b.dataset.tab === 'execution'));
1229
1199
  renderInspect();
1230
- appendNarration(`Execution complete · ${nodeIds(p).length} steps fired · check the <strong>Execution</strong> tab on each tool for the full trace.`);
1231
1200
  };
1232
1201
 
1233
1202
  document.querySelectorAll('.panel-toggle').forEach(btn => {
@@ -1257,10 +1226,6 @@ window.addEventListener('resize', () => {
1257
1226
  }
1258
1227
  });
1259
1228
 
1260
- function appendNarration(html) {
1261
- $messages.appendChild(msgEl('aware', 'claude', html));
1262
- $messages.scrollTop = $messages.scrollHeight;
1263
- }
1264
1229
  function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
1265
1230
  function escapeHtml(s) {
1266
1231
  return String(s).replace(/[&<>"']/g, c => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
@@ -1740,10 +1705,11 @@ function showToast(msg, type, options) {
1740
1705
  setTimeout(() => t.remove(), 300);
1741
1706
  };
1742
1707
  // Errors stay until dismissed; most warnings linger longer than confirmations.
1743
- // A warning carrying the only next step may opt into persistence while keeping
1744
- // warn styling. warn/err get an × so they can always be closed early.
1708
+ // A toast carrying the only record of what happened may opt into persistence while
1709
+ // keeping its styling. warn/err and every persistent toast get an × so they can
1710
+ // always be closed.
1745
1711
  const ms = options?.persistent ? 0 : ({ ok: 2500, info: 2500, warn: 5000, err: 0, progress: 0 }[type] ?? 2500);
1746
- if (type === 'warn' || type === 'err') {
1712
+ if (type === 'warn' || type === 'err' || options?.persistent) {
1747
1713
  const x = document.createElement('button');
1748
1714
  x.className = 'toast-close';
1749
1715
  x.type = 'button';
@@ -2295,6 +2261,12 @@ window.flolessWorkspaceRoot = {
2295
2261
  isCurrent: (observation) => !!observation && observation === workspaceRootState
2296
2262
  && workspaceRootAcceptedObservation === workspaceRootObservation && !workspaceRootSelecting,
2297
2263
  name: () => workspaceRootName(workspaceRootState && workspaceRootState.root && workspaceRootState.root.path),
2264
+ isBusy: () => workspaceRootBusy || !!$workspaceRootModal.querySelector('.workspace-root-management:not(.workspace-root-recovery)[aria-busy="true"]'),
2265
+ close: () => {
2266
+ if (window.flolessWorkspaceRoot.isBusy()) return false;
2267
+ closeWorkspaceRoot();
2268
+ return !$workspaceRootModal.classList.contains('show');
2269
+ },
2298
2270
  };
2299
2271
  refreshWorkspaceRoot();
2300
2272