@floless/app 0.104.2 → 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.
@@ -48,7 +48,7 @@
48
48
  "joints": { "type": "array", "items": { "$ref": "#/$defs/joint" }, "description": "Placed connections (base plates, …) the connection engine expands into real 3D parts (plate/bolt/weld/cut) bound to their members. A joint may cite a `connections[]` row via `conn` for its type/detail identity; `params` carries the geometry settings (engine defaults when absent)." },
49
49
  "dims3d": { "type": "array", "items": { "$ref": "#/$defs/dim3" }, "description": "Draft-only 3D dimensions (editor annotations, model-global). World-scene mm. NOT baked into the lock / 3D scene / IFC / BOM." },
50
50
  "detail_placements": { "type": "array", "items": { "$ref": "#/$defs/detailPlacement" }, "description": "Draft-only placed 2D detail images (Slice 4 — insert a vectored detail into the model). Flat image planes the editor renders client-side against the model; metadata only — the image bytes live in custom_details. Model-global. NOT baked into the lock / 3D scene / IFC / BOM." },
51
- "views": { "type": "array", "description": "Draft-only saved views (Views Organizer, unlimited saved entries): each a named snapshot of the 3D viewpoint (camera + projection + display mode + clip boxes/planes + work area + the objects-list pane's persistent visibility/isolate state). F11-generated grid elevations and level plans also carry closed `generated` provenance so their cut depths remain editable. Editor state, model-global. NOT baked into the lock / 3D scene / IFC / BOM.", "items": { "type": "object", "additionalProperties": true, "required": ["id", "name"], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "order": { "type": "number" }, "camera": { "type": "object", "additionalProperties": true }, "projection": { "enum": ["persp", "ortho"] }, "mode": { "enum": ["solid", "wire", "xray"] }, "clips": { "type": "object", "additionalProperties": true }, "objects": { "type": "object", "additionalProperties": true }, "generated": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["v", "kind", "sheet", "label", "at", "look", "ahead", "behind"], "properties": { "v": { "const": 1 }, "kind": { "enum": ["grid-x", "grid-y"] }, "sheet": { "type": "string" }, "label": { "type": "string" }, "at": { "type": "number" }, "look": { "enum": ["positive", "negative"] }, "ahead": { "type": "number", "exclusiveMinimum": 0 }, "behind": { "type": "number", "exclusiveMinimum": 0 } } }, { "type": "object", "additionalProperties": false, "required": ["v", "kind", "sheet", "label", "at", "look", "above", "below"], "properties": { "v": { "const": 1 }, "kind": { "const": "level" }, "sheet": { "type": "string" }, "label": { "type": "string" }, "at": { "type": "number" }, "look": { "const": "down" }, "above": { "type": "number", "exclusiveMinimum": 0 }, "below": { "type": "number", "exclusiveMinimum": 0 } } }] } } } },
51
+ "views": { "type": "array", "description": "Draft-only saved views (Views Organizer, unlimited saved entries): each a named snapshot of the 3D viewpoint (camera + projection + display mode + clip boxes/planes + work area + the objects-list pane's persistent visibility/isolate state). F11-generated grid elevations and level plans also carry closed `generated` provenance so their cut depths remain editable. Editor state, model-global. NOT baked into the lock / 3D scene / IFC / BOM.", "items": { "type": "object", "additionalProperties": true, "required": ["id", "name"], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "order": { "type": "number" }, "camera": { "type": "object", "additionalProperties": true }, "projection": { "enum": ["persp", "ortho"] }, "mode": { "enum": ["solid", "wire", "xray", "realistic", "shadowed"] }, "clips": { "type": "object", "additionalProperties": true }, "objects": { "type": "object", "additionalProperties": true }, "generated": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["v", "kind", "sheet", "label", "at", "look", "ahead", "behind"], "properties": { "v": { "const": 1 }, "kind": { "enum": ["grid-x", "grid-y"] }, "sheet": { "type": "string" }, "label": { "type": "string" }, "at": { "type": "number" }, "look": { "enum": ["positive", "negative"] }, "ahead": { "type": "number", "exclusiveMinimum": 0 }, "behind": { "type": "number", "exclusiveMinimum": 0 } } }, { "type": "object", "additionalProperties": false, "required": ["v", "kind", "sheet", "label", "at", "look", "above", "below"], "properties": { "v": { "const": 1 }, "kind": { "const": "level" }, "sheet": { "type": "string" }, "label": { "type": "string" }, "at": { "type": "number" }, "look": { "const": "down" }, "above": { "type": "number", "exclusiveMinimum": 0 }, "below": { "type": "number", "exclusiveMinimum": 0 } } }] } } } },
52
52
  "prop_labels": {
53
53
  "type": "object",
54
54
  "additionalProperties": true,
@@ -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": {
@@ -2,7 +2,7 @@
2
2
  name: floless-app-steel-takeoff
3
3
  description: Read a structural steel drawing into an editable steel.takeoff/v1 contract in floless.app — the "Steel Takeoff" reader. Triggers on a pending floless `rebake` request for the `steel-model` app (queued from its "Re-read & re-bake ▸" button), or asks like "read this framing plan into a takeoff", "turn this structural drawing into a takeoff", "bake my drawing into steel-model", "extract members from this PDF". Teaches the host AI to READ a steel drawing (PDF/image) with its own vision at COMPOSE time, build a steel.takeoff/v1 contract (members + profiles + elevations + weights from AISC lookup), write it to the contract store, and hand control to the editor — no model in the run path, no API key.
4
4
  metadata:
5
- version: 0.9.1
5
+ version: 0.10.0
6
6
  ---
7
7
 
8
8
  # Steel Takeoff — read a drawing into a steel.takeoff/v1 contract
@@ -246,7 +246,9 @@ native/display coords):
246
246
  `*BEAM*STEL*`, `*COL*`, `*BRACE*`, `*JOIST*`) → default **on**; others off. Mark
