@floless/app 0.126.5 → 0.127.1

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,14 +2,14 @@
2
2
  name: floless-app-queue
3
3
  description: This skill should be used when the user has MULTIPLE floless.app requests queued from the Dashboard and wants to see them and choose which to process, rather than the AI just picking up the oldest one. Use it when the user says things like "what's in my floless queue", "list my queued floless requests", "show me the pending requests and let me pick", "I queued a few tweaks — which should I apply?", "let me choose what to process", or "pick from the floless queue". It lists the pending requests from GET /api/requests in plain language (type, which app/node/project, the instruction), asks the user which one(s) to apply, then hands each chosen request to the owning skill (floless-app-workflows / -tweak-contract / -ui / -rebake / -onboarding / -new-workflow / -steel-takeoff / -vectorize / -knowledge) which applies it and clears it. It is the interactive picker that sits in front of floless-app-bridge (which is the actual pull-apply-clear engine).
4
4
  metadata:
5
- version: 0.2.2
5
+ version: 0.2.3
6
6
  ---
7
7
 
8
8
  # floless.app queue picker
9
9
 
10
10
  floless.app is the **thin web UI**; the **terminal AI (you) is the brain**. The UI cannot edit
11
11
  `.flo` files — it **queues requests** (Tweak / use-template / customize-UI / rebake / edit-contract /
12
- walk-me-through / new-workflow / read-this-drawing / organize-or-adjust-the-knowledge-base) to a
12
+ walk-me-through / new-workflow / read-this-drawing / organize-or-adjust-the-knowledge-base / add-a-deterministic-knowledge-consult) to a
13
13
  local API. The **`floless-app-bridge`** skill pulls those and applies them, but it processes
14
14
  the queue **oldest-first with no choice step**. This skill adds the missing affordance: **list the
15
15
  whole queue in plain English and let the user pick which one(s) to process** — then route each pick
@@ -57,6 +57,7 @@ map to:
57
57
  | `revision-read` | "Read the attached drawing(s) into project **`<project>`** as a new version (+N file(s))" — the **initial** read when `baseVersion` is absent or ≤ 0, otherwise a **re-read** of a revised set | `floless-app-steel-takeoff` — but `floless-app-vectorize` when the app's lineage root (`appTemplateId`, falling back to `appId`) is `vectorize` |
58
58
  | `knowledge-organize` | "Organize the Project Knowledge Base for project **`<project>`**" | `floless-app-knowledge` |
59
59
  | `knowledge-adjust` | "Reshape the Project Knowledge Base for project **`<project>`** — *<instruction>*" | `floless-app-knowledge` |
60
+ | `knowledge-consult` | "Add a deterministic Workspace knowledge read (`kb`) and HTTP-200 gate (`gate`) to **`<appId>`**, then compile" | `floless-app-workflows` |
60
61
 
61
62
  The type union itself is `FlolessRequest` in `server/floless-store.ts` — a type in the union with no row
62
63
  above means this table is stale, and the union is right. The routing is `REQUEST_SKILL` in
@@ -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.5.0
5
+ version: 0.5.2
6
6
  ---
7
7
 
8
8
  # Building reusable .flo workflows in floless.app
@@ -316,6 +316,36 @@ 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
+ ## Consult and cite the project's knowledge at run time — retrieval only
320
+
321
+ Use `floless-workspace/read-knowledge` only when a run must retrieve a project's compiled knowledge
322
+ summaries. It is not a model or an interpretation step: AWARE receives a normal REST read, and the
323
+ approved `.lock` still determines every run decision. Add `floless-workspace@0.2.x`, then use the
324
+ proven `kb → gate` pair from `demos/floless-workspace-knowledge`:
325
+
326
+ The `kb` and `gate` pair must feed the existing terminal report. A pair that is not on the terminal
327
+ report path is incomplete: it reads knowledge without making the report's provenance visible.
328
+
329
+ Let the user pick the target by name with **`widget: workspace-knowledge-project`**. The themed
330
+ picker calls `GET /api/workspace-projects` and offers only rows where `hasKnowledge` is true; it does
331
+ not use `workspace-project` or `/approved`, because model approval is unrelated to published knowledge.
332
+ Its empty state must send the user to **Organize** the project's Knowledge step, never to approve a
333
+ model.
334
+
335
+ - **Cite:** pass `kb.body.generation.generationId` and the top page slug to a downstream report so it
336
+ can say which generation/page it consulted. Both `generation` and `pages[0]` are optional on a 200:
337
+ use `{% if kb.body.generation %}…{% endif %}` and `{% if kb.body.pages %}…{% endif %}` to short-circuit
338
+ each deep reference. `default()` cannot protect an undefined path because minijinja raises while
339
+ resolving the path, before applying the filter.
340
+ - **Gate:** put `inline: { kind: predicate, code: "e.status == 200" }` immediately after the read.
341
+ Its plain-English `description:` must say it stops cleanly when the read fails and directs the user
342
+ to press **Organize** on the project's Knowledge step. A 200 with no published knowledge or no page
343
+ matching the subject is legitimate retrieval, not an excuse to invent a citation; make the report
344
+ say so honestly.
345
+
346
+ Never add an agent/LLM node, vector store, or KB-drift Run gate to this path. Interpretation belongs
347
+ at compose time; runtime knowledge may only be retrieved, cited, or deterministically gated.
348
+
319
349
  ## Author against the project's knowledge, not your priors — COMPOSE TIME
