@floless/app 0.105.0 → 0.106.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.
@@ -33,7 +33,7 @@
33
33
  "detail_bubbles": { "type": "object", "additionalProperties": true, "description": "sheet -> { detail number -> normalized [fx,fy] bubble anchor }." },
34
34
  "source": { "type": "object", "additionalProperties": true, "description": "Provenance: where this takeoff was read from (name/path/sheet/sha256/read_at)." },
35
35
  "filter": { "type": "object", "additionalProperties": true, "description": "Layer/thickness/colour filter pre-stage, unchanged from v1. Carries no member ids and no world coordinates, so identity migration does not touch it — hence still open (epic §5.4 enumeration is scoped to the objects this epic defines)." },
36
- "connections": { "type": "array", "items": { "type": "object", "required": ["id"], "additionalProperties": true, "properties": { "id": { "type": "string", "minLength": 1 } } }, "description": "Vendor-neutral connection library. `ends[].conn` and `joints[].conn` reference a row's `id`, so the id is required and non-empty here; every other field stays open (the library's shape is not what this epic changes)." },
36
+ "connections": { "type": "array", "items": { "type": "object", "required": ["id"], "additionalProperties": true, "properties": { "id": { "type": "string", "minLength": 1 } } }, "description": "Vendor-neutral connection library. `ends[].conn` and `joints[].conn` reference a row's `id`, so the id is required and non-empty here; every other field stays open (the library's shape is not what this epic changes). A row may also carry `recipe` / `notes` / `image` — what the detail BUILDS, and the rules that come with it — which is how a detail callout on a member end becomes real geometry (v1 $defs/connectionRecipe documents the shape; server/detail-recipes.ts is the reader). Deliberately NOT constrained here: that shape belongs to the detailing feature and migrates through this key untouched, because `connections` is copied wholesale and $.connections[] is not enumerated by the migration's field dispositions." },
37
37
  "joints": { "type": "array", "items": { "$ref": "#/$defs/joint" }, "description": "Placed connections the connection engine expands into real 3D parts." },
38
38
  "dims3d": { "type": "array", "items": { "$ref": "#/$defs/dim3" }, "description": "Draft-only 3D dimensions, world mm. Model-global. NOT baked into the lock / IFC / BOM." },
39
39
  "detail_placements": { "type": "array", "items": { "$ref": "#/$defs/detailPlacement" }, "description": "Draft-only placed 2D detail images. Ids are SHEET-unique, not global." },
@@ -247,13 +247,63 @@
247
247
  "type": "object",
248
248
  "required": ["id", "type"],
249
249
  "additionalProperties": true,