247
247
  `drawable: false` on pure text/dimension/title-block layers.
248
248
  5. Set `filter.mode: "layer"`, `filter.active: 0`. **PUT** the contract
249
- (`PUT /api/contract/steel-model`). On a re-read, preserve any existing per-facet `on` flags.
249
+ (`PUT /api/contract/steel-model`) **with a precondition header** — `If-Match: <the ETag from your
250
+ GET>`, or `If-None-Match: *` if the GET returned no ETag (§5 has the full rule). A PUT carrying
251
+ neither is refused with `428`. On a re-read, preserve any existing per-facet `on` flags.
250
252
 
251
253
  ### 1c. Grid lines — read the printed grid (quick, per sheet)
252
254
 
@@ -273,6 +275,91 @@ text layer. You CAN read them: you already have vision on the sheet. So:
273
275
 
274
276
  Skip silently only when the sheet genuinely has no grid bubbles (rare for framing plans); say so.
275
277
 
278
+ ### 1d. Model datum — ASK which grid intersection is global 0,0,0
279
+
280
+ Every sheet is traced in its **own** display space, and nothing ties two sheets to a common frame. The
281
+ same physical grid read from three sheets therefore lands in three different places — measured on a real
282
+ project: **443 mm apart**. That silently mis-registers every member read from those sheets — columns that
283
+ stack in the building end up half a metre apart in the model, and one grid exports as three objects.
284
+
285
+ One authored fact fixes it: a **datum** — the grid intersection that is global 0,0,0 — located on every
286
+ sheet.
287
+
288
+ **ASK the user which intersection is the datum. Never choose it.** Where the model origin sits is a
289
+ project decision (it often matches the surveyor's or erector's control point), not a drafting detail.
290
+ Ask in plain English, naming the likeliest candidate without deciding for them:
291
+
292
+ > "Which grid intersection should be the model origin (0,0)? Most sets use the lowest-left crossing —
293
+ > here that looks like A/1. Tell me a different intersection if this project uses another datum."
294
+
295
+ Record the answer model-level, naming each axis **by its direction, never by whether the label looks like
296
+ a letter or a number**:
297
+
298
+ ```json
299
+ "datum": { "axis_x": "A", "axis_y": "1" }
300
+ ```
301
+
302
+ `axis_x` is the label of the grid line running in the **X** direction (the `labels_x` list from 1c);
303
+ `axis_y` is the label of the **Y**-direction line (`labels_y`). **Do not infer this from the label's
304
+ appearance.** The editor's default is X = `1 2 3…` and Y = `A B C…`, but real sets frequently invert it —
305
+ this project's own demo labels X as `K J H … A` and Y as `1.1 2 3 … 6`. A user who says "A/1" has not
306
+ told you which axis is which; resolve it against the actual `labels_x` / `labels_y` read in 1c, and
307
+ confirm back which line is which if the set is inverted.
308
+
309
+ **Then locate that intersection on every sheet**, recording it in that sheet's display space as
310
+ `plan.datum_at = [x, y]` — the crossing point of those two grid lines. Each sheet then shifts so its
311
+ `datum_at` lands on the model origin, instead of the model inferring an offset by comparing grid shapes.
312
+
313
+ A sheet that does not print the model-origin intersection (enlarged or partial plans often omit it) may
314
+ instead record **any** labelled intersection it does print, together with which one it is — its global
315
+ position is already known from the grid, so registration still resolves:
316
+
317
+ ```json
318
+ "datum_at": [x, y], "datum_ref": { "axis_x": "F", "axis_y": "4" }
319
+ ```
320
+
321
+ Omit `datum_ref` when the sheet uses the model origin itself.
322
+
323
+ **Record a SECOND control intersection on every sheet.** One point fixes only where the sheet sits; it
324
+ cannot tell whether the sheet is rotated, mirrored, or drawn at a slightly different scale, because a
325
+ single point has no orientation. Two points do: the vector between them carries the sheet's rotation,
326
+ its handedness, and its true scale, all checkable against the same two labelled lines on other sheets.
327
+
328
+ Same flat shape as the datum above — a point plus which intersection it is:
329
+
330
+ ```json
331
+ "control2_at": [x, y], "control2_ref": { "axis_x": "F", "axis_y": "4" }
332
+ ```
333
+
334
+ - `control2_ref` is **always** required alongside `control2_at`. Unlike `datum_ref` it is never omitted:
335
+ a second control is never the model origin, so its labels always have to be stated.
336
+ - Pick the intersection **furthest from the datum** that the sheet actually prints — the longer the
337
+ baseline, the smaller the angular error. Diagonally opposite is ideal.
338
+ - Same reading rules as the datum: take the labels from `labels_x` / `labels_y`, never guess from
339
+ appearance, never invent an intersection the sheet does not print.
340
+ - **When the sheet prints only one labelled intersection**, omit both fields and say so. That sheet can
341
+ be positioned but not orientation-checked, and a later step may have to ask for another control.
342
+ - Do NOT ask the user for this one — unlike the datum, it is not a project decision. It is a second
343
+ reading of something already printed, so read it.
344
+
345
+ - **Any intersection is a valid datum** — verified: the choice moves registration by under 1 mm. What
346
+ matters is that **every sheet uses the same one**, not which one gets picked.
347
+ - Never guess a datum. When a sheet prints no labelled intersection at all, leave `datum_at` unset and
348
+ say which sheets are unregistered — do NOT substitute an unlabelled crossing.
349
+ - **Say so when a sheet is rotated or mirrored** relative to the others (a plan drawn at a skew, or a
350
+ reversed-hand view). A datum point fixes translation only; it cannot correct orientation, and
351
+ registering such a sheet as if it were square would silently distort every member read from it.
352
+ - **Record the elevation the sheet CUTS as `plan.elevation_in`** (decimal inches, same convention as
353
+ `default_tos`) — read it off the drawing's level/TOS callouts. Datum + elevation together place the
354
+ sheet as a horizontal cut plane in 3D: datum fixes it in plan, elevation fixes it in height.
355
+ - **`default_tos` is NOT the sheet's cut elevation** — it is the fallback top-of-steel applied to members
356
+ whose ends are blank. The two often carry the same number on a framing plan, which makes conflating
357
+ them easy and wrong: a plan can default its blank ends to one level while cutting at another. Author
358
+ both, independently.
359
+ - **Read the elevation off the drawing; always ASK for the datum.** The elevation is printed and can be
360
+ re-read later; which intersection the project calls 0,0 is the user's intent and cannot be recovered
361
+ after the fact.
362
+
276
363
  **Then STOP and hand off — checkpoint before the member read.** Tell the user to open the **Filter**