320
350
 
321
351
  The section above is the workflow reading project data **at run time**. This is a different thing:
package/dist/web/app.css CHANGED
@@ -1078,6 +1078,13 @@
1078
1078
  transition: all 0.15s;
1079
1079
  user-select: none;
1080
1080
  }
1081
+ button.fav-chip {
1082
+ appearance: none;
1083
+ font: inherit;
1084
+ color: inherit;
1085
+ cursor: pointer;
1086
+ }
1087
+ button.fav-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
1081
1088
  .fav-chip:hover {
1082
1089
  border-color: var(--accent);
1083
1090
  transform: translateY(-1px);
@@ -2047,6 +2054,19 @@
2047
2054
  .req-run-note { margin: 0; color: var(--text-muted); line-height: 1.45; }
2048
2055
  .req-run-where { font-family: var(--mono); font-size: 10px; color: var(--text-dim);
2049
2056
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2057
+ /* §F's only recovery action: copy the server-stamped command, then continue in the user's own
2058
+ terminal. It is a button rather than an input so it cannot resemble somewhere to answer the
2059
+ parked question; long commands wrap instead of truncating the one thing the user must recover. */
2060
+ .req-run-resume { display: flex; flex-direction: column; gap: 4px; }
2061
+ .req-run-resume-label { color: var(--text-muted); font-size: 10.5px; font-weight: 600; }
2062
+ .req-run-resume-command { appearance: none; width: 100%; min-height: 30px; padding: 6px 8px;
2063
+ text-align: left; cursor: pointer; color: var(--accent-bright); background: var(--surface-2);
2064
+ border: 1px solid var(--border-strong); border-radius: 4px; font-family: var(--mono); font-size: 10.5px;
2065
+ line-height: 1.45; overflow-wrap: anywhere; transition: border-color 0.12s, background 0.12s, color 0.12s; }
2066
+ .req-run-resume-command code { font: inherit; }
2067
+ .req-run-resume-command:hover { border-color: var(--accent-dim); background: var(--accent-soft); color: var(--text); }
2068
+ .req-run-resume-command:active { background: var(--surface-3); }
2069
+ .req-run-resume-command:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
2050
2070
  /* The agent's question, VERBATIM. A quote, deliberately — the warn rule and the italic say
2051
2071
  "somebody said this to you", where a plain paragraph would read as floless's own prose and a
2052
2072
  field would read as somewhere to answer. There is nowhere to answer; that is the point. */
@@ -4812,6 +4832,8 @@ table.hist tr.current td { background:var(--accent-soft); }
4812
4832
  flight and an animation would say otherwise. */
4813
4833
  .ws-revision-card.state-staged { border-left:3px solid var(--accent); }
4814
4834
  .ws-revision-card.state-staged .wrc-dot { flex:none; width:8px; height:8px; border-radius:50%; background:var(--accent); }
4835
+ .ws-revision-card.state-filter-ready { border-left:3px solid var(--accent); }
4836
+ .ws-revision-card.state-filter-ready .wrc-dot { flex:none; width:8px; height:8px; border-radius:50%; background:var(--accent); }
4815
4837
  .ws-revision-card .wrc-actions { display:flex; gap:6px; flex:none; }
4816
4838
  @media (prefers-reduced-motion: reduce) { .ws-revision-card .wrc-spin { animation:none; } }
4817
4839
  .hist .gate-badge.ai-read { background:var(--accent-soft); border-color:var(--accent-dim); color:var(--accent-bright); }
package/dist/web/aware.js CHANGED
@@ -1050,6 +1050,9 @@
1050
1050
  // publication clears, rather than keeping the previous answer forever.
1051
1051
  await commitPublicationAvailability(id, read, contractState);
1052
1052
  currentId = id;
1053
+ // The Templates strip also carries app-scoped quick actions. Templates may have
1054
+ // loaded before this app did, so repaint it once the ownership boundary is known.
1055
+ renderFavBar();
1053
1056
  try { localStorage.setItem(LS_LAST_APP, id); } catch { /* private mode / quota */ }
1054
1057
  transform(app);
1055
1058
  liveTrace.length = 0;
@@ -2404,6 +2407,17 @@
2404
2407
  } catch { return []; }
2405
2408
  }