250
- "description": "One connection-library row. `detail` is the firm's VENDOR-NEUTRAL design detail#; `targets` is an open map platform→component id (tekla/sds2/revit/…), never hardcoded to one platform.",
250
+ "description": "One connection-library row. `detail` is the firm's VENDOR-NEUTRAL design detail#; `targets` is an open map platform→component id (tekla/sds2/revit/…), never hardcoded to one platform. A row may also say what the detail BUILDS (`recipe`) and carry the notes that come with it (`notes`), which is what lets a detail bound to a member end become real connection geometry — see server/detail-recipes.ts.",
251
251
  "properties": {
252
252
  "id": { "type": "string", "description": "Stable row id, e.g. cx-moment-1." },
253
253
  "type": { "type": "string", "description": "moment | drag | shear | braced | pinned | fixed (free string allowed)." },
254
- "detail": { "type": "string", "description": "Design detail number, e.g. 50S504 — the firm's document, platform-neutral." },
254
+ "detail": { "type": "string", "description": "Design detail number, e.g. 50S504 — the firm's document, platform-neutral. Also the key an end's `detail` callout is matched against, on a NARROW normalisation (case/whitespace, and -/ treated alike); a callout matching two rows is refused as ambiguous rather than resolved to either." },
255
255
  "targets": { "type": "object", "additionalProperties": { "type": "string" }, "description": "platform → component id, e.g. { \"tekla\": \"146\" }. Open map; add sds2/revit freely." },
256
- "source": { "enum": ["company-rules", "user", "drawing"], "description": "Where the row came from (drives the connection confidence band)." }
256
+ "source": { "enum": ["company-rules", "user", "drawing"], "description": "Where the row came from (drives the connection confidence band)." },
257
+ "recipe": { "$ref": "#/$defs/connectionRecipe", "description": "What this detail builds. Absent = the row is an identity/mapping only (its ends can still be annotated; they just can't be built from it)." },
258
+ "notes": {
259
+ "type": "array",
260
+ "items": { "type": "object", "required": ["text"], "additionalProperties": true, "properties": {
261
+ "text": { "type": "string", "description": "The note verbatim, e.g. \"All bolts 3/4\\\"Ø A325 UNO\"." },
262
+ "source": { "type": "string", "description": "drawing | user | ai — where the note came from." }
263
+ } },
264
+ "description": "Everything else the detail says — the rules the detailing must follow. STORED, SURFACED and RELAYED to the terminal AI, never interpreted by the UI (turning a note into params is an AI read; floless does not call an LLM). Rendered escaped."
265
+ },
266
+ "image": { "type": "string", "description": "Optional `custom_details` key for this detail's figure. Explicit because the fallback (previewFor) parses S-### sheet names, which is a convention no project is required to follow." }
267
+ }
268
+ },
269
+ "connectionRecipe": {
270
+ "type": "object",
271
+ "additionalProperties": true,
272
+ "description": "A detail as a buildable thing: a TYPICAL arrangement (`kind` + `params`) plus a `schedule` that varies the numbers by member size. Real details work this way — a typical figure on the sheet, dimensions in a table beside it — so one row covers every size it is drawn for.",
273
+ "properties": {
274
+ "kind": { "type": "string", "description": "The joint kind this detail builds: base-plate | shear-plate (a new engine kind needs no schema change here). A base-plate resolves only at a column base and a shear-plate only at a beam end; the mismatch is refused." },
275
+ "params": { "type": "object", "additionalProperties": true, "description": "The typical detail's geometry settings (mm), same vocabulary as `joint.params`. Sparse — engine defaults fill the rest at expansion time, never here." },
276
+ "schedule": {
277
+ "type": "array",
278
+ "items": { "$ref": "#/$defs/connectionScheduleRow" },
279
+ "description": "Per-size variation, merged OVER `params`. SPECIFICITY-ranked, not author-ordered, so a catch-all written first cannot kill the rows after it. If a schedule is present and a member's size matches no row, that end is REFUSED rather than quietly given the typical's numbers — the schedule exists because the numbers vary."
280
+ }
281
+ }
282
+ },
283
+ "connectionScheduleRow": {
284
+ "type": "object",
285
+ "additionalProperties": true,
286
+ "description": "One schedule line: which members it covers, and what it changes for them.",
287
+ "properties": {
288
+ "match": {
289
+ "type": "object",
290
+ "additionalProperties": true,
291
+ "description": "Matchers, ANDed. An EMPTY object is the catch-all. Ranked most-specific-first: profile → profilePrefix → depth → role → catch-all; a row carrying several ranks by its most specific one, and a tie inside a rank breaks on document order.",
292
+ "properties": {
293
+ "profile": { "type": "string", "description": "Exact designation, compared canonically (case / x-vs-× / spacing insensitive)." },
294
+ "profilePrefix": { "type": "string", "description": "Designation prefix, e.g. \"W18\" — plain string matching, so it works on any naming system (metric, European, bespoke), tabulated or not." },
295
+ "depth": {
296
+ "type": "object", "required": ["unit"], "additionalProperties": true,
297
+ "description": "Actual section depth range, inclusive. A designation with no tabulated depth FAILS this matcher rather than being assigned one — use profilePrefix for those.",
298
+ "properties": {
299
+ "min": { "type": "number" }, "max": { "type": "number" },
300
+ "unit": { "enum": ["in", "mm"], "description": "REQUIRED — a bare number is not a measurement." }
301
+ }
302
+ },
303
+ "role": { "enum": ["beam", "column"], "description": "Member role." }
304
+ }
305
+ },
306
+ "params": { "type": "object", "additionalProperties": true, "description": "Overrides for the members this row covers — only the keys it names; everything else falls through to the typical." }
257
307
  }
258
308
  },