277
364
  node, flip through the sheets, narrow to the steel, and **Save**. The saved `on` flags + `mode` are
278
365
  what step 2 reads — **per sheet** (each sheet's elements passing `mode` + the global `on` flags). Only
@@ -813,16 +900,33 @@ Key field rules:
813
900
 
814
901
  ### 5. Write to the contract store
815
902
 
903
+ **Read first, then write.** `GET` the contract before you PUT and keep its `ETag` response header —
904
+ that tag is what makes the write safe, and you need it even when you are replacing the document
905
+ wholesale.
906
+
907
+ **A contract write MUST carry a precondition** — the server refuses one that does not (`428`). Which
908
+ header depends on what that `GET` returned:
909
+
816
910
  ```
817
911
  PUT http://localhost:<port>/api/contract/steel-model
818
912
  Content-Type: application/json
913
+ If-Match: <the ETag from your GET> # replacing — the usual case
914
+ If-None-Match: * # ONLY if the GET returned no ETag at all (no draft yet)
819
915
 
820
916
  <contract JSON body>
821
917
  ```
822
918
 
823
- The server schema-validates the body. If it responds with `400`, read the error, fix the
824
- offending fields, and re-PUT. You can read back the current contract with
825
- `GET /api/contract/steel-model`.
919
+ The server schema-validates the body. Responses that need action:
920
+
921
+ - **`400`** — schema-invalid. Read the error, fix the offending fields, and re-PUT.
922
+ - **`412`** — someone else (the user in the editor, another tool, a workflow run) wrote to this
923
+ contract after you read it. **Do NOT retry the same body** — that would destroy their change.
924
+ Re-`GET`, re-apply your edit to the NEW document, and write again with the fresh ETag.
925
+ - **`428`** — you sent no precondition. Add `If-Match` (or `If-None-Match: *` if the GET gave you no
926
+ ETag) and retry.
927
+
928
+ Sending a precondition is not optional politeness: without it a slow edit silently overwrites whatever
929
+ landed while you were working. Read back the current contract with `GET /api/contract/steel-model`.
826
930
 
827
931
  ### 6. Hand off to the user
828
932
 
@@ -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.1.0
5
+ version: 0.2.0
6
6
  ---
7
7
 
8
8
  # Handle a `tweak-contract` request (Slice 2 AI round-trip)
@@ -41,8 +41,11 @@ means invalid — fix and retry.
41
41
  dev server).