2406
2409
 
2410
+ // Knowledge reads are scoped by a published knowledge base, never by a model approval. Keep this
2411
+ // separate from `workspace-project`: approval answers whether a model is runnable, while this
2412
+ // picker answers whether the project has knowledge the read-knowledge node can consult.
2413
+ async function fetchKnowledgeProjects() {
2414
+ try {
2415
+ const r = await fetch('/api/workspace-projects');
2416
+ const j = await r.json().catch(() => null);
2417
+ return j && j.ok && Array.isArray(j.projects) ? j.projects.filter((p) => p && p.hasKnowledge === true) : [];
2418
+ } catch { return []; }
2419
+ }
2420
+
2407
2421
  // Double-click the input node → styled dialog to set the declared inputs. Writes
2408
2422
  // to appInputValues; the header "▶ Run workflow" uses them. No native window.prompt.
2409
2423
  async function openInputsDialog() {
@@ -2412,6 +2426,7 @@
2412
2426
  const cur = currentInputs();
2413
2427
  const isVisual = (inp) => inp.widget === 'file' || inp.type === 'image' || inp.type === 'file';
2414
2428
  const isProject = (inp) => inp.widget === 'workspace-project';
2429
+ const isKnowledgeProject = (inp) => inp.widget === 'workspace-knowledge-project';
2415
2430
  const visualNames = new Set(app.inputs.filter(isVisual).map((i) => i.name));
2416
2431
  // A project-picker input needs the live list of approved projects. Fetch ONE list per DISTINCT
2417
2432
  // `workspaceApp` filter and let the SERVER decide what matches, rather than fetching everything
@@ -2428,6 +2443,7 @@
2428
2443
  .map((i) => (typeof i.workspaceApp === 'string' && i.workspaceApp ? i.workspaceApp : '')))];
2429
2444
  const approvedByFilter = new Map();
2430
2445
  for (const f of projectFilters) approvedByFilter.set(f, await fetchApprovedProjects(f || undefined));
