@floless/app 0.114.0 → 0.116.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.
- package/dist/floless-server.cjs +5847 -5525
- package/dist/skills/floless-app-bridge/SKILL.md +1 -1
- package/dist/skills/floless-app-onboarding/SKILL.md +1 -1
- package/dist/skills/floless-app-queue/SKILL.md +1 -1
- package/dist/skills/floless-app-routines/SKILL.md +1 -1
- package/dist/skills/floless-app-steel-model/SKILL.md +1 -1
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +98 -17
- package/dist/skills/floless-app-ui/SKILL.md +1 -1
- package/dist/skills/floless-app-workflows/SKILL.md +1 -1
- package/dist/skills/reading-structural-drawings/SKILL.md +1 -1
- package/dist/skills/steel-drawing-abbreviations/SKILL.md +1 -1
- package/dist/web/app.css +52 -0
- package/dist/web/aware.js +194 -5
- package/dist/web/index.html +1 -1
- package/dist/web/workspaces.js +661 -27
- package/package.json +2 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: floless-app-bridge
|
|
3
3
|
description: This skill should be used when the user is driving the floless.app web UI (the local prompt-native front door at http://127.0.0.1:4317) and wants the terminal AI to act on what they did there — picking up queued Tweak requests, "use this template" requests, or the context of a node they selected/edited on the canvas. Use it when the user says things like "apply the tweak I just queued", "I clicked Tweak on the bom node — make that change", "pick up my floless request", "what's pending in floless", or after they double-click/Tweak a node in the UI. ALSO use it the moment the user pastes a message that begins with a `[floless-request type=… id=…]` marker — that is a request copied from the FloLess Dashboard, NOT a literal instruction to run; resolve it via the API. It reads the floless.app local API, applies the change to the app's .flo, recompiles, and clears the request.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.1.
|
|
5
|
+
version: 0.1.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# floless.app ↔ terminal bridge
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: floless-app-onboarding
|
|
3
3
|
description: This skill should be used to onboard a user into floless.app and its AWARE runtime as a guided, re-runnable walkthrough. It first explains what AWARE is (the runtime), checks the installed AWARE version and offers an update, maps the command surface, and shows the AVAILABLE agents via the `aware agent catalog` command (installing one on request); then it tours floless.app (the 3-column chat/canvas/inspect UI, the Compile-Approve-Run gate, Simulate vs real Run, Templates, Routines, the Agents library, Bake and Graft, the Inspect tabs, the version footer) and the three floless skills (bridge, routines, workflows). Use it when the user is new or wants a refresher, on triggers like "onboard me", "get me started", "I'm new to floless.app or AWARE", "give me a tour", "how do I use this", "walk me through floless.app", "what can AWARE do", "show me the agents", or "/floless-app-onboarding". It can be re-invoked anytime for the whole tour or a single section.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.1.
|
|
5
|
+
version: 0.1.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Onboarding a user into floless.app + AWARE
|
|
@@ -2,7 +2,7 @@
|
|
|
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, 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) 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.1.
|
|
5
|
+
version: 0.1.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# floless.app queue picker
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: floless-app-routines
|
|
3
3
|
description: This skill should be used when the user wants to set up a floless.app workflow (.flo app) to run automatically — "routines" — either on a timer (schedule) or on a live event (trigger). Triggers on requests like "schedule tekla-bom-by-phase every weekday at 7am", "run this workflow every 2 hours", "run my BOM whenever the Tekla model changes", "watch the model and run X on each change", "set up a trigger routine", "list my routines", "disable the morning routine", "delete that routine". Covers the floless.app routines REST API (create / list / edit / enable-disable / delete / run-now), the schedule presets, the event-trigger kind, the confirm-first rule, and the runnable gate.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.1.
|
|
5
|
+
version: 0.1.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Setting up floless.app routines (automatic .flo runs)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: floless-app-steel-model
|
|
3
3
|
description: The front-door guide for turning a structural steel drawing SET into an editable model in floless.app — the "Steel Model" flow. This skill orchestrates the whole pipeline — set up a project folder, learn the set into plain-English knowledge files, provision the right AWARE agents (region-specific steel detailer plus any bake targets), confirm which sheets are plans / elevations / details, then hand off to the Steel Takeoff reader to read each plan into a steel.takeoff/v1 contract — with explicit confirm gates between stages. Use it when a user wants to model steel from a drawing SET or asks things like "model this steel job from the drawings", "take off this whole set", "start a steel takeoff project", "turn these structural drawings into a model", "I have a PDF set of framing plans", or "/floless-app-steel-model". It is re-runnable — resume at any stage. For a single already-isolated framing plan the Steel Takeoff reader (floless-app-steel-takeoff) can be used directly; this guide is for driving a real job end to end.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.
|
|
5
|
+
version: 0.4.0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Steel Model — guide a steel drawing set into an editable model
|
|
@@ -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.
|
|
5
|
+
version: 0.11.0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Steel Takeoff — read a drawing into a steel.takeoff/v1 contract
|
|
@@ -251,7 +251,12 @@ native/display coords):
|
|
|
251
251
|
- **The GET returned a contract** → send only the pre-read blocks to
|
|
252
252
|
**`PUT /api/projects/<projectId>/steel-prepass`** with `{ filter }` and `If-Match: <that ETag>`.
|
|
253
253
|
- **The GET returned nothing** (a project created by dropping a drawing) → this is the create case,
|
|
254
|
-
so compose the whole document and
|
|
254
|
+
so compose the whole document and
|
|
255
|
+
`PUT /api/contract/steel-model?project=<projectId>` with `If-None-Match: *`.
|
|
256
|
+
**`?project=` is not optional here.** The contract route scopes a write to a project ONLY through
|
|
257
|
+
that query parameter; without it you write the app-scoped draft instead — the project's pre-read
|
|
258
|
+
filter never lands, and `If-None-Match: *` can come back `412` against an unrelated draft that
|
|
259
|
+
happens to exist on the app.
|
|
255
260
|
|
|
256
261
|
The prepass verb takes `filter`, `datum` and per-sheet `{ grid, datum_at, datum_ref, control2_at,
|
|
257
262
|
control2_ref, elevation_in }` and **refuses `members`, `connections` and `joints` by name**, so it
|
|
@@ -1041,8 +1046,30 @@ Key field rules:
|
|
|
1041
1046
|
|---|---|
|
|
1042
1047
|
| the pre-read blocks — §1b `filter`, §1c `grid`, §1d `datum` + the per-sheet registration keys | **`PUT /api/projects/<projectId>/steel-prepass`** |
|
|
1043
1048
|
| the same, on a **`steel.model/v2`** model — `filter` + the per-sheet registration keys ONLY, no `grid`, no `datum` | the same verb; it refuses the other two by name |
|
|
1044
|
-
| the finished takeoff (§4's whole document: `members`, profiles, elevations) |
|
|
1045
|
-
|
|
|
1049
|
+
| the finished takeoff (§4's whole document: `members`, profiles, elevations) **into a Workspaces project** — including the project's FIRST one | **`POST /api/projects/<projectId>/revision-requests`** then **`POST /api/projects/<projectId>/revision-read`** (§9) |
|
|
1050
|
+
| the finished takeoff when there is **no project** (a plain app-scoped contract) | `PUT /api/contract/steel-model` (add `If-None-Match: *` when the `GET` returned no ETag) |
|
|
1051
|
+
|
|
1052
|
+
**A finished takeoff into a project goes through `revision-read`, never the contract PUT — and "it is the
|
|
1053
|
+
first document" does not change that** (#492). Both routes store the members, so the contract PUT looks
|
|
1054
|
+
like it worked: `200`, an ETag, and a project the user can open. What it silently skips is everything that
|
|
1055
|
+
makes the read a *version*:
|
|
1056
|
+
|
|
1057
|
+
- **No entry in the ledger.** An ordinary contract PUT calls `createVersion` nowhere — only rollback,
|
|
1058
|
+
Approve, `revision-read` and the v2 migration commit do. The project's History reads *"No versions
|
|
1059
|
+
yet"* over a document that plainly exists, so there is nothing to compare, roll back to, or sign off.
|
|
1060
|
+
- **No provenance.** `revision-read` records the drawing files the read came from (`source.files`) and the
|
|
1061
|
+
request it answered. A contract PUT records that the document changed, and nothing about where it came from.
|
|
1062
|
+
- **The Steel Filter checkpoint does not run.** `revisionReadContractError` is wired into `revision-read`
|
|
1063
|
+
only. It is what refuses a member read whose work-points are not backed by the saved filter selection —
|
|
1064
|
+
the check that catches a mis-registered read *before* it becomes the model.
|
|
1065
|
+
|
|
1066
|
+
So the create case belongs to `revision-read` too: queue the request with the drawing snapshots, then post
|
|
1067
|
+
the contract against that `requestId`. §9 has the call shape and the identity rules.
|
|
1068
|
+
|
|
1069
|
+
The one create that **is** the contract route's is the **pre-read** document in §1b — the prepass verb
|
|
1070
|
+
cannot create a document, so a project whose `GET` returned nothing needs the contract PUT to bring the
|
|
1071
|
+
`filter` blocks into being. That is staging, not a read: it carries no members, and the member read that
|
|
1072
|
+
follows still goes through `revision-read` and still mints v1.
|
|
1046
1073
|
|
|
1047
1074
|
The prepass verb exists because the pre-read pass used to GET the contract and PUT the **whole document**
|
|
1048
1075
|
back. That is a full-document replacement: it can overwrite members, joints and connections that the
|
|
@@ -1052,11 +1079,18 @@ control2_ref, elevation_in }`, and refuses everything else **by name** with a `4
|
|
|
1052
1079
|
`steel.model/v2` model the accepted set is narrower** — `filter` plus the per-sheet registration keys,
|
|
1053
1080
|
with `grid` and `datum` refused (§1c, §1d), because a v2 grid is model-global canonical structure rather
|
|
1054
1081
|
than a pre-read block. It cannot create a
|
|
1055
|
-
document and it cannot add a sheet (an unknown sheet is a `400`, never a new plan),
|
|
1056
|
-
|
|
1082
|
+
document and it cannot add a sheet (an unknown sheet is a `400`, never a new plan), which is why the
|
|
1083
|
+
**§1b pre-read** create — and only that one — belongs to the contract route.
|
|
1057
1084
|
|
|
1058
|
-
|
|
1059
|
-
implementation, so the
|
|
1085
|
+
The two **contract-store** routes (the prepass verb and `PUT /api/contract/steel-model`) share one
|
|
1086
|
+
implementation, so the `412`/`428` answers and the lock below apply to whichever you use — **with one
|
|
1087
|
+
deliberate exception**: the prepass verb refuses `If-Match: *` with its own `428`. It patches the
|
|
1088
|
+
document you read, and `*` cannot detect a write that landed since your GET, so it demands the EXACT
|
|
1089
|
+
ETag (§1b). `If-None-Match: *` is no use there either, since that verb cannot create a document. In
|
|
1090
|
+
short: on the prepass verb, always send the exact ETag.
|
|
1091
|
+
|
|
1092
|
+
`revision-read` is a different shape again and is covered in §9: it carries no ETag at all, because the
|
|
1093
|
+
AI composed that document from the drawing set rather than from one it read here.
|
|
1060
1094
|
|
|
1061
1095
|
**Read first, then write.** `GET` the contract before you write and keep its `ETag` response header —
|
|
1062
1096
|
that tag is what makes the write safe, and you need it even when you are replacing the document
|
|
@@ -1066,7 +1100,7 @@ wholesale.
|
|
|
1066
1100
|
header depends on what that `GET` returned:
|
|
1067
1101
|
|
|
1068
1102
|
```
|
|
1069
|
-
PUT http://localhost:<port>/api/contract/steel-model
|
|
1103
|
+
PUT http://localhost:<port>/api/contract/steel-model?project=<projectId> # ?project= = which store
|
|
1070
1104
|
Content-Type: application/json
|
|
1071
1105
|
If-Match: <the ETag from your GET> # replacing — the usual case
|
|
1072
1106
|
If-None-Match: * # ONLY if the GET returned no ETag at all (no draft yet)
|
|
@@ -1074,6 +1108,11 @@ If-None-Match: * # ONLY if the GET returned no ETag at
|
|
|
1074
1108
|
<contract JSON body>
|
|
1075
1109
|
```
|
|
1076
1110
|
|
|
1111
|
+
**Drop `?project=` and you have written a different document.** It is the only thing that scopes this
|
|
1112
|
+
route to a project; without it the write lands on the app-scoped draft. Omit it *only* for a genuinely
|
|
1113
|
+
app-scoped contract (no project involved) — and keep it on the `GET` too, so the ETag you send back
|
|
1114
|
+
belongs to the store you are writing.
|
|
1115
|
+
|
|
1077
1116
|
The server schema-validates the body. Responses that need action:
|
|
1078
1117
|
|
|
1079
1118
|
- **`400`** — schema-invalid. Read the error, fix the offending fields, and re-PUT.
|
|
@@ -1084,7 +1123,9 @@ The server schema-validates the body. Responses that need action:
|
|
|
1084
1123
|
ETag) and retry.
|
|
1085
1124
|
|
|
1086
1125
|
Sending a precondition is not optional politeness: without it a slow edit silently overwrites whatever
|
|
1087
|
-
landed while you were working. Read back the current contract with
|
|
1126
|
+
landed while you were working. Read back the current contract with
|
|
1127
|
+
`GET /api/contract/steel-model?project=<projectId>` — same `?project=` rule as the write, or you read
|
|
1128
|
+
one store and precondition the other.
|
|
1088
1129
|
|
|
1089
1130
|
### 6. Hand off to the user
|
|
1090
1131
|
|
|
@@ -1124,19 +1165,27 @@ contract carries the source path in `source.path` and an embedded raster in `ras
|
|
|
1124
1165
|
are machine-local (stored under `~/.floless/contracts/steel-model.json` by the server and
|
|
1125
1166
|
never committed). Clip title blocks from any embedded preview.
|
|
1126
1167
|
|
|
1127
|
-
### 9.
|
|
1168
|
+
### 9. Reading into a project — the `revision-read` route (Slice 5)
|
|
1169
|
+
|
|
1170
|
+
**This is the route for EVERY member read into a Workspaces project — the first one and every re-read**
|
|
1171
|
+
(§5). The two differ only in how much of the section below applies: a first read has no prior members,
|
|
1172
|
+
so the identity rules are vacuous and you can skip to *"No request queued yet"* at the end.
|
|
1128
1173
|
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1174
|
+
On a **re-read** (a REVISED drawing set attached to a project that already has versions) the Workspaces
|
|
1175
|
+
**History → "What changed"** compare matches members between versions by their `id`, scoped per `sheet`.
|
|
1176
|
+
So the re-read must keep identity stable:
|
|
1132
1177
|
|
|
1133
|
-
1. **Fetch the current contract first** — `GET /api/contract/steel-model?project=<projectId
|
|
1134
|
-
project id is in
|
|
1178
|
+
1. **Fetch the current contract first** — `GET /api/contract/steel-model?project=<projectId>`. (When a
|
|
1179
|
+
queued request triggered you, the project id is in that request's body; on a first read you queued
|
|
1180
|
+
the request yourself, so you already have it.) That is the previous version's working tree.
|
|
1135
1181
|
2. **Carry ids + sheets forward** — for every member that still exists in the revised set, reuse its
|
|
1136
1182
|
existing `id` and keep it on the same `sheet` label (e.g. `S-201` stays `S-201`). Mint a NEW id
|
|
1137
1183
|
only for a genuinely new member; simply drop the id of a member the revision deleted.
|
|
1138
1184
|
3. Then compose the updated `steel.takeoff/v1` and `POST /api/projects/<projectId>/revision-read
|
|
1139
|
-
{ contract, message, requestId }
|
|
1185
|
+
{ contract, message, requestId }`. On the **v1** arm that POST commits the version and clears the
|
|
1186
|
+
request for you — do **not** DELETE it. On an already-migrated **v2** project it instead answers
|
|
1187
|
+
`202` and stages the read for human confirmation; the request stays queued and must not be deleted
|
|
1188
|
+
either (see "Notes that bite" below).
|
|
1140
1189
|
|
|
1141
1190
|
> **On a `steel.model/v2` project compose a `steel.model/v2` document instead** — check the `type`
|
|
1142
1191
|
> of the contract you GET-ed in step 1. Members live in one root `members[]` in world millimetres,
|
|
@@ -1144,6 +1193,38 @@ their `id`, scoped per `sheet`. So the re-read must keep identity stable:
|
|
|
1144
1193
|
> new place, in which case write the new one and it becomes a proposal the user accepts (§1c).
|
|
1145
1194
|
> Never drop the `grid` key to mean "unchanged" — a read that omits it is refused.
|
|
1146
1195
|
|
|
1196
|
+
**No request queued yet? Queue it yourself — this is also the FIRST read's route** (§5). The two-call
|
|
1197
|
+
shape is the same whether the project already has versions or none at all:
|
|
1198
|
+
|
|
1199
|
+
```
|
|
1200
|
+
POST http://localhost:<port>/api/projects/<projectId>/revision-requests
|
|
1201
|
+
Content-Type: application/json
|
|
1202
|
+
|
|
1203
|
+
{ "snapshots": [ { "name": "S-201.pdf", "dataUrl": "data:application/pdf;base64,…" } ],
|
|
1204
|
+
"message": "First read of the framing plans" }
|
|
1205
|
+
-> { ok: true, request: { id: "<requestId>", … } }
|
|
1206
|
+
```
|
|
1207
|
+
|
|
1208
|
+
Then post the contract against that id, exactly as step 3 above. Notes that bite:
|
|
1209
|
+
|
|
1210
|
+
- **At least one snapshot is required** (`400` otherwise) — they become the version's durable
|
|
1211
|
+
`source.files` provenance, so this is also how the drawing files get stored, not just how the request
|
|
1212
|
+
gets made. Send the real sheets you read.
|
|
1213
|
+
- **At most EIGHT snapshots** (`400 too many snapshots (max 8)`), each within the per-file byte cap.
|
|
1214
|
+
A real set has more sheets than that, so send the ones this read is actually based on rather than the
|
|
1215
|
+
whole set, and queue a further read for the rest.
|
|
1216
|
+
- **`snapshots[].dataUrl` is a base64 data-URL and the server SNIFFS the bytes** — it accepts PNG, JPEG,
|
|
1217
|
+
WebP and PDF, and `400`s on anything else. A DXF/SVG/TIFF sheet must be rendered to one of those
|
|
1218
|
+
first. `name` is optional but worth sending: it is the durable provenance label stored with the file.
|
|
1219
|
+
(It is not rendered in the History table today — send it because it is the record, not for display.)
|
|
1220
|
+
- **The queue stamps the ledger head as the read's base.** If a version lands between the queue and the
|
|
1221
|
+
post, `revision-read` answers `409` — re-GET and re-read rather than retrying the same body.
|
|
1222
|
+
- **On an already-migrated `steel.model/v2` project the post does NOT commit.** A v2 document is
|
|
1223
|
+
*staged* for human review: the answer is `202` with `ok: true` — so check the STATUS, not `ok` — the
|
|
1224
|
+
request stays queued as `staged`, no version is minted, and nothing is written until the user
|
|
1225
|
+
confirms in Workspaces. Hand off at the `202`; do not treat it as a finished read, and do not delete
|
|
1226
|
+
the request. Only the v1 arm commits in one step and clears the request itself.
|
|
1227
|
+
|
|
1147
1228
|
If you renumber everything, the diff shows a misleading "all removed + all added" and the app warns
|
|
1148
1229
|
**"identity not preserved."** Carrying ids forward is what makes *"beam B12 was upsized"* come out
|
|
1149
1230
|
exact instead of a churn of the whole model.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: floless-app-ui
|
|
3
3
|
description: This skill should be used when the user wants to customize the floless.app Dashboard — add, change, rearrange, or remove custom panels (stat cards, data tables, report buttons, run buttons) — or when picking up queued 'ui-customize' requests from the floless.app Customize box. Use it when the user says things like "add a panel showing last night's BOM run", "pin a run button to my dashboard", "apply my dashboard change", "customize my floless dashboard", "pick up my floless UI request", after they type into the Dashboard's Customize box, OR when they paste a message beginning with a `[floless-request type=ui-customize id=…]` marker (a request copied from the Dashboard — resolve it via /api/requests, don't run it verbatim). It edits ~/.floless/ui/extensions.json (the declarative UI descriptor), validates with the AWARE ui agent, and the app re-renders live.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.1.
|
|
5
|
+
version: 0.1.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# floless.app Custom Panels — the dashboard descriptor
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: floless-app-workflows
|
|
3
3
|
description: This skill should be used when building, modifying, or reasoning about FloLess .flo workflows for floless.app — especially reusable apps that take inputs (e.g. a phase number) and run across different Tekla models, exec nodes that run Roslyn C# against the live model, the in-app HTML Viewer, the Code tab, or "Debug in VS". Covers the exec contract, the install→validate→compile→run loop, app inputs templating, reading an approved Workspace project's data from a running workflow via the floless-workspace REST seam plus its workspace-project input picker, and the server seams (aware-adapter, app-reader, index).
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.3.
|
|
5
|
+
version: 0.3.2
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Building reusable .flo workflows in floless.app
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: reading-structural-drawings
|
|
3
3
|
description: This skill should be used BEFORE modelling anything from a structural/architectural drawing SET (PDF). Use it whenever turning drawings into a 3D frame, takeoff, IFC, or Tekla model — it is the prerequisite reading discipline for the `floless-app-steel-takeoff` reader (and the `floless-app-steel-model` guide that orchestrates the full flow). Triggers on "read this drawing set", "model this structure from the PDF", "take off this steel", "build a model from these drawings", or any pure-PDF → structure task. It encodes the method that stops the classic failures (missing that a set is TWO buildings, missing a curved/sloped roof, conflating grids across sheets, tracing dimension lines as members) — establish MASSING + COORDINATE FRAME first (from the index + elevations + sections), members LAST; deterministic geometry feeds the reasoning; cross-validate every view; verify before presenting.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.2.
|
|
5
|
+
version: 0.2.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Reading a structural drawing set — the discipline (do this BEFORE you model anything)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: steel-drawing-abbreviations
|
|
3
3
|
description: Default legend of standard US (AISC, imperial) structural-steel drawing abbreviations, note conventions, and shape designations — the fallback meaning when a drawing set omits or only partially supplies its own abbreviations/legend sheet. This skill should be used while reading a structural steel drawing whenever an abbreviation, note code, or profile designation needs expanding (TYP, TOS, UON, EQ, (E)/(N), SIM, HSS, WT, and so on), or when the steel reader (floless-app-steel-takeoff / floless-app-steel-model) meets a note or label whose meaning is not defined on the supplied sheets. The project's own legend always overrides these defaults.
|
|
4
4
|
metadata:
|
|
5
|
-
version: "0.2.
|
|
5
|
+
version: "0.2.1"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Steel drawing abbreviations — default legend
|
package/dist/web/app.css
CHANGED
|
@@ -2039,6 +2039,23 @@
|
|
|
2039
2039
|
.import-failed-remedy-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: 6px; }
|
|
2040
2040
|
.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; }
|
|
2041
2041
|
.import-failed-cmd-row:last-child { margin-bottom: 0; }
|
|
2042
|
+
/* #366 — the in-app verb beneath the copyable command. Two lines rather than three controls on one,
|
|
2043
|
+
so a long agent id still reads. The button reuses .lib-update (the Agent Library's own Update) —
|
|
2044
|
+
same verb, same treatment, nothing new to learn. */
|
|
2045
|
+
.import-failed-agent { margin-bottom: 10px; }
|
|
2046
|
+
.import-failed-agent:last-child { margin-bottom: 0; }
|
|
2047
|
+
.import-failed-act { display: flex; align-items: baseline; gap: 10px; margin: 5px 0 0 12px; flex-wrap: wrap; }
|
|
2048
|
+
.import-failed-agent-status { font-size: 11px; color: var(--text-dim); }
|
|
2049
|
+
.import-failed-agent-status.is-updated { color: var(--ok); }
|
|
2050
|
+
.import-failed-agent-status.is-error { color: var(--err); }
|
|
2051
|
+
/* "Nothing to update" is the ANSWER, not a success and not a failure — deliberately calmer than
|
|
2052
|
+
both, so it cannot read as either. Muted, no glyph. */
|
|
2053
|
+
.import-failed-agent-status.is-current { color: var(--text-muted); }
|
|
2054
|
+
.import-failed-retry { margin: 12px 0 0; font-size: 11.5px; color: var(--text-muted); }
|
|
2055
|
+
.import-failed-retry-go { font: inherit; color: var(--accent-bright); background: none; border: 0;
|
|
2056
|
+
padding: 0; cursor: pointer; text-decoration: underline; }
|
|
2057
|
+
.import-failed-retry-go:hover { color: var(--text); }
|
|
2058
|
+
.import-failed-retry-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
|
|
2042
2059
|
.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;
|
|
2043
2060
|
scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
|
|
2044
2061
|
.import-failed-cmd::-webkit-scrollbar { height: 7px; }
|
|
@@ -4161,6 +4178,30 @@ table.hist tr.current td { background:var(--accent-soft); }
|
|
|
4161
4178
|
.rev-row-title { font-size:12.5px; font-weight:600; color:var(--text); font-family:var(--mono); overflow-wrap:anywhere; }
|
|
4162
4179
|
.rev-row-sub { font-size:11px; color:var(--text-dim); margin-top:3px; }
|
|
4163
4180
|
.rev-row-note { font-size:11px; color:var(--text-dim); font-style:italic; margin-top:4px; }
|
|
4181
|
+
/* Fan-out disclosure on a collapsed decision row (#493). One row can stand for hundreds of identical
|
|
4182
|
+
decisions, so the individual items are offered as evidence rather than asked to be trusted — closed
|
|
4183
|
+
by default, because auto-opening 230 items would bury the sibling rows the user must also see.
|
|
4184
|
+
The list is CAPPED and therefore a scroll container: at 230 items an uncapped block pushes the other
|
|
4185
|
+
decisions far off screen whenever it is opened. A cap means a scrollbar, and a scrollbar here must be
|
|
4186
|
+
themed in the same pass — a native white bar against the dark theme is exactly what the standing
|
|
4187
|
+
rule exists to stop. Reuses .ws-archived-summary's caret rotation idiom rather than a new one. */
|
|
4188
|
+
/* What ticking the row actually covers — stated visibly, not only in the accessible name. */
|
|
4189
|
+
.mig-fanout-scope { margin-top:5px; font-size:11px; color:var(--text-muted); }
|
|
4190
|
+
.mig-fanout { margin-top:7px; }
|
|
4191
|
+
.mig-fanout-summary { list-style:none; cursor:pointer; font-size:11px; color:var(--text-dim);
|
|
4192
|
+
display:flex; align-items:center; gap:5px; user-select:none; }
|
|
4193
|
+
.mig-fanout-summary::-webkit-details-marker { display:none; }
|
|
4194
|
+
.mig-fanout-summary:hover { color:var(--text-muted); }
|
|
4195
|
+
.mig-fanout-summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:3px; }
|
|
4196
|
+
.mig-fanout[open] > .mig-fanout-summary .ws-archived-caret { transform:rotate(90deg); }
|
|
4197
|
+
.mig-fanout-list { margin-top:6px; max-height:172px; overflow-y:auto; display:flex; flex-direction:column;
|
|
4198
|
+
gap:2px; padding:6px 8px; border:1px solid var(--border); border-radius:5px; background:var(--surface-2);
|
|
4199
|
+
scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
|
|
4200
|
+
.mig-fanout-list::-webkit-scrollbar { width:9px; }
|
|
4201
|
+
.mig-fanout-list::-webkit-scrollbar-thumb { background:var(--border-strong); border-radius:5px; }
|
|
4202
|
+
.mig-fanout-list::-webkit-scrollbar-track { background:transparent; }
|
|
4203
|
+
.mig-fanout-item { font:500 11px/1.5 var(--mono); color:var(--text-muted); overflow-wrap:anywhere; }
|
|
4204
|
+
|
|
4164
4205
|
.rev-fields { margin:6px 0 0; display:flex; flex-direction:column; gap:3px; }
|
|
4165
4206
|
.rev-field { font-size:11.5px; color:var(--text-muted); overflow-wrap:anywhere; }
|
|
4166
4207
|
.rev-field-key { font-family:var(--mono); color:var(--text-dim); margin-right:6px; }
|
|
@@ -4453,6 +4494,17 @@ tr.hist-diff-row[hidden] { display:none; }
|
|
|
4453
4494
|
.kb-organize[aria-disabled="true"] { opacity:.6; cursor:default; background:var(--surface-2);
|
|
4454
4495
|
border-color:var(--border-strong); color:var(--text-muted); box-shadow:none; }
|
|
4455
4496
|
.kb-organize[aria-disabled="true"]:hover { background:var(--surface-2); border-color:var(--border-strong); box-shadow:none; }
|
|
4497
|
+
/* The header ✓ Approve when the project has no model to approve (#490). `aria-disabled` and not
|
|
4498
|
+
`disabled`, for the reason .kb-organize and .ecard .e-act already record — a disabled button is
|
|
4499
|
+
unhoverable and unfocusable, so the data-tip explaining WHY would never reach the person who needs
|
|
4500
|
+
it, and approveProject re-checks the state itself. THIS RULE IS THE OTHER HALF OF THAT BARGAIN:
|
|
4501
|
+
without it `aria-disabled` renders as nothing, a sighted user sees an ordinary live button and only
|
|
4502
|
+
a screen-reader user is told it is unavailable — which is the same "offering an action there is
|
|
4503
|
+
nothing to perform" the fix is about, just moved. Found by review, after shipping the attribute
|
|
4504
|
+
alone and citing three precedents that all ship a matching visual rule. */
|
|
4505
|
+
#ws-approve[aria-disabled="true"] { opacity:.6; cursor:default; background:var(--surface-2);
|
|
4506
|
+
border-color:var(--border-strong); color:var(--text-muted); box-shadow:none; }
|
|
4507
|
+
#ws-approve[aria-disabled="true"]:hover { background:var(--surface-2); border-color:var(--border-strong); box-shadow:none; }
|
|
4456
4508
|
.kb-organize:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
|
|
4457
4509
|
/* Stage D — Adjust: steer the compiled wiki in plain English. A collapsed disclosure below Organize
|
|
4458
4510
|
(only once a wiki exists), same idiom as .ws-archived. The submit is class="primary kb-adjust-submit"
|
package/dist/web/aware.js
CHANGED
|
@@ -4277,6 +4277,12 @@
|
|
|
4277
4277
|
function closeImportFailedModal() {
|
|
4278
4278
|
hideModal($importFailedModal);
|
|
4279
4279
|
dropImportFailedEsc();
|
|
4280
|
+
_importFailedFile = null; // don't hold a File handle past the dialog it belongs to
|
|
4281
|
+
_importFailedTouched = new Set();
|
|
4282
|
+
// AND the in-flight map. Leaving it populated meant a result for an update started in THIS dialog
|
|
4283
|
+
// could land after a DIFFERENT import had failed and opened a new one — writing its outcome into
|
|
4284
|
+
// the new dialog's rows and offering to retry an unrelated file.
|
|
4285
|
+
_importFailedVersions.clear();
|
|
4280
4286
|
// Import has no single stable trigger (a menu item that has already closed, an OS file drop with
|
|
4281
4287
|
// no DOM node, a hidden input), so fall back to the menu button rather than pretend otherwise.
|
|
4282
4288
|
// <body> counts as no target: it is what activeElement reports when nothing is focused, and
|
|
@@ -4292,6 +4298,12 @@
|
|
|
4292
4298
|
// stderr, and there is no reason to route it through a string template at all.
|
|
4293
4299
|
function importFailedCmdRow(agent) {
|
|
4294
4300
|
const cmd = `aware agent update ${agent}`;
|
|
4301
|
+
// TWO LINES, not three controls crammed onto one. The command line is left exactly as it was —
|
|
4302
|
+
// zero risk to what already works, and it stays readable when an agent id is long.
|
|
4303
|
+
const wrap = document.createElement('div');
|
|
4304
|
+
wrap.className = 'import-failed-agent';
|
|
4305
|
+
wrap.dataset.agent = agent;
|
|
4306
|
+
|
|
4295
4307
|
const row = document.createElement('div');
|
|
4296
4308
|
row.className = 'import-failed-cmd-row';
|
|
4297
4309
|
const code = document.createElement('code');
|
|
@@ -4304,10 +4316,79 @@
|
|
|
4304
4316
|
copy.dataset.tip = 'Copy this command';
|
|
4305
4317
|
copy.textContent = '⎘ Copy';
|
|
4306
4318
|
row.append(code, copy);
|
|
4307
|
-
|
|
4319
|
+
|
|
4320
|
+
// The in-app verb. Same class and glyph as the Agent Library's own Update button, because it IS
|
|
4321
|
+
// the same verb (`updateAgent` → POST /api/agents/update) — a second visual treatment for one
|
|
4322
|
+
// action would just be a second thing to learn. Copy stays as the secondary: someone who prefers
|
|
4323
|
+
// to run it in their own terminal session should not lose that, which is this app's whole premise.
|
|
4324
|
+
const act = document.createElement('div');
|
|
4325
|
+
act.className = 'import-failed-act';
|
|
4326
|
+
const upd = document.createElement('button');
|
|
4327
|
+
upd.type = 'button';
|
|
4328
|
+
upd.className = 'lib-update';
|
|
4329
|
+
upd.dataset.agentUpdate = agent;
|
|
4330
|
+
upd.dataset.tip = `Update ${agent} right here — no need to leave FloLess`;
|
|
4331
|
+
upd.textContent = '↑ Update it now';
|
|
4332
|
+
const status = document.createElement('span');
|
|
4333
|
+
status.className = 'import-failed-agent-status';
|
|
4334
|
+
status.dataset.agentStatus = agent;
|
|
4335
|
+
act.append(upd, status);
|
|
4336
|
+
|
|
4337
|
+
wrap.append(row, act);
|
|
4338
|
+
return wrap;
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
/**
|
|
4342
|
+
* Report one agent's update outcome in the import-failure dialog.
|
|
4343
|
+
*
|
|
4344
|
+
* THREE outcomes, and the third is the one the copy has to get right. `aware agent update` re-pulls
|
|
4345
|
+
* the latest REGISTRY version of an already-installed agent — it cannot conjure a build upstream has
|
|
4346
|
+
* never made. So "nothing to update" is neither success nor failure, it is the ANSWER: this agent has
|
|
4347
|
+
* not been released as runnable yet. It gets the calmest treatment of the three (muted, no glyph)
|
|
4348
|
+
* precisely so it does not read as either.
|
|
4349
|
+
*/
|
|
4350
|
+
function importFailedAgentStatus(agent, state, detail) {
|
|
4351
|
+
if (!$importFailedModal) return;
|
|
4352
|
+
const el = $importFailedModal.querySelector(`[data-agent-status="${CSS.escape(agent)}"]`);
|
|
4353
|
+
if (!el) return;
|
|
4354
|
+
el.className = `import-failed-agent-status is-${state}`;
|
|
4355
|
+
el.textContent = state === 'updated' ? `✓ Updated to v${detail}`
|
|
4356
|
+
: state === 'current' ? 'Nothing to update — already the latest version. This agent hasn’t been released as runnable yet.'
|
|
4357
|
+
// We captured no "before" version, so we cannot honestly claim a change happened. Report what
|
|
4358
|
+
// AWARE now has and say nothing we do not know.
|
|
4359
|
+
: state === 'done' ? `AWARE finished — it reports v${detail || '?'} installed.`
|
|
4360
|
+
: state === 'busy' ? 'Updating… this can take a minute or two'
|
|
4361
|
+
: `Couldn’t update — ${String(detail || '').slice(0, 90)}`;
|
|
4362
|
+
|
|
4363
|
+
// EVERY TERMINAL STATE releases the button. Setting only the text left `aria-busy="true"` and
|
|
4364
|
+
// `disabled` in place forever, so assistive tech kept announcing "busy" on a finished row and the
|
|
4365
|
+
// user could not try again after a failure.
|
|
4366
|
+
const btn = $importFailedModal.querySelector(`[data-agent-update="${CSS.escape(agent)}"]`);
|
|
4367
|
+
if (btn && state !== 'busy') {
|
|
4368
|
+
btn.removeAttribute('aria-busy');
|
|
4369
|
+
btn.disabled = false;
|
|
4370
|
+
if (state === 'error') btn.textContent = '↻ Try again';
|
|
4371
|
+
}
|
|
4308
4372
|
}
|
|
4309
4373
|
|
|
4310
|
-
|
|
4374
|
+
/** The version the catalog currently reports for an agent, or null — used to tell the three apart. */
|
|
4375
|
+
function installedAgentVersion(id) {
|
|
4376
|
+
const a = agentCatalog.find((x) => x.id === id);
|
|
4377
|
+
return (a && (a.version || (a.manifest && a.manifest.version))) || null;
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
/** The file this dialog is about, so "Retry the import" is genuinely ONE click rather than a polite
|
|
4381
|
+
* way of asking the user to find the file again. Cleared when the dialog closes. */
|
|
4382
|
+
let _importFailedFile = null;
|
|
4383
|
+
/** Agent ids whose in-app update finished — any one of them means a retry is worth offering. */
|
|
4384
|
+
let _importFailedTouched = new Set();
|
|
4385
|
+
/** id → the version installed BEFORE its in-app update, so the SSE result can tell "updated to vX"
|
|
4386
|
+
* from "already current". The agent-install-result payload carries ok/error and no version. */
|
|
4387
|
+
const _importFailedVersions = new Map();
|
|
4388
|
+
|
|
4389
|
+
function openImportFailedModal(reason, agents, file) {
|
|
4390
|
+
_importFailedFile = file || null;
|
|
4391
|
+
_importFailedTouched = new Set();
|
|
4311
4392
|
const $sub = document.getElementById('import-failed-sub');
|
|
4312
4393
|
const $remedy = document.getElementById('import-failed-remedy');
|
|
4313
4394
|
const $rows = document.getElementById('import-failed-remedy-rows');
|
|
@@ -4326,6 +4407,19 @@
|
|
|
4326
4407
|
: `This workflow needs ${agents.length} agents that aren’t runnable yet on this machine: ${named}.`
|
|
4327
4408
|
+ ' Updating usually fixes it. Any that report nothing to update haven’t been released yet — this workflow can’t run here until they are.';
|
|
4328
4409
|
$rows.append(...agents.map(importFailedCmdRow)); // one command per agent, never a guessed multi-agent form
|
|
4410
|
+
// ONE retry offer for the whole dialog, not one per row: "retry THE import" is singular, and N
|
|
4411
|
+
// buttons doing the identical thing would just be N ways to ask the same question. Hidden until
|
|
4412
|
+
// something has actually changed — see importFailedOfferRetry.
|
|
4413
|
+
// REMOVE ANY PREVIOUS ONE FIRST. `$rows.replaceChildren()` above clears the rows' children, but
|
|
4414
|
+
// this banner is a SIBLING of $rows — so re-opening the dialog (a failed retry, or simply the
|
|
4415
|
+
// next bad import) used to leave the old one on screen and mint a second element with the same
|
|
4416
|
+
// id, until the dialog showed several retry prompts at once.
|
|
4417
|
+
document.getElementById('import-failed-retry')?.remove();
|
|
4418
|
+
const retry = document.createElement('div');
|
|
4419
|
+
retry.className = 'import-failed-retry';
|
|
4420
|
+
retry.id = 'import-failed-retry';
|
|
4421
|
+
retry.hidden = true;
|
|
4422
|
+
$rows.after(retry);
|
|
4329
4423
|
$remedy.hidden = false;
|
|
4330
4424
|
$detail.open = false; // the fix is the answer; the raw output is backup
|
|
4331
4425
|
} else {
|
|
@@ -4346,7 +4440,61 @@
|
|
|
4346
4440
|
document.addEventListener('keydown', _importFailedEsc);
|
|
4347
4441
|
}
|
|
4348
4442
|
|
|
4443
|
+
/**
|
|
4444
|
+
* Offer a retry once ANY row has finished — a real version bump or a "nothing to update" both count,
|
|
4445
|
+
* because either is new information and a sibling agent's row may genuinely have fixed things.
|
|
4446
|
+
*
|
|
4447
|
+
* Purely additive: it never auto-triggers, never closes the dialog, and never removes the rows or the
|
|
4448
|
+
* raw-output details. Nothing the user was already reading disappears out from under them.
|
|
4449
|
+
*/
|
|
4450
|
+
function importFailedOfferRetry() {
|
|
4451
|
+
const box = document.getElementById('import-failed-retry');
|
|
4452
|
+
if (!box || !_importFailedTouched.size || !_importFailedFile || box.childElementCount) return;
|
|
4453
|
+
const msg = document.createElement('span');
|
|
4454
|
+
msg.textContent = 'Worth another try — ';
|
|
4455
|
+
const go = document.createElement('button');
|
|
4456
|
+
go.type = 'button';
|
|
4457
|
+
go.className = 'import-failed-retry-go';
|
|
4458
|
+
go.dataset.tip = 'Import this workflow again, now that something has changed';
|
|
4459
|
+
go.textContent = 'Retry the import';
|
|
4460
|
+
// No ↺ glyph: it already means Rollback elsewhere in this app, and that is a materially
|
|
4461
|
+
// higher-stakes action to borrow an icon from.
|
|
4462
|
+
go.onclick = () => {
|
|
4463
|
+
const f = _importFailedFile;
|
|
4464
|
+
closeImportFailedModal();
|
|
4465
|
+
if (f) importFlo(f);
|
|
4466
|
+
};
|
|
4467
|
+
const tail = document.createElement('span');
|
|
4468
|
+
tail.textContent = ' now that something’s changed.';
|
|
4469
|
+
box.append(msg, go, tail);
|
|
4470
|
+
box.hidden = false;
|
|
4471
|
+
}
|
|
4472
|
+
|
|
4349
4473
|
if ($importFailedModal) {
|
|
4474
|
+
// The in-app verb, per row. `updateAgent` is the SAME function the Agent Library's Update button
|
|
4475
|
+
// drives, so this inherits its in-flight dedupe and its SSE completion path rather than growing a
|
|
4476
|
+
// second way to run one command.
|
|
4477
|
+
$importFailedModal.addEventListener('click', async (e) => {
|
|
4478
|
+
const btn = e.target && e.target.closest && e.target.closest('[data-agent-update]');
|
|
4479
|
+
if (!btn) return;
|
|
4480
|
+
const id = btn.dataset.agentUpdate;
|
|
4481
|
+
if (!id || installingIds.has(id)) return;
|
|
4482
|
+
btn.setAttribute('aria-busy', 'true');
|
|
4483
|
+
btn.disabled = true;
|
|
4484
|
+
importFailedAgentStatus(id, 'busy');
|
|
4485
|
+
// LOAD THE CATALOGUE FIRST if we have not got one. The whole three-way outcome rests on knowing
|
|
4486
|
+
// the version BEFORE, and the catalogue loads lazily — with an empty one, `before` is null, and
|
|
4487
|
+
// "null !== '0.1.0'" would then report a confident "✓ Updated to v0.1.0" for a command that
|
|
4488
|
+
// found nothing to do. If it still cannot be read we say so rather than guess (state 'done').
|
|
4489
|
+
if (!agentCatalog.length) await loadAgentCatalog().catch(() => {});
|
|
4490
|
+
_importFailedVersions.set(id, installedAgentVersion(id));
|
|
4491
|
+
// The START can fail (bad id, server down) and `updateAgent`'s own catch cannot reach this row,
|
|
4492
|
+
// so it would sit disabled on "Updating…" forever. Own that end here.
|
|
4493
|
+
updateAgent(id, null, (err) => {
|
|
4494
|
+
_importFailedVersions.delete(id);
|
|
4495
|
+
importFailedAgentStatus(id, 'error', (err && err.message) || err);
|
|
4496
|
+
});
|
|
4497
|
+
});
|
|
4350
4498
|
const $close = document.getElementById('import-failed-close');
|
|
4351
4499
|
if ($close) $close.onclick = closeImportFailedModal;
|
|
4352
4500
|
onBackdropDismiss($importFailedModal, closeImportFailedModal);
|
|
@@ -4391,7 +4539,9 @@
|
|
|
4391
4539
|
// Only an install refusal carries AWARE's output. A bad file or a name clash is a one-line
|
|
4392
4540
|
// problem the toast already states well — a dialog there would be ceremony.
|
|
4393
4541
|
if (reason && $importFailedModal) {
|
|
4394
|
-
|
|
4542
|
+
// The File goes with it, so "Retry the import" can genuinely be one click rather than a
|
|
4543
|
+
// polite way of asking the user to locate the file again.
|
|
4544
|
+
openImportFailedModal(reason, Array.isArray(body.agentsUnavailable) ? body.agentsUnavailable : [], file);
|
|
4395
4545
|
return;
|
|
4396
4546
|
}
|
|
4397
4547
|
showToast(msg, body && body.code === 'exists' ? 'warn' : 'err');
|
|
@@ -6144,13 +6294,49 @@
|
|
|
6144
6294
|
const a = availableCatalog.find((x) => x.id === m.id);
|
|
6145
6295
|
showToast(`Installed “${a && a.display_name ? a.display_name : m.id}” — find it in Installed`, 'ok');
|
|
6146
6296
|
}
|
|
6297
|
+
// `isUpdate` as well as the id. Without it, an INSTALL result for the same agent — started
|
|
6298
|
+
// in another tab, and deduped server-side so our update produced no event of its own —
|
|
6299
|
+
// would be reported as this dialog's update outcome.
|
|
6300
|
+
const forDialog = isUpdate && _importFailedVersions.has(m.id);
|
|
6147
6301
|
loadAgentCatalog().then(() => {
|
|
6302
|
+
// Report it in the import-failure dialog too, if that is where the update was started
|
|
6303
|
+
// from. The catalogue has just been reloaded, so comparing against the version captured at
|
|
6304
|
+
// click time is what distinguishes a real bump from "already the latest" — the result
|
|
6305
|
+
// event itself says only ok/error.
|
|
6306
|
+
if (forDialog) {
|
|
6307
|
+
const before = _importFailedVersions.get(m.id);
|
|
6308
|
+
const after = installedAgentVersion(m.id);
|
|
6309
|
+
_importFailedVersions.delete(m.id);
|
|
6310
|
+
_importFailedTouched.add(m.id);
|
|
6311
|
+
// `before == null` means we never knew — claiming "Updated to vX" off that comparison
|
|
6312
|
+
// would be inventing a change we cannot see. Say what is installed and stop there.
|
|
6313
|
+
const state = before == null ? 'done' : (after && after !== before ? 'updated' : 'current');
|
|
6314
|
+
importFailedAgentStatus(m.id, state, after);
|
|
6315
|
+
importFailedOfferRetry();
|
|
6316
|
+
}
|
|
6148
6317
|
if (!($libModal && $libModal.classList.contains('show'))) return;
|
|
6149
6318
|
renderAvailable();
|
|
6150
6319
|
if (libTab === 'installed') renderLibrary();
|
|
6151
|
-
}).catch(() => {
|
|
6320
|
+
}).catch(() => {
|
|
6321
|
+
// The update SUCCEEDED; only the catalogue refresh failed. Without this the row sits on
|
|
6322
|
+
// "Updating…" forever with its button disabled, for a command that actually worked.
|
|
6323
|
+
if (!forDialog) return;
|
|
6324
|
+
_importFailedVersions.delete(m.id);
|
|
6325
|
+
_importFailedTouched.add(m.id);
|
|
6326
|
+
importFailedAgentStatus(m.id, 'done', null);
|
|
6327
|
+
importFailedOfferRetry();
|
|
6328
|
+
});
|
|
6152
6329
|
} else {
|
|
6153
6330
|
showToast(`${isUpdate ? 'Update' : 'Install'} failed: ${String(m.error || '').slice(0, 80)}`, 'err');
|
|
6331
|
+
if (_importFailedVersions.has(m.id)) {
|
|
6332
|
+
// A failed update is NOT the "nothing to update" answer — say which it was, and re-arm the
|
|
6333
|
+
// row's own button so the user can try that one again without redoing the others.
|
|
6334
|
+
_importFailedVersions.delete(m.id);
|
|
6335
|
+
importFailedAgentStatus(m.id, 'error', m.error);
|
|
6336
|
+
const b = $importFailedModal
|
|
6337
|
+
&& $importFailedModal.querySelector(`[data-agent-update="${CSS.escape(m.id)}"]`);
|
|
6338
|
+
if (b) { b.disabled = false; b.removeAttribute('aria-busy'); b.textContent = '↻ Try again'; }
|
|
6339
|
+
}
|
|
6154
6340
|
if ($libModal && $libModal.classList.contains('show')) {
|
|
6155
6341
|
if (isUpdate) renderLibrary();
|
|
6156
6342
|
else renderAvailable();
|
|
@@ -7039,7 +7225,9 @@
|
|
|
7039
7225
|
// (`agent-install-result`, action:'update'), so we flip the card to a busy spinner
|
|
7040
7226
|
// and let the SSE handler refresh the catalog + re-render. `installingIds` is the
|
|
7041
7227
|
// shared in-flight set (an id can't be installing and updating at once).
|
|
7042
|
-
|
|
7228
|
+
// `onStartError` lets a caller that owns its own chrome (the import-failure dialog's per-agent row)
|
|
7229
|
+
// restore it when the START fails — the shared handling below can only reach the Library's cards.
|
|
7230
|
+
function updateAgent(id, btn, onStartError) {
|
|
7043
7231
|
if (installingIds.has(id)) return; // already in flight (server dedupes too)
|
|
7044
7232
|
installingIds.add(id);
|
|
7045
7233
|
if (btn) { // immediate feedback before the next render
|
|
@@ -7053,6 +7241,7 @@
|
|
|
7053
7241
|
.catch((e) => { // the START failed (bad id / server) — completion errors arrive via SSE
|
|
7054
7242
|
installingIds.delete(id);
|
|
7055
7243
|
if ($libModal && $libModal.classList.contains('show')) renderLibrary();
|
|
7244
|
+
if (onStartError) { try { onStartError(e); } catch { /* the caller's chrome, not ours */ } }
|
|
7056
7245
|
reportErr(e);
|
|
7057
7246
|
});
|
|
7058
7247
|
}
|