@floless/app 0.126.2 → 0.126.3

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.
@@ -2,7 +2,7 @@
2
2
  name: floless-app-new-workflow
3
3
  description: This skill should be used to build a brand-new FloLess .flo workflow from scratch, step by step, as the host terminal AI — interviewing the user about what they want, checking that the AWARE agents the workflow needs are installed (installing an available one on consent, or reporting a not-yet-existing agent as an idea), then authoring the .flo node by node and verifying each step with the real toolchain (plain-English descriptions, aware app validate, aware app compile, a real run) before installing it so it appears in the floless.app picker for Compile and Run. Use it on triggers like "build a new workflow", "create a workflow from scratch", "build me a workflow", "new workflow", the floless.app "New workflow…" menu item, a queued new-workflow request, or "/floless-app-new-workflow". It leans on floless-app-workflows for the exec contract and hands back a runnable, approved app.
4
4
  metadata:
5
- version: 0.1.0
5
+ version: 0.2.0
6
6
  ---
7
7
 
8
8
  # Build a new floless.app workflow from scratch
@@ -64,6 +64,43 @@ Pull the goal out in **one or two questions at a time**, plain English — never
64
64
  Restate it in one sentence and get a nod before authoring. Keep it small — the first version should
65
65
  **run**; extend it after. (Laziness: ship the one-node version that works, then grow it.)
66
66
 
67
+ ### Ask which project's standards apply — then read them
68
+
69
+ **One more question belongs in this interview: "should this follow a particular project's
70
+ standards?"** A firm's own shop standards, RFIs and spec notes live in a Workspace project's
71
+ **knowledge base**, and a workflow built without them encodes the model's defaults instead of the
72
+ user's practice — a plausible bolt spacing rather than *their* bolt spacing.
73
+
74
+ 1. **`GET <base>/api/workspace-projects`** — every live project, with `hasKnowledge` flagging which
75
+ have a published knowledge base. **Do not reach for the approved list**
76
+ (`/api/workspace-projects/approved`): it gates on an approved Model, which is orthogonal to having
77
+ knowledge, so it will hide exactly the project you want.
78
+
79
+ `<base>` is the same floless origin Step 0 used — from the request marker, else
80
+ `transport.rest.base` in `~/.aware/agents/floless-workspace/manifest.yaml`, which the server writes
81
+ with its own real origin. `http://127.0.0.1:4317` is the common default, not a guarantee: the
82
+ server honors `PORT`.
83
+
84
+ > Call the **route**, not the agent. `floless-workspace` is a `rest` agent, and `aware agent
85
+ > invoke` is builtin-only — it refuses a rest transport outright ("compose it in a .flo app and
86
+ > `aware app run` it"). The agent's `list-projects` command is how a **running workflow** reaches
87
+ > the same data; you, authoring, use plain HTTP.
88
+ 2. If the user names one (or exactly one has knowledge and it obviously fits — confirm, don't
89
+ assume), consult it **before authoring any node**, per `floless-app-knowledge`
90
+ § "Consulting the KB from other work (the Feed)" → "Required first step".
91
+ 3. **Bake what it says in as literal values, and cite the page** in the node's plain-English
92
+ Description — e.g. "Spacing per `shop-standard-bolts`." That is what makes the decision traceable
93
+ to the firm's own document instead of looking like your preference.
94
+
95
+ `hasKnowledge: true` only means a knowledge base was published, not that it covers your subject. If
96
+ nothing relevant comes back, **say so and proceed on stated assumptions** — never invent a standard.
97
+ A project with no knowledge is a normal answer, not a blocker.
98
+
99
+ This is compose-time only: what you learn is **baked into the `.flo`**. Never add a node that
100
+ consults a model at run time — AWARE refuses it (`E_APP_RUNTIME_MODEL_FORBIDDEN`), and it would void
101
+ "build once, run forever". (AWARE admits exactly one fenced exception, the curated `vision.extract`,
102
+ which extracts but never decides — it is not a way to reach knowledge at run time.)
103
+
67
104
  ## Step 2 — Agent preflight (before writing any node)
68
105
 
69
106
  A node references an `agent` (e.g. `tekla`, `file`). **Confirm each one exists before authoring it** —
@@ -2,7 +2,7 @@
2
2
  name: floless-app-tweak-contract
3
3
  description: This skill should be used when there is a pending floless `tweak-contract` request — the user typed an instruction in the Steel Model contract editor and clicked Send (Ask AI). Also triggers on asks like "edit the steel takeoff contract via AI", "adjust the steel takeoff in the contract editor", "the user asked me to change the steel contract", "pick up my tweak-contract request", "update the member profile in the contract". It teaches the host AI to read the request, fetch the current steel.takeoff/v1 contract, apply the instruction (and any pasted screenshots), PUT the updated contract back, and resolve the request.
4
4
  metadata:
5
- version: 0.4.0
5
+ version: 0.5.0
6
6
  ---
7
7
 
8
8
  # Handle a `tweak-contract` request (Slice 2 AI round-trip)
@@ -98,6 +98,20 @@ the server; a 400 means invalid — fix and retry.
98
98
  beam") only resolves with the visual context ("this beam" = the one circled in red on the
99
99
  screenshot).