2446
+ const knowledgeProjects = app.inputs.some(isKnowledgeProject) ? await fetchKnowledgeProjects() : [];
2431
2447
  const fields = app.inputs.map((inp) => {
2432
2448
  if (isVisual(inp)) return {
2433
2449
  name: inp.name,
@@ -2459,6 +2475,26 @@
2459
2475
  emptyNote: 'No approved projects yet — open <strong>Workspaces</strong>, create a project, and Approve it to use it here.',
2460
2476
  };
2461
2477
  }
2478
+ if (isKnowledgeProject(inp)) {
2479
+ const options = knowledgeProjects
2480
+ .slice().sort((a, b) => String(a.name).localeCompare(String(b.name)))
2481
+ .map((p) => ({
2482
+ value: p.id,
2483
+ meta: `${appLabel(p.templateId || p.app)} · Knowledge published`,
2484
+ label: p.name,
2485
+ search: `${p.name} ${p.id} ${p.app} ${appLabel(p.templateId || p.app)}`,
2486
+ }));
2487
+ return {
2488
+ name: inp.name,
2489
+ label: inp.name + (inp.description ? ` — ${inp.description}` : ''),
2490
+ type: 'select',
2491
+ options,
2492
+ value: cur[inp.name] != null ? cur[inp.name] : '',
2493
+ placeholder: 'Select a project with knowledge…',
2494
+ disabledLabel: 'No project knowledge yet',
2495
+ emptyNote: 'No Workspace project has published knowledge yet — open <strong>Workspaces</strong>, choose a project, and Organize its Knowledge step before running this workflow.',
2496
+ };
2497
+ }
2462
2498
  return {
2463
2499
  name: inp.name,
2464
2500
  label: inp.name + (inp.description ? ` — ${inp.description}` : ''),
@@ -6894,20 +6930,40 @@
6894
6930
  catch (e) { reportErr(e); }
6895
6931
  }
6896
6932
 
6933
+ async function requestKnowledgeConsult() {
6934
+ const app = currentId && apps.get(currentId);
6935
+ // A maintained workflow is form-only until the user explicitly forks it. Hide the affordance in
6936
+ // renderFavBar in that state, and retain this guard so a stale DOM click cannot queue a logic edit.
6937
+ if (!app || (app.publisher === 'floless' && !app.forked)) return;
6938
+ try {
6939
+ const { request } = await api('/api/knowledge-consult', { method: 'POST', body: JSON.stringify({ appId: app.id }) });
6940
+ const copied = await copyToClipboard(markedInstruction(request));
6941
+ appendNarration(`Queued a deterministic <code>kb → gate</code> knowledge read for <code>${escapeHtml(app.id)}</code> — your terminal AI will add it. Choose the project and subject, then compile.${copied ? ' The instruction is on your clipboard.' : ''}`);
6942
+ showToast(copied ? 'Knowledge read + gate queued · copied to clipboard' : 'Knowledge read + gate queued', 'ok');
6943
+ loadRequests();
6944
+ } catch (e) { reportErr(e); }
6945
+ }
6946
+
6897
6947
  // Template chips: click = "use in this app" (reverse channel); × = delete.
6898
6948
  renderFavBar = function renderFavBarTpl() {
6949
+ const app = currentId && apps.get(currentId);
6950
+ const canConsultKnowledge = !!app && !(app.publisher === 'floless' && !app.forked);
6899
6951
  const tpls = state.favorites;
6900
6952
  $favCount.textContent = tpls.length;
6901
- if (!tpls.length) { $favChipRow.innerHTML = ''; $favBarEmpty.style.display = 'block'; return; }
6902
- $favBarEmpty.style.display = 'none';
6903
- $favChipRow.innerHTML = tpls.map((t) => `
6953
+ $favBarEmpty.style.display = tpls.length ? 'none' : 'block';
6954
+ $favChipRow.innerHTML = (canConsultKnowledge
6955
+ ? `<button type="button" class="fav-chip knowledge-consult" data-knowledge-consult data-tip="Add a knowledge read and deterministic gate to this workflow. Choose the project and subject before compiling."><span class="cat">ADD</span><span class="name">Consult knowledge</span></button>`
6956
+ : '') + tpls.map((t) => `
6904
6957
  <div class="fav-chip" data-tpl="${escapeAttr(t.id)}" data-tip="Click to use · ${escapeAttr(t.category)} · ${escapeAttr((t.node.agent || t.node.kind) + (t.node.command ? '/' + t.node.command : ''))}">
6905
6958
  <span class="cat">${escapeHtml(t.category)}</span>
6906
6959
  <span class="name">${escapeHtml(t.name)}</span>
6907
6960
  <span class="edit" data-tip="Rename / recategorize" aria-label="Edit template">✎</span>
6908
6961
  <span class="del" data-tip="Delete template" aria-label="Delete template">×</span>
6909
6962
  </div>`).join('');
6963
+ const consult = $favChipRow.querySelector('[data-knowledge-consult]');
6964
+ if (consult) consult.onclick = requestKnowledgeConsult;
6910
6965
  $favChipRow.querySelectorAll('.fav-chip').forEach((chip) => {
6966
+ if (chip.dataset.knowledgeConsult !== undefined) return;
6911
6967
  const id = chip.dataset.tpl;
6912
6968
  chip.onclick = (e) => { if (e.target.closest('.del') || e.target.closest('.edit')) return; useTemplate(id); };
6913
6969
  chip.querySelector('.edit').onclick = (e) => { e.stopPropagation(); openEditTemplate(id); };
@@ -7018,11 +7074,24 @@
7018
7074
  stopped: { badge: 'Stopped', cls: 'muted', note: () => 'You stopped this run.' },
7019
7075
  };
7020
7076
 
7021
- function runStatusHtml(run) {
7077
+ // A parked run is a hand-off, not a browser-owned conversation (§G). The server stamps a command
7078
+ // only for this explicit recovery set, but retain the same guard here: a newer/malformed server
7079
+ // response must not turn an arbitrary terminal state into an implied "resume" instruction.
7080
+ const RESUMABLE_RUN_STATES = new Set(['needs-you', 'stopped', 'interrupted', 'contract-violation', 'exited-unresolved']);
7081
+
7082
+ async function copyResumeCommand(command) {
7083
+ if (!command) return 'empty';
7084
+ return (await copyToClipboard(command)) ? 'ok' : 'denied';
7085
+ }
7086
+
7087
+ function runStatusHtml(run, stampedResumeCommand) {
7022
7088
  if (!run || !run.state) return '';
7023
7089
  const v = RUN_VIEW[run.state] || { badge: String(run.state), cls: 'muted', note: () => '' };
7024
7090
  const rt = runtimeLabel(run.runtime);
7025
7091
  const note = v.note(rt);
7092
+ // `resumeCommand` belongs to the SERVER'S request view, not persisted `run` metadata: the
7093
+ // store deliberately carries only runtime/session identity, while terminal-runtime.ts owns argv.
7094
+ const resumeCommand = RESUMABLE_RUN_STATES.has(run.state) ? stampedResumeCommand : null;
7026
7095
  return `
7027
7096
  <div class="req-run-status">
7028
7097
  <div class="req-run-head">
@@ -7031,7 +7100,8 @@
7031
7100
  </div>
7032
7101
  ${note ? `<p class="req-run-note">${escapeHtml(note)}</p>` : ''}
7033
7102
  ${run.question ? `<p class="req-run-question">${escapeHtml(run.question)}</p>` : ''}
7034
- ${run.cwd ? `<div class="req-run-where">${escapeHtml(rt)} · ${escapeHtml(run.cwd)}</div>` : ''}
7103
+ ${resumeCommand ? `<div class="req-run-resume"><span class="req-run-resume-label">Continue in terminal</span><button type="button" class="req-run-resume-command" data-resume-command="${escapeAttr(resumeCommand)}" data-tip="Copy command to continue this session" aria-label="Copy resume command: ${escapeAttr(resumeCommand)}"><code>${escapeHtml(resumeCommand)}</code></button></div>` : ''}
7104
+ ${run.cwd ? `<div class="req-run-where">Run in · ${escapeHtml(run.cwd)}</div>` : ''}
7035
7105
  ${run.lastOutput ? `<details class="req-run-output"><summary>Show what it printed</summary><pre>${escapeHtml(run.lastOutput)}</pre></details>` : ''}
7036
7106
  </div>`;
7037
7107
  }
@@ -7381,7 +7451,7 @@
7381
7451
  }
7382
7452
 
7383
7453
  function requestLabel(r) {
7384
- return r.type === 'use-template' ? 'template' : r.type === 'ui-customize' ? 'dashboard' : r.type === 'rebake' ? 're-bake' : r.type === 'revision-read' ? 'revision' : r.type === 'guide' ? 'guide' : r.type === 'new-workflow' ? 'new workflow' : r.type === 'knowledge-organize' ? 'organize' : r.type === 'knowledge-adjust' ? 'adjust' : r.type === 'tweak-contract' ? 'contract' : 'tweak';
7454
+ return r.type === 'use-template' ? 'template' : r.type === 'ui-customize' ? 'dashboard' : r.type === 'rebake' ? 're-bake' : r.type === 'revision-read' ? 'revision' : r.type === 'guide' ? 'guide' : r.type === 'new-workflow' ? 'new workflow' : r.type === 'knowledge-organize' ? 'organize' : r.type === 'knowledge-adjust' ? 'adjust' : r.type === 'knowledge-consult' ? 'knowledge' : r.type === 'tweak-contract' ? 'contract' : 'tweak';
7385
7455
  }
7386
7456
 
7387
7457
  // Escape `text`, wrapping every case-insensitive occurrence of `q` in <mark>. Splits the RAW
@@ -7555,11 +7625,11 @@
7555
7625
  ? '<span class="req-lifecycle" data-tip="This clears itself when your terminal AI finishes or fails the organize">finishing in your terminal</span>'
7556
7626
  : inFlight
7557
7627
  ? '<span class="req-lifecycle" data-tip="Stop the run first — clearing it now would leave the agent working on a request that no longer exists">running</span>'
7558
- : `<button class="req-del" data-id="${escapeAttr(r.id)}" data-tip="Clear this request">×</button>`;
7559
- // A parked run gets NO re-run: it is waiting on a decision only the human can make, and a
7560
- // second headless attempt would either abandon that question or look like floless answering
7561
- // it. Every other terminal state has nothing pending, so running again is a fair offer.
7562
- const canRunNow = headlessReady() && r.canRun && !inFlight && !(run && run.state === 'needs-you');
7628
+ : `<button class="req-del" data-id="${escapeAttr(r.id)}" data-tip="${r.resumeCommand ? 'Clear this request and discard its saved terminal session' : 'Clear this request'}">×</button>`;
7629
+ // A server-stamped handoff gets NO re-run. The original terminal session may already be live;
7630
+ // starting a second headless agent would put two writers in one folder. The browser decides no
7631
+ // policy here: it simply withholds ▶ whenever the server supplied the resume command.
7632
+ const canRunNow = headlessReady() && r.canRun && !inFlight && !r.resumeCommand;
7563
7633
  const runBtn = inFlight
7564
7634
  ? `<button class="req-stop" data-id="${escapeAttr(r.id)}" data-tip="Stop this run">■</button>`
7565
7635
  : canRunNow
@@ -7571,12 +7641,12 @@
7571
7641
  <div class="req-head"><span class="${badgeCls}">${label}</span> ${owner ? `<span class="req-owner">${highlightQuery(owner, requestQuery)}</span>` : ''}${time}</div>
7572
7642
  <div class="req-instruction">${highlightQuery(instructionFor(r), requestQuery) || 'This request has no instruction, so it can’t be handed to your terminal AI. Clear it and queue it again.'}</div>
7573
7643
  ${r.snapshots && r.snapshots.length ? `<div class="req-thumbs">${r.snapshots.map((sp, i) => { const pdf = /\.pdf$/i.test(String(sp)); return `<button type="button" class="req-thumb" data-id="${escapeAttr(r.id)}" data-n="${i}" aria-label="View ${pdf ? 'PDF' : 'screenshot'} ${i + 1}">${pdf ? '<span class="req-thumb-pdf">PDF</span>' : `<img src="/api/requests/${encodeURIComponent(r.id)}/snapshot/${i}" alt="">`}</button>`; }).join('')}</div>` : ''}
7574
- ${runStatusHtml(run)}
7644
+ ${runStatusHtml(run, r.resumeCommand)}
7575
7645
  ${!r.canRun && r.runWhy && anyRunnable ? `<div class="req-why-not">Runs only from your terminal — ${escapeHtml(r.runWhy)}</div>` : ''}
7576
7646
  </div>
7577
7647
  <div class="req-actions">
7578
7648
  ${runBtn}
7579
- <button class="req-copy" data-id="${escapeAttr(r.id)}" data-tip="Copy this instruction">⧉</button>
7649
+ ${r.resumeCommand ? '' : `<button class="req-copy" data-id="${escapeAttr(r.id)}" data-tip="Copy this instruction">⧉</button>`}
7580
7650
  ${del}
7581
7651
  </div>
7582
7652
  </div>`;
@@ -7602,6 +7672,14 @@
7602
7672
  else showToast(...copyFailToast(res));
7603
7673
  };
7604
7674
  });