42
42
 
43
43
  2. **Read the current contract.** `GET http://localhost:<port>/api/contract/<appId>` returns
44
- the full `steel.takeoff/v1` JSON document. You can also read it directly from
45
- `~/.floless/contracts/<appId>.json`.
44
+ the full `steel.takeoff/v1` JSON document. **Keep the `ETag` response header** — step 5 sends it
45
+ back so your write cannot silently overwrite someone else's.
46
+ You can also read it directly from `~/.floless/contracts/<appId>.json`, but then you have no
47
+ ETag and **the write in step 5 will be REFUSED (`428`)** — the server requires a precondition.
48
+ Use the HTTP read whenever you intend to write.
46
49
 
47
50
  The schema is at `schemas/steel.takeoff.v1.schema.json` (in the floless.app repo) and the
48
51
  field reference is `docs/superpowers/specs/2026-06-17-steel-takeoff-agent-guidance.md` §3.
@@ -78,10 +81,23 @@ means invalid — fix and retry.
78
81
  objects are not supported.
79
82
 
80
83
  5. **Write it back.** `PUT http://localhost:<port>/api/contract/<appId>` with the full updated
81
- document (Content-Type: application/json). A **400** response means schema-invalid — read
82
- the error, fix the structure against `schemas/steel.takeoff.v1.schema.json`, and retry.
83
- On success the server broadcasts a `contract-changed` event; the editor picks it up and
84
- prompts to reload.
84
+ document (Content-Type: application/json) **and a precondition header**:
85
+ - **`If-Match: <the ETag from step 2>`** — the usual case, replacing a contract you read.
86
+ - **`If-None-Match: *`** — ONLY when the GET returned **no** ETag at all. That happens on an app
87
+ whose contract is still the baked example with no saved draft yet; it means "I believe this
88
+ store is empty" and is refused if a draft appeared meanwhile.
89
+
90
+ A PUT carrying neither is refused with **`428`** — the server never accepts a blind write.
91
+ - **400** — schema-invalid. Read the error, fix the structure against
92
+ `schemas/steel.takeoff.v1.schema.json`, and retry.
93
+ - **412** — someone else (the user in the editor, another tool, a workflow run) wrote to this
94
+ contract after you read it. **Do NOT retry the same body**: that would destroy their change.
95
+ Re-read from step 2, re-apply your edit to the NEW document, and write again.
96
+ - **428** — you sent no precondition (or an `If-None-Match` other than `*`, which this server does
97
+ not evaluate). Add `If-Match` — or `If-None-Match: *` if the GET gave you no ETag — and retry.
98
+ Sending a precondition is not optional politeness — without it a slow edit would silently overwrite
99
+ whatever landed while you were working, which is why the server now refuses it outright. On success the server broadcasts a `contract-changed`
100
+ event; the editor picks it up and prompts to reload.
85
101
 