100
100
 
101
+ **When the request carries a `project`, consult that project's knowledge base too — before you
102
+ decide anything.** `floless-app-knowledge` § "Consulting the KB from other work (the Feed)" →
103
+ "Required first step" owns that rule; follow it there rather than a summary here. The short of it:
104
+ `GET /api/workspace-projects/<project>/knowledge?q=<subject>&app=<appId>` — `<subject>` being what
105
+ you are about to change, url-encoded so it stays one URL token — returns ranked summaries of the
106
+ firm's own standards, shop preferences, RFIs and spec notes, and
107
+ `GET /api/projects/<project>/knowledge/page/<slug>` reads a decisive one in full.
108
+
109
+ This is what makes the edit derive from the **user's** knowledge instead of your priors. A shop
110
+ standard that fixes a bolt spacing, an RFI that governs a connection, a fabricator's stated
111
+ preference — these beat any default you would otherwise reach for. **Cite the `slug` you relied
112
+ on** in your step-6 summary so the user can trace the decision. If nothing relevant matches, say
113
+ so plainly rather than inventing a standard; an empty result is a normal outcome, not a failure.
114
+
101
115
  4. **Produce the edit.** Modify the contract JSON to satisfy the instruction. The bullets below are
102
116
  the **`steel.takeoff/v1`** field map; for `steel.model/v2` work from its own schema per step 2:
103
117
  - Profile changes: update `members[j].profile`; if the new profile resolves in the AISC
@@ -136,7 +150,9 @@ the server; a 400 means invalid — fix and retry.
136
150
  event; the editor picks it up and prompts to reload.
137
151
 