7675
+ $list.querySelectorAll('.req-run-resume-command').forEach((b) => {
7676
+ b.onclick = async () => {
7677
+ const res = await copyResumeCommand(b.dataset.resumeCommand || '');
7678
+ if (res === 'ok') showToast('Copied — run it in the folder shown below', 'ok');
7679
+ else if (res === 'empty') showToast('Nothing to copy — this run has no resume command', 'err');
7680
+ else showToast('Could not copy — select the command and copy it manually', 'err');
7681
+ };
7682
+ });
7605
7683
  $list.querySelectorAll('.req-del').forEach((b) => { b.onclick = () => deleteOneRequest(b.dataset.id); });
7606
7684
  $list.querySelectorAll('.req-thumb').forEach((b) => {
7607
7685
  b.onclick = () => window.open(`/api/requests/${encodeURIComponent(b.dataset.id)}/snapshot/${b.dataset.n}`, '_blank');
@@ -116,6 +116,9 @@ footer{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
116
116
  #canvas image.bg{opacity:.28}
117
117
  #canvas path.el{pointer-events:stroke}
118
118
  #canvas text.el{pointer-events:all;cursor:pointer;user-select:none}
119
+ /* Filtered-out vector content stays as quiet, non-selectable drawing context. The selector must beat
120
+ the text rule above, otherwise dim labels still open the eyedropper. */
121
+ #canvas .el.is-context{opacity:.2;pointer-events:none}
119
122
  #empty{position:absolute;inset:0;display:none;align-items:center;justify-content:center;padding:40px;text-align:center;color:var(--mut)}
120
123
  #empty.show{display:flex}
121
124
  #empty>div{max-width:44ch}
@@ -291,6 +294,7 @@ import { matchesActive, modeDims, canonicalMode, selFromFilter, eyedropperAdd, c
291
294
  const APP_ID = new URLSearchParams(location.search).get('app') || '';
292
295
  // Workspaces: project-keyed contract (see steel-editor.html). Empty = legacy app-keyed URLs.
293
296
  const PROJECT = new URLSearchParams(location.search).get('project') || '';
297
+ let revisionRequest = new URLSearchParams(location.search).get('revisionRequest') || '';
294
298
  const PROJECT_QS = PROJECT ? ('?project=' + encodeURIComponent(PROJECT)) : '';
295
299
  const CONTRACT_QS = PROJECT ? (PROJECT_QS + '&quietMissing=1') : PROJECT_QS;
296
300
  const SVGNS = 'http://www.w3.org/2000/svg';
@@ -972,10 +976,12 @@ function syncFacetChecks(){
972
976
  function apply(){
973
977
  for(const { node, el } of nodes){
974
978
  const vis = matchesActive(el, mode, sel);
975
- node.style.display = vis ? '' : 'none';
979
+ node.classList.toggle('is-context', !vis);
980
+ node.setAttribute('aria-hidden', String(!vis));
976
981
  }
982
+ if(eyeEl && !matchesActive(eyeEl, mode, sel)) closeEye();
977
983
  const cur = (sheets[active] && sheets[active].elements) || [];
978
- let html = '<b>' + countShown(cur, mode, sel) + '</b> of <b>' + cur.length + '</b> shown';
984
+ let html = '<b>' + countShown(cur, mode, sel) + '</b> selected of <b>' + cur.length + '</b> · remaining elements shown as context';
979
985
  if(sheets.length > 1){
980
986
  let sa = 0, ta = 0;
981
987
  for(const s of sheets){ const els = s.elements || []; sa += countShown(els, mode, sel); ta += els.length; }
@@ -1122,6 +1128,14 @@ async function saveNow(){
1122
1128
  // external change and reload itself the instant the user saved. The id is consumed by that echo, or
1123
1129
  // dropped when the write fails, or discarded when the SSE channel closes (nothing can echo after that).
1124
1130
  const t = res.headers.get('ETag'); if(t) serverEtag = t;
1131
+ if(revisionRequest && PROJECT && serverEtag){
1132
+ const checkpoint = await fetch(`/api/projects/${encodeURIComponent(PROJECT)}/revision-requests/${encodeURIComponent(revisionRequest)}/filter-saved`, {
1133
+ method:'POST', headers:{'content-type':'application/json'}, body:JSON.stringify({etag:serverEtag}),
1134
+ });
1135
+ if(!checkpoint.ok) throw new Error(await checkpoint.text());
1136
+ revisionRequest = '';
1137
+ history.replaceState(null, '', location.pathname + PROJECT_QS);
1138
+ }
1125
1139
  dirty = false; setSaved('saved');
1126
1140
  } catch(e){
1127
1141
  // The id is deliberately KEPT here. No response arrived, so we do not know whether the write landed —
@@ -5289,6 +5289,7 @@
5289
5289
  function resetRevisionState() {
5290
5290
  lastRevState = 'none';
5291
5291
  revCardReq = null;
5292
+ $revisionCard._renderKey = '';
5292
5293
  revisionGen++; // voids any render still in flight for the project being left
5293
5294
  stopRevisionPoll();
5294
5295
  $revisionCard.hidden = true;
@@ -5356,6 +5357,18 @@
5356
5357
 
5357
5358
  function buildPendingCard(req) {
5358
5359
  const n = (req.sourceRefs && req.sourceRefs.length) || (req.snapshots && req.snapshots.length) || 1;
5360
+ if (req.prepassReady) {
5361
+ // The terminal AI has completed the deterministic pre-read; it is now waiting on the real Filter
5362
+ // Save checkpoint below, not on another pasted instruction. A static dot avoids claiming work is
5363
+ // still running, and the real action only focuses the existing Filter iframe — it never fakes Save.
5364
+ const dot = revEl('span', 'wrc-dot'); dot.setAttribute('aria-hidden', 'true');
5365
+ const txt = revEl('span', 'wrc-text');
5366
+ txt.appendChild(revEl('b', null, 'Steel Filter is ready.'));
5367
+ txt.appendChild(document.createTextNode(' Review the Steel Filter and Save to continue the read.'));
5368
+ const review = revEl('button', 'btn-mini', 'Review Filter');
5369
+ review.type = 'button'; review.dataset.revfilter = ''; review.setAttribute('data-tip', 'Focus the Steel Filter below');
5370
+ return [dot, txt, review];
5371
+ }
5359
5372
  const spin = revEl('span', 'wrc-spin'); spin.setAttribute('aria-hidden', 'true');
5360
5373
  const txt = revEl('span', 'wrc-text');
5361
5374
  txt.appendChild(revEl('b', null, `Reading the ${isInitialRevisionRead(req) ? 'initial' : 'revised'} set…`));
@@ -5489,12 +5502,25 @@
5489
5502
  // paints the truth.
5490
5503
  if (revReviewState) return;
5491
5504
  revCardReq = failed || staged || pending;
5492
- $revisionCard.className = 'ws-revision-card state-' + state;
5505
+ if (pending?.prepassReady && frames.drawings.dataset.want) {
5506
+ const u = new URL(frames.drawings.dataset.want, location.origin);
5507
+ if (u.searchParams.get('revisionRequest') !== pending.id) {
5508
+ u.searchParams.set('revisionRequest', pending.id);
5509
+ frames.drawings.dataset.want = u.pathname + u.search;
5510
+ if (frames.drawings.dataset.loaded) frames.drawings.src = frames.drawings.dataset.want;
5511
+ }
5512
+ }
5513
+ const cardKey = `${state}:${revCardReq ? revCardReq.id : ''}:${pending && pending.prepassReady ? 'filter-ready' : 'read-pending'}`;
5514
+ if ($revisionCard._renderKey === cardKey && !$revisionCard.hidden) return; // preserve focus across the 3 s poll
5515
+ const restoreFocus = typeof document !== 'undefined' && $revisionCard.contains(document.activeElement);
5516
+ $revisionCard._renderKey = cardKey;
5517
+ $revisionCard.className = 'ws-revision-card state-' + state + (pending && pending.prepassReady ? ' state-filter-ready' : '');
5493
5518
  $revisionCard.replaceChildren(...(
5494
5519
  state === 'failed' ? buildFailedCard(failed)
5495
5520
  : state === 'staged' ? buildStagedCard(staged)
5496
5521
  : buildPendingCard(pending)));
5497
5522
  $revisionCard.hidden = false;
5523
+ if (restoreFocus) $revisionCard.querySelector('button')?.focus();
5498
5524
  }
5499
5525
 
5500
5526
  $revisionCard.addEventListener('click', async (e) => {
@@ -5509,6 +5535,8 @@
5509
5535
  if (res === 'ok') showToast('Instruction copied', 'ok');
5510
5536
  else if (res === 'empty') showToast('Nothing to copy — this request has no instruction', 'err');
5511
5537
  else showToast('Copy blocked — use the Requests panel', 'warn');
5538
+ } else if (e.target.closest('[data-revfilter]')) {
5539
+ frames.drawings?.focus();
5512
5540
  } else if (e.target.closest('[data-revdismiss]')) {
5513
5541
  try { await api(`/api/requests/${encodeURIComponent(req.id)}`, { method: 'DELETE' }); } catch { /* already gone */ }
5514
5542
  lastRevState = 'none';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.126.5",
3
+ "version": "0.127.1",
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": {