86
102
  6. **Tell the user.** Summarize what you changed (e.g. "Updated W12X26 → W14X30 on 4 beams
87
103
  in sheet S-202; updated `weights` entry to 30 plf"). Tell them to click **↻ Reload** in the
@@ -2,7 +2,7 @@
2
2
  name: floless-app-vectorize
3
3
  description: Vectorize a drawing into an editable drawing.vector/v1 contract in floless.app — the "Vectorize" reader. Triggers on a pending floless `rebake` request for the `vectorize` app (queued from its "Re-read & re-bake ▸" button), or asks like "vectorize this PDF", "turn my sketch into clean CAD linework", "read this detail into vectors", "trace this photo", "make this drawing 3D". Teaches the host AI to read a drawing at COMPOSE time — a vector PDF via ONE deterministic PyMuPDF pass (no LLM), a scan/photo/hand sketch via AWARE's fenced vision.extract (schema-bound, cached) — emit the drawing.vector/v1 contract, PUT it to the contract store, and hand the 2D vector editor to the user; and, for a multi-view set (plan + elevation), to classify views, read datums, and declare entities so the server reconstructs a viewable 3D model.
4
4
  metadata:
5
- version: 0.4.0
5
+ version: 0.5.0
6
6
  ---
7
7
 
8
8
  # Vectorize — read a drawing into a drawing.vector/v1 contract
@@ -171,17 +171,33 @@ deterministic and **refuses to guess** — anything you leave unresolved lands i
171
171
 
172
172
  ### 4. Write to the contract store
173
173
 
174
+ **Read first, then write.** `GET` the contract before you PUT and keep its `ETag` response header —
175
+ that tag is what makes the write safe, and you need it even when you are replacing the document
176
+ wholesale.
177
+
178
+ **A contract write MUST carry a precondition** — the server refuses one that does not (`428`). Which
179
+ header depends on what that `GET` returned:
180
+
174
181
  ```
175
182
  PUT http://localhost:<port>/api/contract/vectorize
176
183
  Content-Type: application/json
184
+ If-Match: <the ETag from your GET> # replacing — the usual case
185
+ If-None-Match: * # ONLY if the GET returned no ETag at all (no draft yet)
177
186
 
178
187
  <contract JSON body>
179
188
  ```
180
189
 
181
- The server schema-validates the body; on `400` read the error, fix the offending fields, and
182
- re-PUT. The stored draft **wins over the baked example immediately** — no compile needed for
183
- the editor to show it. Read back with `GET /api/contract/vectorize` (served through the pure
184
- post-processor, so ids/layers come back cleaned).
190
+ The server schema-validates the body. Responses that need action:
191
+
192
+ - **`400`** — schema-invalid. Read the error, fix the offending fields, and re-PUT.
193
+ - **`412`** — someone else wrote to this contract after you read it. **Do NOT retry the same body**;
194
+ re-`GET`, re-apply your edit to the NEW document, and write again with the fresh ETag.
195
+ - **`428`** — you sent no precondition. Add `If-Match` (or `If-None-Match: *` if the GET gave you no
196
+ ETag) and retry.
197
+
198
+ The stored draft **wins over the baked example immediately** — no compile needed for the editor to
199
+ show it. Read back with `GET /api/contract/vectorize` (served through the pure post-processor, so
200
+ ids/layers come back cleaned).
185
201
 
186
202
  ### 5. Hand off to the user
187
203
 
@@ -1,5 +1,5 @@
1
1
  app: steel-model
2
- version: 0.3.0
2
+ version: 0.4.0
3
3
  display-name: Steel Model
4
4
  publisher: floless
5
5
  module: steel-detailer
@@ -20,6 +20,10 @@ exposes-as-agent: false
20
20
  # Workflow changelog (FloLess-published). Newest first; the app shows entries newer than the
21
21
  # installed version when offering an update. Plain-English — it surfaces to the user.
22
22
  changelog:
23
+ - version: 0.4.0
24
+ summary: Housekeeping — no change to how Steel Model works
25
+ changes:
26
+ - "Changed: nothing you will notice. Steel Model already opened as a Workspaces project and still does; this is internal tidying so it keeps showing up correctly there as more workflows gain the same ability."
23
27
  - version: 0.3.0
24
28
  summary: Export your bill of materials as CSV and Excel on Run
25
29
  changes:
@@ -1,5 +1,5 @@
1
1
  app: vectorize
2
- version: 0.2.0
2
+ version: 0.3.0
3
3
  display-name: Vectorize
4
4
  publisher: floless
5
5
  # FloLess-namespaced flag (AWARE ignores it — the .flo is FloLess's authoring format, not AWARE's).
@@ -21,6 +21,10 @@ exposes-as-agent: false
21
21
  # Workflow changelog (FloLess-published). Newest first; the app shows entries newer than the installed
22
22
  # version when offering an update. Plain-English — it surfaces to the user.
23
23
  changelog:
24
+ - version: 0.3.0
25
+ summary: Vectorize now opens as a Workspaces project
26
+ changes:
27
+ - "Added: this workflow now also appears in Workspaces, where it is called \"Trace a drawing\" — start a project from a drawing, then work through Source, Traced, Exports and History, with Approve as the sign-off. It still works exactly as before in Workflows; Workspaces is just a second way to open it."
24
28
  - version: 0.2.0
25
29
  summary: Photos, scans and hand sketches can now be vectorized too — unsure strokes are flagged for your review
26
30
  - version: 0.1.0
package/dist/web/app.css CHANGED
@@ -1872,6 +1872,44 @@
1872
1872
  #wf-update-sub { color: var(--text-muted); }
1873
1873
  .wf-update-note { font-size: 11px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.5; padding-top: 12px; border-top: 1px solid var(--border); }
1874
1874
 
1875
+ /* Import-failed modal (#314). The remedy command is selectable on its own (user-select:all, the
1876
+ .dc-code idiom) AND has a copy button, so either habit works. The raw-stderr disclosure reuses
1877
+ .fm-note verbatim for its themed scrollbar rather than restating that recipe a fourth time, and
1878
+ mirrors .ws-archived's native <details>/<summary> caret-rotate idiom. Existing tokens only. */
1879
+ /* The rows list is the one variable-length region here (one command per unavailable agent), and
1880
+ .modal caps nothing by default — modals that can grow opt in individually (#form-modal, .library,
1881
+ .routines). Without this a multi-agent refusal pushes Close below the fold on a short viewport
1882
+ with no way to reach it. The actions row stays OUTSIDE the scroller so Close is always visible,
1883
+ and the scroller is themed in the same pass (CLAUDE.md — a long modal list is a scroll container). */
1884
+ #import-failed-modal .modal { max-height: 86vh; display: flex; flex-direction: column; }
1885
+ #import-failed-remedy-rows { max-height: 40vh; overflow-y: auto;
1886
+ scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
1887
+ #import-failed-remedy-rows::-webkit-scrollbar { width: 7px; }
1888
+ #import-failed-remedy-rows::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
1889
+ #import-failed-remedy-rows::-webkit-scrollbar-track { background: transparent; }
1890
+
1891
+ .import-failed-remedy { margin: 2px 0 16px; }
1892
+ .import-failed-remedy-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: 6px; }
1893
+ .import-failed-cmd-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 8px 8px 12px; margin-bottom: 6px; }
1894
+ .import-failed-cmd-row:last-child { margin-bottom: 0; }
1895
+ .import-failed-cmd { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; color: var(--accent-bright); overflow-x: auto; white-space: pre; user-select: all;
1896
+ scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
1897
+ .import-failed-cmd::-webkit-scrollbar { height: 7px; }
1898
+ .import-failed-cmd::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
1899
+ .import-failed-cmd::-webkit-scrollbar-track { background: transparent; }
1900
+ .import-failed-copy { flex: none; display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); font-family: var(--ui); font-size: 11px; padding: 5px 10px; border-radius: 4px; cursor: pointer; }
1901
+ .import-failed-copy:hover { color: var(--text); border-color: var(--accent-dim); background: var(--surface); }
1902
+ .import-failed-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
1903
+
1904
+ .import-failed-detail { margin-top: 2px; }
1905
+ .import-failed-summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); padding: 5px 2px; user-select: none; }
1906
+ .import-failed-summary::-webkit-details-marker { display: none; }
1907
+ .import-failed-summary:hover { color: var(--text-muted); }
1908
+ .import-failed-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
1909
+ .import-failed-caret { display: inline-block; transition: transform 0.15s; }
1910
+ .import-failed-detail[open] > .import-failed-summary .import-failed-caret { transform: rotate(90deg); }
1911
+ #import-failed-raw { margin-top: 6px; max-height: 220px; }
1912
+
1875
1913
  /* Add/edit form */