259
309
  "joint": {
package/dist/web/app.css CHANGED
@@ -3540,7 +3540,11 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3540
3540
  #ws-proj-trigger { display:inline-flex; align-items:center; gap:8px; }
3541
3541
 
3542
3542
  /* landing */
3543
- .ws-landing { flex:1; min-height:0; overflow-y:auto; padding:6px 20px 24px; }
3543
+ /* scrollbar-* as well as the global ::-webkit-scrollbar rule: this is a scroll container, and the
3544
+ webkit rule alone leaves Firefox drawing its native light bar straight through the dark theme.
3545
+ Same pair every other scroll surface here already sets (.ws-archived-list, .ws-history). */
3546
+ .ws-landing { flex:1; min-height:0; overflow-y:auto; padding:6px 20px 24px;
3547
+ scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
3544
3548
  .ws-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
3545
3549
  .ws-head-text { min-width:0; }
3546
3550
  .ws-head h2 { font-size:17px; font-weight:650; letter-spacing:.01em; }
@@ -3565,6 +3569,51 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3565
3569
  .ws-card .ws-name { display:block; font-size:13px; font-weight:600; color:var(--text); }
3566
3570
  .ws-card .ws-meta { display:block; font-size:11px; color:var(--text-muted); margin-top:4px; }
3567
3571
  .ws-card .ws-meta .t { font-family:var(--mono); font-size:10px; color:var(--text-dim); }
3572
+ /* The "type · workflow · time" line.
3573
+ *
3574
+ * The LIVE workflow slug appears here only when the workflow was renamed or duplicated away from its
3575
+ * built-in id (see wsRenamed in workspaces.js). Mono + dim is the same recipe as .t beside it and as
3576
+ * .rtn-wf / .wf-option-meta elsewhere — this app's "technical identifier, not prose" treatment, so it
3577
+ * doesn't read as another capability line. NOT a bordered chip: .ws-kind above already is one.
3578
+ *
3579
+ * The line must NEVER wrap, because CSS Grid stretches every card in a row to the tallest — one long
3580
+ * name would push its whole ROW taller. Two attempts at a width cap on the slug were each disproved by
3581
+ * a case slightly wider than the one they were tuned on (18ch, measured on a 278px card, wrapped at the
3582
+ * 254px one and grew the card 175px → 192px; then 30%, checked against "2 h ago", clipped the wider
3583
+ * "59 min ago"). The room left over depends on the card width AND the display name AND the time string,
3584
+ * so no constant is right.
3585
+ *
3586
+ * `.ws-body > span` needs `min-width:0` first: it is a flex child, so it defaulted to min-width:auto and
3587
+ * simply GREW to fit the nowrap line (a 238px box holding 392px of content). The card clipped that, so
3588
+ * it looked correct while the timestamp had been pushed out of sight.
3589
+ *
3590
+ * Then the rule is stated as PRIORITY rather than as a width. Only the separators and the timestamp are
3591
+ * truly fixed — losing "59 min ago" is the one outcome with no recovery. Everything else may be
3592
+ * ellipsised, in a deliberate order: the slug shrinks first (shrink factor 4) because it is the only
3593
+ * part with a tooltip carrying its full value, and the type label only after that (factor 1) — it is
3594
+ * normally a short constant like "Steel model", but falls back to a raw 40-character app id for a
3595
+ * project whose app has no descriptor, which is exactly the case that must not shove the clock off the
3596
+ * card. */
3597
+ .ws-card .ws-body > span { min-width:0; } /* the text column must be allowed to SHRINK, see above */
3598
+ .ws-card .ws-meta-app { display:flex; align-items:baseline; white-space:nowrap; min-width:0; overflow:hidden; }
3599
+ .ws-card .ws-meta-app > .ws-sep,
3600
+ .ws-card .ws-meta-app > .t { flex:none; } /* never abbreviated */
3601
+ .ws-card .ws-meta-app > .ws-sep { white-space:pre; } /* keep the spaces around · at an item boundary */
3602
+ .ws-card .ws-meta-app > .ws-meta-kind {
3603
+ flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
3604
+ }
3605
+ .ws-card .ws-meta .ws-meta-wf {
3606
+ flex:0 4 auto; /* gives way before the type label does */
3607
+ /* ...but not to NOTHING. `min-width:0` let it collapse to zero width in the extreme case, which
3608
+ quietly broke the very thing that justifies abbreviating this part first: with no box left there
3609
+ is nothing to hover, so the data-tip carrying the full value became unreachable exactly when the
3610
+ user most needed it. The floor is a hit-target minimum — enough to show the ellipsis and be
3611
+ hoverable — not a layout budget, which is why a constant is the right tool here where it was the
3612
+ wrong one for the line. `.ws-meta-kind` absorbs what this no longer gives up. */
3613
+ min-width:4ch;
3614
+ overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
3615
+ font-family:var(--mono); font-size:10px; color:var(--text-dim);
3616
+ }
3568
3617
  .ws-card .ws-kebab { background:transparent; border:1px solid transparent; color:var(--text-dim);
3569
3618
  padding:2px 7px; border-radius:4px; font-size:14px; line-height:1; flex:none; }
3570
3619
  .ws-card .ws-kebab:hover { border-color:var(--border-strong); color:var(--text); }
@@ -3611,6 +3660,13 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3611
3660
  .ws-seed .ws-seed-headline { font-size:12.5px; font-weight:600; color:var(--text); line-height:1.35; }
3612
3661
  .ws-seed .ws-seed-sub { font-size:11px; color:var(--text-dim); line-height:1.4; max-width:220px; }
3613
3662
  .ws-seed .ws-seed-capability { font-size:11px; font-weight:600; color:var(--text-muted); line-height:1.35; max-width:220px; }
3663
+ /* Which live workflow this card creates on — rendered ONLY when more than one installed app shares
3664
+ the descriptor's lineage root (an original plus a duplicate), so the ordinary card is unchanged.
3665
+ Same mono + dim identifier treatment as .ws-meta-wf, capped and ellipsised for the same reason. */
3666
+ .ws-seed .ws-seed-target {
3667
+ max-width:22ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
3668
+ font-family:var(--mono); font-size:10px; color:var(--text-dim);
3669
+ }
3614
3670
  .ws-empty-note { color:var(--text-dim); font-size:12px; margin-top:10px; }
3615
3671
  /* A FAILED load, not an empty workspace. Same inline-banner recipe as .hist-empty / .hd-warn below
3616
3672
  (surface-2 + a left rail) so it reads as a sibling of the app's other status banners, railed in
package/dist/web/aware.js CHANGED
@@ -2070,8 +2070,21 @@
2070
2070
  const isVisual = (inp) => inp.widget === 'file' || inp.type === 'image' || inp.type === 'file';
2071
2071
  const isProject = (inp) => inp.widget === 'workspace-project';
2072
2072
  const visualNames = new Set(app.inputs.filter(isVisual).map((i) => i.name));
2073
- // A project-picker input needs the live list of approved projects — fetch once per open.
2074
- const approved = app.inputs.some(isProject) ? await fetchApprovedProjects() : [];
2073
+ // A project-picker input needs the live list of approved projects. Fetch ONE list per DISTINCT
2074
+ // `workspaceApp` filter and let the SERVER decide what matches, rather than fetching everything
2075
+ // and re-filtering here.
2076
+ //
2077
+ // That is a correctness requirement, not a tidy-up. Matching a `.flo`'s declared app to a project
2078
+ // means comparing their LINEAGE ROOTS (a rename moves a project off the built-in id the `.flo`
2079
+ // names). The server can resolve both sides; this side knows a project's root but never the
2080
+ // FILTER's, so any client-side comparison is necessarily narrower — and it would disagree with the
2081
+ // REST seam that the very same `.flo` reads at runtime, offering a project the workflow can't have
2082
+ // or hiding one it can. One authority, asked once per filter. Almost always exactly one fetch:
2083
+ // an app declares one project input.
2084
+ const projectFilters = [...new Set(app.inputs.filter(isProject)
2085
+ .map((i) => (typeof i.workspaceApp === 'string' && i.workspaceApp ? i.workspaceApp : '')))];
2086
+ const approvedByFilter = new Map();
2087
+ for (const f of projectFilters) approvedByFilter.set(f, await fetchApprovedProjects(f || undefined));
2075
2088
  const fields = app.inputs.map((inp) => {
2076
2089
  if (isVisual(inp)) return {
2077
2090
  name: inp.name,
@@ -2081,15 +2094,16 @@
2081
2094
  value: cur[inp.name] != null ? cur[inp.name] : '',
2082
2095
  };
2083
2096
  if (isProject(inp)) {
2084
- const wantApp = typeof inp.workspaceApp === 'string' ? inp.workspaceApp : null;
2085
- const options = approved
2086
- .filter((p) => !wantApp || p.app === wantApp)
2097
+ // Already filtered, by the server, for THIS input's `workspaceApp` — see above.
2098
+ const options = (approvedByFilter.get(typeof inp.workspaceApp === 'string' && inp.workspaceApp ? inp.workspaceApp : '') || [])
2087
2099
  .slice().sort((a, b) => String(a.name).localeCompare(String(b.name)))
2088
2100
  .map((p) => ({
2089
2101
  value: p.id,
2102
+ // Name the KIND from the lineage root — after a rename `p.app` is a slug that says
2103
+ // nothing about what the project IS. The live id stays searchable below.
2104
+ meta: `${appLabel(p.templateId || p.app)} · v${p.latestApprovedVersion}`,
2090
2105
  label: p.name,
2091
- meta: `${appLabel(p.app)} · v${p.latestApprovedVersion}`,
2092
- search: `${p.name} ${p.app} ${appLabel(p.app)}`,
2106
+ search: `${p.name} ${p.app} ${appLabel(p.templateId || p.app)}`,
2093
2107
  }));
2094
2108
  return {
2095
2109
  name: inp.name,
@@ -5663,7 +5677,11 @@
5663
5677
  // App-aware: the target contract shape differs per workspace app. A vectorize project holds a
5664
5678
  // drawing.vector/v1 (clean editable 2D linework), NOT a steel takeoff — instructing the AI to
5665
5679
  // read steel members would produce the wrong contract for the vector editor (spec §3.3g).
5666
- if (req.appId === 'vectorize') {
5680
+ // The lineage ROOT, not the live id: these branches encode what CONTRACT SHAPE the app's
5681
+ // document has, and a rename moves the id off the built-in they are written against. Sending a
5682
+ // renamed vector project down the steel branch asks the AI for a steel.takeoff/v1 — the wrong
5683
+ // document entirely. Falls back to appId for an older server that ships no templateId.
5684
+ if ((req.appTemplateId || req.appId) === 'vectorize') {
5667
5685
  if (isInitialRead) {
5668
5686
  return `In floless project "${req.project}" (app "${req.appId}"), an initial drawing was attached — trace it into this project as its first version (do NOT create a new project). Vectorize the drawing per the floless-app-vectorize skill into a drawing.vector/v1 contract: emit clean, editable 2D vector geometry (sheets → elements: lines / polylines / curves / text, each on its layer), NOT steel members or a takeoff. A vector PDF is read deterministically (exact geometry, no guessing); a photo, scan or hand sketch is traced by a fenced vision extraction that flags every uncertain stroke (low confidence) for the user's review. ${post}${snaps}${note}`;
5669
5687
  }
@@ -5725,14 +5743,14 @@
5725
5743
  // revision-read's skill is app-specific: steel takeoff by default, floless-app-vectorize for a
5726
5744
  // vector project — keep the clipboard marker in step with the app-aware instruction body above.
5727
5745
  let skill = REQUEST_SKILL[req.type] || 'floless-app-workflows';
5728
- if (req.type === 'revision-read' && req.appId === 'vectorize') skill = 'floless-app-vectorize';
5746
+ if (req.type === 'revision-read' && (req.appTemplateId || req.appId) === 'vectorize') skill = 'floless-app-vectorize';
5729
5747
  const base = (typeof location !== 'undefined' && location.origin) ? location.origin : 'http://127.0.0.1:4317';
5730
5748
  // A revision-read is cleared by its own /revision-read POST — a separate DELETE would 404. A
5731
5749
  // knowledge-organize is likewise lifecycle-owned: its finish/fail POST clears it, and a stray
5732
5750
  // DELETE would strand the organize lock until the stale timeout. Every other type is
5733
5751
  // applied-then-DELETEd by the terminal AI.
5734
5752
  const clears = req.type === 'revision-read'
5735
- ? (req.appId === 'steel-model'
5753
+ ? ((req.appTemplateId || req.appId) === 'steel-model'
5736
5754
  ? `apply it in two phases: first write the Steel Filter checkpoint to the project contract and stop for user Save; only after that checkpoint use the route in the line below (that POST clears this request — do NOT DELETE it separately).`
5737
5755
  : `apply it via the route in the line below (that POST clears this request — do NOT DELETE it separately).`)
5738
5756
  : req.type === 'knowledge-organize'