138
152
  6. **Tell the user.** Summarize what you changed (e.g. "Updated W12X26 → W14X30 on 4 beams
139
- in sheet S-202; updated `weights` entry to 30 plf"). Tell them to click **↻ Reload** in the
153
+ in sheet S-202; updated `weights` entry to 30 plf"). **If a knowledge-base page steered the
154
+ change, name it** — "per `shop-standard-bolts`" — so the decision is traceable back to the firm's
155
+ own document rather than looking like your preference. Tell them to click **↻ Reload** in the
140
156
  editor (or accept the reload banner) to see the change. Then resolve the request:
141
157
 
142
158
  `DELETE http://localhost:<port>/api/requests/<id>`
@@ -2,7 +2,7 @@
2
2
  name: floless-app-workflows
3
3
  description: This skill should be used when building, modifying, or reasoning about FloLess .flo workflows for floless.app — especially reusable apps that take inputs (e.g. a phase number) and run across different Tekla models, exec nodes that run Roslyn C# against the live model, the in-app HTML Viewer, the Code tab, or "Debug in VS". Covers the exec contract, the install→validate→compile→run loop, app inputs templating, reading an approved Workspace project's data from a running workflow via the floless-workspace REST seam plus its workspace-project input picker, and the server seams (aware-adapter, app-reader, index).
4
4
  metadata:
5
- version: 0.3.2
5
+ version: 0.4.0
6
6
  ---
7
7
 
8
8
  # Building reusable .flo workflows in floless.app
@@ -316,6 +316,39 @@ Let the user **pick** the project (never type an opaque id): flag the input
316
316
  (by name, searchable) and stores the opaque id. Client-only hint, never sent to `aware`
317
317
  (like `widget: file`); optional `workspaceApp:` pre-filters to one app. See `references/workspace-data.md`.
318
318
 
319
+ ## Author against the project's knowledge, not your priors — COMPOSE TIME
320
+
321
+ The section above is the workflow reading project data **at run time**. This is a different thing:
322
+ **you**, before writing a node, reading the project's **knowledge base** — the firm's own shop
323
+ standards, RFIs and spec notes — so the values you bake in are *theirs*.
324
+
325
+ When work is tied to a Workspace project (the user names one, or a queued request carries one):
326
+
327
+ 1. **`GET <base>/api/workspace-projects`** — every live project, with `hasKnowledge` flagging a
328
+ published knowledge base. **The approved list is not a project list**:
329
+ `/api/workspace-projects/approved` gates on an approved Model, which is orthogonal to knowledge,
330
+ so it will hide the project you want.
331
+
332
+ `<base>` is the floless origin from the **request marker** you were handed, else
333
+ `transport.rest.base` in `~/.aware/agents/floless-workspace/manifest.yaml` — the server writes its
334
+ own real origin there. `http://127.0.0.1:4317` is only the common default: the server honors
335
+ `PORT`, so a hard-coded 4317 talks to the wrong host on any non-default instance.
336
+
337
+ > Call the **route**, not the agent. `floless-workspace` has a `rest` transport and `aware agent
338
+ > invoke` is builtin-only, so it cannot be driven directly from the terminal. Its `list-projects`
339
+ > command is the **run-path** equivalent, for a `.flo` node — see the section above.
340
+ 2. Consult it per `floless-app-knowledge` § "Consulting the KB from other work (the Feed)" →
341
+ "Required first step", which owns the consult-and-cite rule — follow it there.
342
+ 3. **Bake what it says in as literal values and cite the page** in the node's plain-English
343
+ Description ("Spacing per `shop-standard-bolts`"), so the choice is traceable to the firm's
344
+ document rather than to you. If nothing relevant matches, say so — never invent a standard.
345
+
346
+ Compose time only: what you learn is baked into the `.flo`. A model in the run path is refused by
347
+ AWARE (`E_APP_RUNTIME_MODEL_FORBIDDEN`) and would void "build once, run forever" — **outside the one
348
+ curated carve-out**, `vision.extract`, which is admitted only because it is `category: curated` and
349
+ declares `capabilities.runtime-model-extraction: true`, and which extracts but never decides. See
350
+ `references/visual-inputs.md`. Nothing you author for knowledge belongs in that carve-out.
351
+
319
352
  ## How the UI surfaces map to AWARE state
320
353
 
321
354
  - **Code tab** shows the node's real source: `node.config.code` (the exec C#), not lockfile
@@ -11,13 +11,25 @@ Design: `docs/superpowers/specs/2026-07-06-workspaces-slice-6.5-workflow-data-se
11
11
  `floless-workspace` is written to `~/.aware/agents/floless-workspace/manifest.yaml` by the FloLess
12
12
  server **at startup** (`server/workspace-agent-manifest.ts`, `transport.rest.base =
13
13
  http://127.0.0.1:<PORT>`) — so a terminal-only `aware app run` depends on the FloLess server being
14
- up. Two `mode: read` commands:
15
-
16
- - **`list-approved`** — discover durable project ids (`app` optional query filter). Body:
17
- `{ ok, projects: [{ id, name, app, currentApprovedAt, latestApprovedVersion }] }`.
14
+ up. Four `mode: read` commands:
15
+
16
+ - **`list-projects`** — **every live project**, which is what you want when you are choosing a project
17
+ to work against. Body: `{ ok, projects: [{ id, name, app, templateId, hasKnowledge }] }`.
18
+ `hasKnowledge` flags a published knowledge base. **Do not use `list-approved` for discovery** — see
19
+ the warning below.
20
+ - **`list-approved`** — only projects with an approved Model version (`app` optional query filter).
21
+ Body: `{ ok, projects: [{ id, name, app, templateId, currentApprovedAt, latestApprovedVersion }] }`.
22
+ Use it when you specifically need approved data, never as "list the projects".
18
23
  - **`read-approved`** — one project's signed snapshot. Path param `project-id`; query `app` (guard —
19
24
  mismatch 404), `version` (pin; omit = latest approved), `include` (`contract` default, `exports`
20
25
  opt-in), `export-kind`, `export-contents`, `include-paths`, `max-bytes`.