1876
1914
  .modal.routine-edit { width: 540px; max-width: 92vw; max-height: 90vh; overflow-y: auto; }
1877
1915
  #rtn-workflow, .rtn-kind-select { min-width: 0; width: 100%; }
@@ -3133,9 +3171,10 @@ body {
3133
3171
  .relnotes-update:focus-visible,
3134
3172
  .relnotes-changelog:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
3135
3173
 
3136
- /* The AWARE version label becomes a notes affordance after an in-place upgrade. */
3137
- .aware-version.relnotes-reopen { cursor: pointer; }
3138
- .aware-version.relnotes-reopen:hover { color: var(--accent-bright); }
3174
+ /* Either footer version label becomes a notes affordance once its changelog resolves
3175
+ (or, for AWARE, right after an in-place upgrade). */
3176
+ .aware-version.relnotes-reopen, .app-version.relnotes-reopen { cursor: pointer; }
3177
+ .aware-version.relnotes-reopen:hover, .app-version.relnotes-reopen:hover { color: var(--accent-bright); }
3139
3178
 
3140
3179
  /* ── What's-new panel (floless.app post-update) ─────────────────────────────
3141
3180
  A 4th grid row above the footer — NOT absolutely positioned. .has-whats-new
@@ -3501,7 +3540,11 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3501
3540
  #ws-proj-trigger { display:inline-flex; align-items:center; gap:8px; }
3502
3541
 
3503
3542
  /* landing */
3504
- .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; }
3505
3548
  .ws-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
3506
3549
  .ws-head-text { min-width:0; }
3507
3550
  .ws-head h2 { font-size:17px; font-weight:650; letter-spacing:.01em; }
@@ -3526,6 +3569,51 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3526
3569
  .ws-card .ws-name { display:block; font-size:13px; font-weight:600; color:var(--text); }
3527
3570
  .ws-card .ws-meta { display:block; font-size:11px; color:var(--text-muted); margin-top:4px; }
3528
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
+ }
3529
3617
  .ws-card .ws-kebab { background:transparent; border:1px solid transparent; color:var(--text-dim);
3530
3618
  padding:2px 7px; border-radius:4px; font-size:14px; line-height:1; flex:none; }
3531
3619
  .ws-card .ws-kebab:hover { border-color:var(--border-strong); color:var(--text); }
@@ -3572,7 +3660,29 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3572
3660
  .ws-seed .ws-seed-headline { font-size:12.5px; font-weight:600; color:var(--text); line-height:1.35; }
3573
3661
  .ws-seed .ws-seed-sub { font-size:11px; color:var(--text-dim); line-height:1.4; max-width:220px; }
3574
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
+ }
3575
3670
  .ws-empty-note { color:var(--text-dim); font-size:12px; margin-top:10px; }
3671
+ /* A FAILED load, not an empty workspace. Same inline-banner recipe as .hist-empty / .hd-warn below
3672
+ (surface-2 + a left rail) so it reads as a sibling of the app's other status banners, railed in
3673
+ --warn: a list that wouldn't load is "needs attention", not the definite operation failure --err
3674
+ marks. Tokens, never hex literals — --warn is redefined per theme, so a literal would stay
3675
+ dark-amber in light mode while every sibling banner shifted. */
3676
+ .ws-empty-note.ws-load-error { margin:10px 0 0; padding:11px 14px; background:var(--surface-2);
3677
+ border:1px solid var(--border); border-left:3px solid var(--warn); border-radius:6px;
3678
+ font-size:12.5px; color:var(--text-muted); line-height:1.55; max-width:640px; }
3679
+ .ws-empty-note.ws-load-error b { color:var(--text); font-weight:600; }
3680
+ /* The raw server string, demoted out of the lead sentence (buildFailedCard's shape). */
3681
+ .ws-empty-note.ws-load-error .ws-load-error-detail { color:var(--text-dim); }
3682
+ /* Inline action, styled like .hist-empty's — the established look for one CTA inside a banner. */
3683
+ .ws-empty-note.ws-load-error button { background:none; border:none; padding:0; font:inherit;
3684
+ color:var(--accent); cursor:pointer; }
3685
+ .ws-empty-note.ws-load-error button:hover { color:var(--accent-bright); text-decoration:underline; }
3576
3686
 
3577
3687
  /* open project */
3578
3688
  .ws-project { flex:1; min-height:0; display:flex; flex-direction:column; }
@@ -3644,6 +3754,11 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
3644
3754
  .ecard .e-receipt-details:hover { color:var(--text); }
3645
3755
  .ecard .e-done .chk { color:var(--ok); } /* the ✓ */
3646
3756
  .ecard .e-done .t { color:var(--text-muted); font-family:var(--mono); } /* HH:MM — the scannable datum */
3757
+ /* A share link is far longer than the HH:MM this row was built for, so it has to be allowed to
3758
+ truncate rather than push the Copy button out of the card. The full URL is on the themed tooltip
3759
+ (data-tip, never a native title=). */
3760
+ .ecard .e-done { display:inline-flex; align-items:center; gap:.5ch; min-width:0; max-width:100%; }
3761
+ .ecard .e-sharelink { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
3647
3762
  .ecard .e-links { display:flex; align-items:center; gap:8px; flex:none; }
3648
3763
  .ecard .e-link { background:none; border:none; padding:0; font:inherit; font-size:11px; color:var(--text-muted); cursor:pointer; }
3649
3764
  .ecard .e-link:hover { color:var(--accent); }