26
+ - **`read-knowledge`** — the project's compiled knowledge base as ranked summaries (its own standards,
27
+ RFIs and spec notes — **not** approved model data). See `floless-app-knowledge`.
28
+
29
+ > **`list-approved` is not a project list.** Approval and knowledge are orthogonal: a project can hold
30
+ > a full knowledge base and no approved Model. On a real profile 13 projects existed, `list-approved`
31
+ > returned 2, and those 2 included a project with no knowledge while omitting one with 25 pages. Reach
32
+ > for `list-projects` unless you actually mean "approved".
21
33
 
22
34
  ```yaml
23
35
  nodes:
@@ -26,7 +26,7 @@ inputs:
26
26
  widget: workspace-project # client-only UI hint: render the approved-project picker instead of a text box (never sent to aware)
27
27
  description: Approved Workspace project to read.
28
28
  requires:
29
- - floless-workspace@0.1.x
29
+ - floless-workspace@0.2.x
30
30
  - tekla@0.1.x
31
31
  layout: linear
32
32
  nodes:
package/dist/web/app.css CHANGED
@@ -2946,6 +2946,8 @@ body {
2946
2946
  .run-state.ready { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
2947
2947
  .run-state.drift { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
2948
2948
  .run-state.uncompiled { color: var(--text-muted); border-color: var(--border-strong); }
2949
+ .run-state.running { color: var(--accent-bright); border-color: var(--accent-dim); }
2950
+ .run-state.cancelling { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
2949
2951
 
2950
2952
  /* Header Stop — the always-reachable escape hatch during a run, regardless of whether
2951
2953
  the HTML Viewer modal is open or closed (#39). Shown only while a run is in flight.
package/dist/web/app.js CHANGED
@@ -1356,6 +1356,10 @@ function dismissFsNudge(remember) {
1356
1356
  if (remember) { try { localStorage.setItem(FS_NUDGE_KEY, '1'); } catch {} }
1357
1357
  }
1358
1358
 
1359
+ // Passive notices yield to an explicit popup action for the rest of this page session. Do not
1360
+ // persist the seen flag: opening a project menu is not the same as dismissing the suggestion.
1361
+ document.addEventListener('floless:passive-overlay-yield', () => dismissFsNudge(false));
1362
+
1359
1363
  function nudgeAlreadySeen() {
1360
1364
  try { return localStorage.getItem(FS_NUDGE_KEY) === '1'; } catch { return false; }
1361
1365
  }
package/dist/web/aware.js CHANGED
@@ -484,18 +484,66 @@
484
484
 
485
485
  // ── gate + notes UI ────────────────────────────────────────────────────────
486
486
 
487
- function paintGate(app) {
488
- // Task-language label (AEC users don't know "lock"/"drift"); the tooltip carries
489
- // the why + the Compile step.
490
- const labels = { ready: 'Ready to run', drift: 'Needs refresh', uncompiled: 'Not set up' };
491
- $runState.className = `run-state ${app.runState}`;
492
- $runState.textContent = labels[app.runState] || '';
493
- const stateTips = {
487
+ // Execution state has precedence over the compile gate. Keep this decision pure so every repaint
488
+ // path (including an async loadApp/paintGate landing mid-run) resolves the same visible status.
489
+ function runStatePresentation(runState, activity = {}) {
490
+ const gate = {
491
+ ready: { label: 'Ready to run', className: 'ready' },
492
+ drift: { label: 'Needs refresh', className: 'drift' },
493
+ uncompiled: { label: 'Not set up', className: 'uncompiled' },
494
+ };
495
+ const finiteRunning = !!(activity.reportRunning || activity.stateRunning);
496
+ if (activity.foregroundStopping || (activity.cancelRequested && finiteRunning)) {
497
+ return { label: 'Cancelling…', className: 'cancelling' };
498
+ }
499
+ if (activity.foregroundStarting) return { label: 'Starting live run…', className: 'running' };
500
+ if (activity.foregroundTrigger) return { label: 'Listening…', className: 'running' };
501
+ if (finiteRunning) {
502
+ return activity.simulating
503
+ ? { label: 'Simulating…', className: 'running' }
504
+ : { label: 'Running…', className: 'running' };
505
+ }
506
+ return gate[runState] || { label: '', className: '' };
507
+ }
508
+
509
+ let reportRunning = false;
510
+ let cancelRequested = false;
511
+ let runningSimulation = false;
512
+ let foregroundTrigger = null;
513
+ let foregroundStarting = false;
514
+ let foregroundStopping = false;
515
+
516
+ function paintRunState(app) {
517
+ const status = runStatePresentation(app.runState, {
518
+ reportRunning,
519
+ stateRunning: state.running,
520
+ simulating: runningSimulation,
521
+ foregroundStarting,
522
+ foregroundTrigger: !!foregroundTrigger,
523
+ foregroundStopping,
524
+ cancelRequested,
525
+ });
526
+ $runState.className = `run-state ${status.className}`;
527
+ $runState.textContent = status.label;
528
+ const gateTips = {
494
529
  ready: 'Ready to run.\nThis workflow was compiled from exactly the current .flo (the approved “lock” matches the source), so ▶ Run workflow is enabled.',
495
530
  drift: 'Needs refresh.\nThe .flo changed since the last Compile, so the approved lock is out of date and Run is blocked. Hit ⎙ Compile to re-approve it.',
496
531
  uncompiled: 'Not set up yet.\nThere is no approved lock for this workflow, so Run is blocked. Hit ⎙ Compile to freeze one — then ▶ Run workflow turns on.',
497
532
  };
498
- $runState.dataset.tip = stateTips[app.runState] || '';
533
+ const activeTips = {
534
+ 'Running…': 'The approved workflow is running against the live host.',
535
+ 'Simulating…': 'The workflow composition is being simulated without contacting the live host.',
536
+ 'Starting live run…': 'The live trigger session is starting.',
537
+ 'Listening…': 'The live trigger session is listening for the next host event.',
538
+ 'Cancelling…': 'The current run is being cancelled.',
539
+ };
540
+ $runState.dataset.tip = activeTips[status.label] || gateTips[app.runState] || '';
541
+ }
542
+
543
+ function paintGate(app) {
544
+ // Task-language label (AEC users don't know "lock"/"drift"); the tooltip carries
545
+ // the why + the Compile step.
546
+ paintRunState(app);
499
547
 
500
548
  // Keep Run disabled (and the header Stop shown) if a gate re-paint lands mid-run (#39) —
501
549
  // never let a re-render re-arm Run while a run is still in flight.
@@ -503,8 +551,8 @@
503
551
  // gate repaint mid-session (e.g. an fs-change → loadApp) must not re-arm Run or
504
552
  // hide the Stop while the watcher is still live. The in-modal Stop tracks the
505
553
  // same state (it's the reachable Stop while the Viewer covers the header one).
506
- $runBtn.disabled = !app.runnable || reportRunning || state.running || !!foregroundTrigger;
507
- if ($stopRunBtn) $stopRunBtn.hidden = !(reportRunning || state.running || foregroundTrigger);
554
+ $runBtn.disabled = !app.runnable || reportRunning || state.running || foregroundStarting || foregroundStopping || !!foregroundTrigger;
555
+ if ($stopRunBtn) $stopRunBtn.hidden = !(reportRunning || state.running || foregroundStopping || foregroundTrigger);
508
556
  if ($reportStop) $reportStop.hidden = !foregroundTrigger;
509
557
  $runBtn.dataset.tip = app.runnable
510
558
  ? 'Run the approved workflow'
@@ -2370,11 +2418,9 @@
2370
2418
  showToast('Inputs set: ' + badge, 'ok');
2371
2419
  }
2372
2420
 
2373
- let reportRunning = false;
2374
2421
  // Set when the user hits Stop. api() throws a bare Error on the cancelled
2375
2422
  // response (the {cancelled:true} flag is lost), so we read this flag in the
2376
2423
  // run catch blocks to show "cancelled" rather than a misleading "run failed".
2377
- let cancelRequested = false;
2378
2424
  // The most recent rendered report per app id: { nodeId, label, html }. Lets a
2379
2425
  // double-click LOAD the last result instantly instead of re-running.
2380
2426
  const lastReportByApp = new Map();
@@ -2387,7 +2433,6 @@
2387
2433
  // (reportRunning). Its session id is server-namespaced with this prefix so its SSE
2388
2434
  // snapshots route here, never to the Routines list.
2389
2435
  const FG_SESSION_PREFIX = '__run__:';
2390
- let foregroundTrigger = null;
2391
2436
 
2392
2437
  // Reflect run-in-flight state in the ALWAYS-VISIBLE header so a run is stoppable even
2393
2438
  // when the HTML Viewer modal is closed (#39). The header ■ Stop run appears for the whole
@@ -2397,14 +2442,15 @@
2397
2442
  // the user, on the modal's × tooltip, that closing leaves the run going (Stop is in the
2398
2443
  // header) — the canvas keeps showing progress (markCanvasRunning), by design.
2399
2444
  function syncRunControls() {
2400
- const running = reportRunning || state.running || !!foregroundTrigger;
2445
+ const running = reportRunning || state.running || foregroundStarting || foregroundStopping || !!foregroundTrigger;
2446
+ const stoppable = reportRunning || state.running || foregroundStopping || !!foregroundTrigger;
2401
2447
  // The in-modal Stop is reachable only for a live foreground session (the header
2402
2448
  // Stop is occluded by the report-modal backdrop). Show it while one is live.
2403
2449
  if ($reportStop) $reportStop.hidden = !foregroundTrigger;
2404
2450
  if ($stopRunBtn) {
2405
- $stopRunBtn.hidden = !running;
2451
+ $stopRunBtn.hidden = !stoppable;
2406
2452
  // Reset to a fresh, clickable Stop each run; stopRun() flips it to "Cancelling…".
2407
- if (running && !cancelRequested) { $stopRunBtn.disabled = false; $stopRunBtn.textContent = '■ Stop run'; }
2453
+ if (stoppable && !cancelRequested && !foregroundStopping) { $stopRunBtn.disabled = false; $stopRunBtn.textContent = '■ Stop run'; }
2408
2454
  }
2409
2455
  if (running) {
2410
2456
  $runBtn.disabled = true;
@@ -2412,6 +2458,8 @@
2412
2458
  const app = currentId && apps.get(currentId);
2413
2459
  $runBtn.disabled = !(app && app.runnable);
2414
2460
  }
2461
+ const app = currentId && apps.get(currentId);
2462
+ if (app) paintRunState(app);
2415
2463
  // Rely on the native `disabled` attribute for AT state (paintGate also flips it); a
2416
2464
  // separate aria-disabled would be redundant and could go stale on a gate re-paint.
2417
2465
  if ($reportClose) {
@@ -2432,17 +2480,22 @@
2432
2480
  // `stopped` SSE snapshot is a harmless no-op rather than a double-handle.
2433
2481
  if (foregroundTrigger) {
2434
2482
  const ft = foregroundTrigger;
2483
+ foregroundStopping = true;
2435
2484
  foregroundTrigger = null;
2436
2485
  if ($stopRunBtn) { $stopRunBtn.disabled = true; $stopRunBtn.textContent = 'Stopping…'; }
2437
2486
  const ovStop = document.querySelector('.overlay-stop');
2438
2487
  if (ovStop) { ovStop.disabled = true; ovStop.textContent = 'Stopping…'; }
2439
- try { await api(`/api/trigger-run/${encodeURIComponent(ft.appId)}/stop`, { method: 'POST' }); } catch { /* best effort — the session may already be gone */ }
2440
- // Clear the canvas "running" pulse just like the regular-run stop below — the
2441
- // early return here previously skipped it, leaving nodes stuck on `running` (#116).
2442
- clearNodeStatus();
2443
- // A deliberate stop needs no toast — the subtitle change is the confirmation.
2444
- paintForegroundStopped('stopped');
2445
2488
  syncRunControls();
2489
+ try { await api(`/api/trigger-run/${encodeURIComponent(ft.appId)}/stop`, { method: 'POST' }); } catch { /* best effort — the session may already be gone */ }
2490
+ finally {
2491
+ // Clear the canvas "running" pulse just like the regular-run stop below — the
2492
+ // early return here previously skipped it, leaving nodes stuck on `running` (#116).
2493
+ clearNodeStatus();
2494
+ // A deliberate stop needs no toast — the subtitle change is the confirmation.
2495
+ paintForegroundStopped('stopped');
2496
+ foregroundStopping = false;
2497
+ syncRunControls();
2498
+ }
2446
2499
  return;
2447
2500
  }
2448
2501
  cancelRequested = true;
@@ -2451,6 +2504,7 @@
2451
2504
  const stopBtn = document.querySelector('.overlay-stop');
2452
2505
  if (stopBtn) { stopBtn.disabled = true; stopBtn.textContent = 'Cancelling…'; }
2453
2506
  if ($stopRunBtn) { $stopRunBtn.disabled = true; $stopRunBtn.textContent = 'Cancelling…'; }
2507
+ syncRunControls();
2454
2508
  try { await api('/api/run/stop', { method: 'POST' }); } catch { /* the run's own catch surfaces it */ }
2455
2509
  }
2456
2510
 
@@ -5747,7 +5801,7 @@
5747
5801
  const app = currentId && apps.get(currentId);
5748
5802
  if (!app) return;
5749
5803
  if (!app.runnable) { showToast($runBtn.dataset.tip, 'warn'); return; }
5750
- if (state.running || reportRunning || foregroundTrigger) return;
5804
+ if (state.running || reportRunning || foregroundStarting || foregroundStopping || foregroundTrigger) return;
5751
5805
 
5752
5806
  // Streaming/watch app → a LIVE FOREGROUND session, not a finite run (which would
5753
5807
  // never complete and time out at 60s). It re-renders the report in the Viewer on
@@ -5761,6 +5815,7 @@
5761
5815
  const rid = reportNodeId();
5762
5816
  if (!simulate && rid) { runReport(rid); return; }
5763
5817
 
5818
+ runningSimulation = simulate;
5764
5819
  state.running = true;
5765
5820
  cancelRequested = false;
5766
5821
  $runBtn.disabled = true;
@@ -5803,6 +5858,7 @@
5803
5858
  }
5804
5859
  } finally {
5805
5860
  state.running = false;
5861
+ runningSimulation = false;
5806
5862
  $runBtn.disabled = false;
5807
5863
  if ($simBtn) $simBtn.disabled = false;
5808
5864
  $runBtn.textContent = '▶ Run workflow';
@@ -8158,8 +8214,13 @@
8158
8214
  // Stop, and reflect the live state. We never compose HTML — the Viewer relays
8159
8215
  // exactly what the node returns (applyTriggerReport paints each fresh report).
8160
8216
  async function startForegroundTrigger(app) {
8161
- if (foregroundTrigger) return;
8217
+ if (foregroundTrigger || foregroundStarting || foregroundStopping) return;
8162
8218
  const id = currentId;
8219
+ // A completed finite-run cancellation leaves this flag set so its late SSE events stay ignored.
8220
+ // A new foreground lifecycle must start clean, or Stop inherits the old disabled/cancelling state.
8221
+ cancelRequested = false;
8222
+ foregroundStarting = true;
8223
+ syncRunControls();
8163
8224
  $reportTitle.textContent = `HTML Viewer · ${app.displayName}`;
8164
8225
  $reportModal.dataset.nodeId = reportNodeId() || '';
8165
8226
  const cached = lastReportByApp.get(id);
@@ -8174,7 +8235,6 @@
8174
8235
  const res = await api('/api/trigger-run', { method: 'POST', body: JSON.stringify({ id, inputs: currentInputs() }) });
8175
8236
  foregroundTrigger = { appId: id, sessionId: res.sessionId, firedCount: 0 };
8176
8237
  markFirstRunDone(id); // a real live session started → a streaming workflow's "first run" is no longer new
8177
- syncRunControls(); // header ■ Stop run becomes reachable; Run disabled while live
8178
8238
  paintForegroundListening();
8179
8239
  appendNarration(`Live session started for <strong>${escapeHtml(id)}</strong> — the report updates on every event. Click <strong>■ Stop run</strong> (top right) to end it.`);
8180
8240
  } catch (e) {
@@ -8198,7 +8258,9 @@
8198
8258
  $reportSub.textContent = 'Live session failed to start.';
8199
8259
  showToast('Live run failed: ' + msg, 'warn');
8200
8260
  }
8201
- syncRunControls();
8261
+ } finally {
8262
+ foregroundStarting = false;
8263
+ syncRunControls(); // starting → listening, or back to the compile gate after a failed start
8202
8264
  }
8203
8265
  }
8204
8266
 
@@ -106,7 +106,7 @@
106
106
  <span class="guide-beacon-ico" aria-hidden="true">✦</span>
107
107
  <span class="guide-beacon-label">Start here</span>
108
108
  </button>
109
- <span class="run-state" id="run-state" role="status" aria-live="polite"></span>
109
+ <span class="run-state" id="run-state" role="status" aria-live="polite" aria-atomic="true"></span>
110
110
  <!-- Restore + Customize: shown for a MAINTAINED (publisher:floless, non-forked) app. Restore
111
111
  appears only when its logic drifted (re-installs the official version); Customize (fork) is
112
112
  always available for a maintained app. When shown on drift they replace Compile, so a
@@ -163,7 +163,9 @@
163
163
  grouped form outright.
164
164
  The three per-container rules keep their SIZING and have dropped the now-inert accent-color, so
165
165
  nothing reads as if that were the remedy. */
166
- input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:14px;padding:0;border:0;
166
+ /* The 24px border box is the pointer target. Chromium's 14px input formerly kept its 2px UA margin
167
+ on each side, so -3px margins retain that measured 18px outer flex footprint (24 - 3 - 3). */
168
+ input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:24px;margin-block:-3px;padding:0;border:0;
167
169
  background:transparent;cursor:pointer}
168
170
  input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:var(--line)}
169
171
  input[type=range]::-moz-range-track{height:4px;border-radius:2px;background:var(--line)}
@@ -187,7 +189,9 @@
187
189
  control collapsed to a 120x4 sliver with no handle — measured in Chromium at forced-colors:active,
188
190
  and WORSE than the 16px native widget these users had before this block existed. */
189
191
  input[type=range]{appearance:revert;-webkit-appearance:revert;width:revert;height:revert;
190
- padding:revert;border:revert;background:revert}
192
+ margin-block:revert;padding:revert;border:revert;background:revert}
193
+ /* The OS owns the paint in forced colours; re-assert only target geometry after that hand-back. */
194
+ input[type=range]{height:24px;margin-block:-3px}
191
195
  input[type=range]::-webkit-slider-runnable-track{height:revert;border-radius:revert;background:revert}
192
196
  input[type=range]::-moz-range-track{height:revert;border-radius:revert;background:revert}
193
197
  input[type=range]::-moz-range-progress{height:revert;border-radius:revert;background:revert}
@@ -79,7 +79,9 @@
79
79
  Same declarations as steel-editor.html's block (indentation aside). Nothing enforces that they stay
80
80
  in step; verify-native-controls holds each surface to the contract independently, which is what
81
81
  actually matters if they ever drift. */
82
- input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:14px;padding:0;border:0;
82
+ /* The 24px border box is the pointer target. Chromium's 14px input formerly kept its 2px UA margin
83
+ on each side, so -3px margins retain that measured 18px outer flex footprint (24 - 3 - 3). */
84
+ input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:24px;margin-block:-3px;padding:0;border:0;
83
85
  background:transparent;cursor:pointer}
84
86
  input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:var(--line)}
85
87
  input[type=range]::-moz-range-track{height:4px;border-radius:2px;background:var(--line)}
@@ -103,7 +105,9 @@
103
105
  sliver with no handle — measured at forced-colors:active, and worse than the 16px native widget
104
106
  these users had before this block existed. */
105
107
  input[type=range]{appearance:revert;-webkit-appearance:revert;width:revert;height:revert;
106
- padding:revert;border:revert;background:revert}
108
+ margin-block:revert;padding:revert;border:revert;background:revert}
109
+ /* The OS owns the paint in forced colours; re-assert only target geometry after that hand-back. */
110
+ input[type=range]{height:24px;margin-block:-3px}
107
111
  input[type=range]::-webkit-slider-runnable-track{height:revert;border-radius:revert;background:revert}
108
112
  input[type=range]::-moz-range-track{height:revert;border-radius:revert;background:revert}
109
113
  input[type=range]::-moz-range-progress{height:revert;border-radius:revert;background:revert}
@@ -7630,6 +7630,9 @@
7630
7630
  }
7631
7631
  function openProjMenu(id, anchor) {
7632
7632
  menuFor = id;
7633
+ // An explicit popup wins over the passive fullscreen suggestion. The app-shell listener removes
7634
+ // the nudge synchronously without persisting its seen key, before this menu can receive a click.
7635
+ document.dispatchEvent(new Event('floless:passive-overlay-yield'));
7633
7636
  // The thumbnail items sit beside Rename because they are the same KIND of act — editing how the
7634
7637
  // card presents itself — where Duplicate/Export are lineage and Archive (behind the divider) is
7635
7638
  // lifecycle. "Thumbnail", not "snapshot": this app already spends that word twice (the screenshots
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.126.2",
3
+ "version": "0.126.3",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {