@floless/app 0.124.0 → 0.124.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/floless-server.cjs +189 -11
- package/dist/schemas/steel.takeoff.v1.schema.json +1 -1
- package/dist/skills/floless-app-queue/SKILL.md +58 -14
- package/dist/skills/floless-app-steel-model/SKILL.md +30 -1
- package/dist/skills/floless-app-tweak-contract/SKILL.md +55 -18
- package/dist/web/aware.js +95 -12
- package/dist/web/steel-editor.html +62 -14
- package/dist/web/workspaces.js +9 -5
- package/package.json +2 -1
package/dist/floless-server.cjs
CHANGED
|
@@ -54611,7 +54611,7 @@ function appVersion() {
|
|
|
54611
54611
|
return resolveVersion({
|
|
54612
54612
|
isSea: isSea2(),
|
|
54613
54613
|
sqVersionXml: readSqVersionXml(),
|
|
54614
|
-
define: true ? "0.124.
|
|
54614
|
+
define: true ? "0.124.1" : void 0,
|
|
54615
54615
|
pkgVersion: readPkgVersion()
|
|
54616
54616
|
});
|
|
54617
54617
|
}
|
|
@@ -54627,7 +54627,7 @@ function resolveChannel(s) {
|
|
|
54627
54627
|
function appChannel() {
|
|
54628
54628
|
return resolveChannel({
|
|
54629
54629
|
isSea: isSea2(),
|
|
54630
|
-
define: true ? "0.124.
|
|
54630
|
+
define: true ? "0.124.1" : void 0,
|
|
54631
54631
|
// argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
|
|
54632
54632
|
// carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
|
|
54633
54633
|
modulePath: process.argv[1]
|
|
@@ -55000,8 +55000,26 @@ function loadDrawingVectorSchema() {
|
|
|
55000
55000
|
function loadSteelModelSchema() {
|
|
55001
55001
|
return loadContractSchema("steel.model.v2.schema.json");
|
|
55002
55002
|
}
|
|
55003
|
+
function duplicateJointIds(doc) {
|
|
55004
|
+
if (!doc || typeof doc !== "object") return [];
|
|
55005
|
+
const joints = doc.joints;
|
|
55006
|
+
if (!Array.isArray(joints)) return [];
|
|
55007
|
+
const counts = /* @__PURE__ */ new Map();
|
|
55008
|
+
for (const j of joints) {
|
|
55009
|
+
const id = j && typeof j === "object" ? j.id : void 0;
|
|
55010
|
+
if (typeof id !== "string" || !id) continue;
|
|
55011
|
+
counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
55012
|
+
}
|
|
55013
|
+
return [...counts].filter(([, n]) => n > 1).map(([id, n]) => ({
|
|
55014
|
+
path: "$.joints",
|
|
55015
|
+
message: `joint id "${id}" occurs ${n} times; a connection part's id is derived from it, so duplicates collide in the built scene`
|
|
55016
|
+
}));
|
|
55017
|
+
}
|
|
55003
55018
|
function validateSteelTakeoff(doc) {
|
|
55004
|
-
|
|
55019
|
+
const base = validate(doc, loadSteelTakeoffSchema());
|
|
55020
|
+
const dupes = duplicateJointIds(doc);
|
|
55021
|
+
if (!dupes.length) return base;
|
|
55022
|
+
return { valid: false, errors: [...dupes, ...base.errors] };
|
|
55005
55023
|
}
|
|
55006
55024
|
function validateDrawingVector(doc) {
|
|
55007
55025
|
return validate(doc, loadDrawingVectorSchema());
|
|
@@ -62423,6 +62441,42 @@ function planBlockerSummary(candidate, cap = 8) {
|
|
|
62423
62441
|
return `plan-uneditable:${code} on ${sheets.length === 1 ? "sheet" : "sheets"} ${shown}${more}`;
|
|
62424
62442
|
});
|
|
62425
62443
|
}
|
|
62444
|
+
function blockingIssueDetails(report, cap = 8) {
|
|
62445
|
+
const byLine = /* @__PURE__ */ new Map();
|
|
62446
|
+
const order = [];
|
|
62447
|
+
for (const issue of report.issues) {
|
|
62448
|
+
if (issue.severity !== "block") continue;
|
|
62449
|
+
const sheet = typeof issue.sheet === "string" && issue.sheet.trim() ? issue.sheet.trim() : null;
|
|
62450
|
+
const path = typeof issue.path === "string" && issue.path.trim() ? issue.path.trim() : null;
|
|
62451
|
+
const parts = [sheet ? `sheet ${sheet}` : null, path].filter(Boolean);
|
|
62452
|
+
const at = parts.length ? ` [${parts.join(" \xB7 ")}]` : "";
|
|
62453
|
+
const line = issue.message ? `${issue.code}${at}: ${issue.message}` : `${issue.code}${at} (no detail available)`;
|
|
62454
|
+
const row = byLine.get(line);
|
|
62455
|
+
if (row) {
|
|
62456
|
+
row.count += 1;
|
|
62457
|
+
continue;
|
|
62458
|
+
}
|
|
62459
|
+
byLine.set(line, { code: issue.code, line, count: 1 });
|
|
62460
|
+
order.push(line);
|
|
62461
|
+
}
|
|
62462
|
+
const rows2 = order.map((line) => byLine.get(line));
|
|
62463
|
+
const firstPerCode = /* @__PURE__ */ new Set();
|
|
62464
|
+
const ordered = [];
|
|
62465
|
+
const rest = [];
|
|
62466
|
+
for (const row of rows2) {
|
|
62467
|
+
if (firstPerCode.has(row.code)) {
|
|
62468
|
+
rest.push(row);
|
|
62469
|
+
continue;
|
|
62470
|
+
}
|
|
62471
|
+
firstPerCode.add(row.code);
|
|
62472
|
+
ordered.push(row);
|
|
62473
|
+
}
|
|
62474
|
+
ordered.push(...rest);
|
|
62475
|
+
const render = (row) => row.count > 1 ? `${row.line} (\xD7${row.count})` : row.line;
|
|
62476
|
+
if (ordered.length <= cap) return ordered.map(render);
|
|
62477
|
+
const cut = ordered.slice(cap).reduce((n, row) => n + row.count, 0);
|
|
62478
|
+
return [...ordered.slice(0, cap).map(render), `and ${cut} more blocking issue(s)`];
|
|
62479
|
+
}
|
|
62426
62480
|
function migrationBlockingCodes(report, candidate) {
|
|
62427
62481
|
const projectionCodes = planBlockers(candidate).map((b) => `plan-uneditable:${b.code}`);
|
|
62428
62482
|
return [.../* @__PURE__ */ new Set(
|
|
@@ -62478,12 +62532,24 @@ function v1CarriesAuthoredModel(doc) {
|
|
|
62478
62532
|
// contract-transaction.ts
|
|
62479
62533
|
var ContractTransactionError = class extends Error {
|
|
62480
62534
|
code;
|
|
62481
|
-
|
|
62535
|
+
/**
|
|
62536
|
+
* The UNCAPPED evidence behind this refusal, for the log — never for the response body.
|
|
62537
|
+
*
|
|
62538
|
+
* `message` is capped so a human can read it, and until this existed the capped copy was the ONLY
|
|
62539
|
+
* surviving record: the full report is a local in `runInitialReadToV2`, destroyed by the throw, and
|
|
62540
|
+
* the route logs nothing. A support question of the form "why did my read fail" then had no
|
|
62541
|
+
* server-side artefact to consult at all — no log line, no journal (the journal is written after the
|
|
62542
|
+
* refusal), nothing but an HTTP body the user may not have kept.
|
|
62543
|
+
*/
|
|
62544
|
+
details;
|
|
62545
|
+
constructor(message, code = "contract-transaction-failed", details) {
|
|
62482
62546
|
super(message);
|
|
62483
62547
|
this.name = "ContractTransactionError";
|
|
62484
62548
|
this.code = code;
|
|
62549
|
+
if (details !== void 0) this.details = details;
|
|
62485
62550
|
}
|
|
62486
62551
|
};
|
|
62552
|
+
var DETAIL_LOG_CAP = 200;
|
|
62487
62553
|
function contractAuthorityFor(appId) {
|
|
62488
62554
|
try {
|
|
62489
62555
|
return resolveContractAuthorityId(appId);
|
|
@@ -62764,10 +62830,32 @@ async function runInitialReadToV2(opts) {
|
|
|
62764
62830
|
const codes = migrationBlockingCodes(report, candidate);
|
|
62765
62831
|
if (!candidate || codes.length) {
|
|
62766
62832
|
const where = planBlockerSummary(candidate);
|
|
62767
|
-
const
|
|
62833
|
+
const why = blockingIssueDetails(report);
|
|
62834
|
+
const items = [...where, ...why];
|
|
62835
|
+
const blocking = report.issues.filter((issue) => issue.severity === "block");
|
|
62836
|
+
if (items.length === 0) {
|
|
62837
|
+
throw new ContractTransactionError(
|
|
62838
|
+
"the migration refused this read but produced no blocking issue and no unprojectable plan, so the refusal cannot say why \u2014 that is a bug in previewMigration, not a problem with the drawing set",
|
|
62839
|
+
"v1-staging-exit-indeterminate",
|
|
62840
|
+
{ codes, issueCodes: report.issues.map((issue) => `${issue.severity}:${issue.code}`), candidate: candidate !== null }
|
|
62841
|
+
);
|
|
62842
|
+
}
|
|
62768
62843
|
throw new ContractTransactionError(
|
|
62769
|
-
`v1 reader staging must end because this fresh read cannot become ${STEEL_V2}:
|
|
62770
|
-
|
|
62844
|
+
`v1 reader staging must end because this fresh read cannot become ${STEEL_V2}:
|
|
62845
|
+
${items.map((item) => ` \u2022 ${item}`).join("\n")}`,
|
|
62846
|
+
"v1-staging-exit",
|
|
62847
|
+
{
|
|
62848
|
+
// CAPPED, with the true total beside it. `member-geometry-unusable` emits one issue per member,
|
|
62849
|
+
// bounded only by the v1's member count — 20,000 of them serialise to a 3.1 MB single log line.
|
|
62850
|
+
// Truncation in the log is stated the same way it is in the message, never implied.
|
|
62851
|
+
blocking: blocking.slice(0, DETAIL_LOG_CAP),
|
|
62852
|
+
totalBlocking: blocking.length,
|
|
62853
|
+
// PREFIXED, so support greps ONE spelling. `planBlockers` returns the raw
|
|
62854
|
+
// `registration-incomplete` while both the message and `migrationBlockingCodes` say
|
|
62855
|
+
// `plan-uneditable:registration-incomplete`; leaving the raw form here would reintroduce, in
|
|
62856
|
+
// the artefact, the "one reason, two spellings" defect the message half already fixed.
|
|
62857
|
+
planBlockers: planBlockers(candidate).map((b) => ({ ...b, code: `plan-uneditable:${b.code}` }))
|
|
62858
|
+
}
|
|
62771
62859
|
);
|
|
62772
62860
|
}
|
|
62773
62861
|
const uuid = getProject(projectId)?.uuid ?? null;
|
|
@@ -65044,6 +65132,22 @@ function cutToBooleanCut(part) {
|
|
|
65044
65132
|
}
|
|
65045
65133
|
return { id: part.id, kind: "boolean-cut", targetId: part.member, tool: box };
|
|
65046
65134
|
}
|
|
65135
|
+
function connectionsFromParts(parts) {
|
|
65136
|
+
const byId = /* @__PURE__ */ new Map();
|
|
65137
|
+
const order = [];
|
|
65138
|
+
for (const p of parts ?? []) {
|
|
65139
|
+
if (!p || !p.conn) continue;
|
|
65140
|
+
let c = byId.get(p.conn);
|
|
65141
|
+
if (!c) {
|
|
65142
|
+
c = { id: p.conn, kind: p.connKind, memberIds: [], childIds: [] };
|
|
65143
|
+
byId.set(p.conn, c);
|
|
65144
|
+
order.push(p.conn);
|
|
65145
|
+
}
|
|
65146
|
+
if (p.id) c.childIds.push(p.id);
|
|
65147
|
+
if (p.kind === "cut" && p.member && !c.memberIds.includes(p.member)) c.memberIds.push(p.member);
|
|
65148
|
+
}
|
|
65149
|
+
return order.map((id) => byId.get(id));
|
|
65150
|
+
}
|
|
65047
65151
|
var GROUPS = {
|
|
65048
65152
|
"base-plate": { key: "base-plate", label: "Base plates", color: "#6b7a8d" },
|
|
65049
65153
|
// darkest plate grey
|
|
@@ -66016,6 +66120,63 @@ function expandJoints(joints, memberGeo) {
|
|
|
66016
66120
|
return { elements, operations, viewOperations, memberTrims, groups, skipped, diagnostics };
|
|
66017
66121
|
}
|
|
66018
66122
|
|
|
66123
|
+
// steel-part-coverage.ts
|
|
66124
|
+
function coverageOk(c) {
|
|
66125
|
+
return c.fail.neverBuilt.length === 0 && c.fail.fused.length === 0 && c.fail.duplicatePartIds.length === 0;
|
|
66126
|
+
}
|
|
66127
|
+
var specifiedId = (j, i) => j && j.id ? j.id : `joint#${i}`;
|
|
66128
|
+
function partCoverage(joints, built) {
|
|
66129
|
+
const rows2 = joints ?? [];
|
|
66130
|
+
const elements = built.elements ?? [];
|
|
66131
|
+
const skipped = new Set(built.skippedJointIds ?? []);
|
|
66132
|
+
const claims = /* @__PURE__ */ new Map();
|
|
66133
|
+
const order = [];
|
|
66134
|
+
rows2.forEach((j, i) => {
|
|
66135
|
+
const id = specifiedId(j, i);
|
|
66136
|
+
if (!claims.has(id)) order.push(id);
|
|
66137
|
+
claims.set(id, (claims.get(id) ?? 0) + 1);
|
|
66138
|
+
});
|
|
66139
|
+
const builtIds = new Set(connectionsFromParts(elements).map((c) => c.id));
|
|
66140
|
+
const neverBuilt = order.filter((id) => !builtIds.has(id) && !skipped.has(id));
|
|
66141
|
+
const fused = order.filter((id) => (claims.get(id) ?? 0) > 1 && builtIds.has(id));
|
|
66142
|
+
const orphanedParts = [];
|
|
66143
|
+
const unattributedParts = [];
|
|
66144
|
+
for (const p of elements) {
|
|
66145
|
+
if (!p) continue;
|
|
66146
|
+
if (!p.conn) {
|
|
66147
|
+
unattributedParts.push(p.id || "<anonymous>");
|
|
66148
|
+
continue;
|
|
66149
|
+
}
|
|
66150
|
+
if (!claims.has(p.conn)) orphanedParts.push({ partId: p.id ?? null, conn: p.conn });
|
|
66151
|
+
}
|
|
66152
|
+
const seen = /* @__PURE__ */ new Set();
|
|
66153
|
+
const dupes = /* @__PURE__ */ new Set();
|
|
66154
|
+
for (const p of elements) {
|
|
66155
|
+
const id = p?.id;
|
|
66156
|
+
if (!id) continue;
|
|
66157
|
+
if (seen.has(id)) dupes.add(id);
|
|
66158
|
+
seen.add(id);
|
|
66159
|
+
}
|
|
66160
|
+
return {
|
|
66161
|
+
specified: rows2.length,
|
|
66162
|
+
builtOfSpecified: order.filter((id) => builtIds.has(id)).length,
|
|
66163
|
+
fail: { neverBuilt, fused, duplicatePartIds: [...dupes] },
|
|
66164
|
+
warn: { orphanedParts, unattributedParts }
|
|
66165
|
+
};
|
|
66166
|
+
}
|
|
66167
|
+
function describeCoverage(c) {
|
|
66168
|
+
const fails = [];
|
|
66169
|
+
if (c.fail.neverBuilt.length) fails.push(`${c.fail.neverBuilt.length} specified but never built (${c.fail.neverBuilt.join(", ")})`);
|
|
66170
|
+
if (c.fail.fused.length) fails.push(`${c.fail.fused.length} fused onto one connection (${c.fail.fused.join(", ")})`);
|
|
66171
|
+
if (c.fail.duplicatePartIds.length) fails.push(`${c.fail.duplicatePartIds.length} duplicate part id(s)`);
|
|
66172
|
+
const warns = [];
|
|
66173
|
+
if (c.warn.orphanedParts.length) warns.push(`${c.warn.orphanedParts.length} part(s) name a connection that was never specified`);
|
|
66174
|
+
if (c.warn.unattributedParts.length) warns.push(`${c.warn.unattributedParts.length} part(s) belong to no connection at all`);
|
|
66175
|
+
const head = coverageOk(c) ? c.specified === 0 ? "coverage: no connections specified \u2014 nothing to reconcile" : `coverage ok \u2014 ${c.builtOfSpecified}/${c.specified} specified connection(s) built` : `coverage FAILED \u2014 ${fails.join("; ")}`;
|
|
66176
|
+
const warned = warns.length ? `${head} (warning: ${warns.join("; ")})` : head;
|
|
66177
|
+
return `${warned}. Proves what was built matches what was specified, never that enough was specified.`;
|
|
66178
|
+
}
|
|
66179
|
+
|
|
66019
66180
|
// export-identity.ts
|
|
66020
66181
|
var import_node_crypto20 = require("node:crypto");
|
|
66021
66182
|
function deriveExportSourceId(kind, ownerId, installation = installId()) {
|
|
@@ -67562,6 +67723,8 @@ function contractToScene(contractInput) {
|
|
|
67562
67723
|
color: pickColor(profile, paletteRank.indexOf(profile), contract)
|
|
67563
67724
|
}));
|
|
67564
67725
|
const joints = expandJoints(contract.joints, memberGeo);
|
|
67726
|
+
const coverage = partCoverage(contract.joints, { elements: joints.elements, skippedJointIds: joints.skipped });
|
|
67727
|
+
if (!coverageOk(coverage)) console.warn(`[steel] ${describeCoverage(coverage)}`);
|
|
67565
67728
|
applyBeamClearance(elements, beamClears, refusedJointIds(contract.joints, joints.skipped));
|
|
67566
67729
|
for (const id of applyMemberTrims(elements, joints.memberTrims)) skipped.push(`trim:${id}`);
|
|
67567
67730
|
for (const part of joints.elements) {
|
|
@@ -67585,7 +67748,8 @@ function contractToScene(contractInput) {
|
|
|
67585
67748
|
scene: { meta: { name: contract.title || "Steel Model", units: "mm", up: "z" }, groups, elements, ...weldOperations.length ? { operations: weldOperations } : {} },
|
|
67586
67749
|
skipped,
|
|
67587
67750
|
operations: joints.operations,
|
|
67588
|
-
diagnostics: joints.diagnostics
|
|
67751
|
+
diagnostics: joints.diagnostics,
|
|
67752
|
+
coverage
|
|
67589
67753
|
};
|
|
67590
67754
|
}
|
|
67591
67755
|
var SceneContractError = class extends Error {
|
|
@@ -67857,7 +68021,7 @@ function contractToAwareScene(contractInput, sourceId) {
|
|
|
67857
68021
|
referenceSystems: grids.referenceSystems
|
|
67858
68022
|
};
|
|
67859
68023
|
scene.meta.sceneHash = sceneHash(scene);
|
|
67860
|
-
return { scene, skipped: legacy.skipped, producerUnsupported };
|
|
68024
|
+
return { scene, skipped: legacy.skipped, producerUnsupported, coverage: legacy.coverage };
|
|
67861
68025
|
}
|
|
67862
68026
|
function sceneFromModel(view) {
|
|
67863
68027
|
const blocked = membersBlockingExport(view.doc);
|
|
@@ -67952,6 +68116,8 @@ function sceneFromModel(view) {
|
|
|
67952
68116
|
color: pickColor(profile, paletteRank.indexOf(profile), view.doc)
|
|
67953
68117
|
}));
|
|
67954
68118
|
const joints = expandJoints(view.doc.joints, memberGeo);
|
|
68119
|
+
const coverage = partCoverage(view.doc.joints, { elements: joints.elements, skippedJointIds: joints.skipped });
|
|
68120
|
+
if (!coverageOk(coverage)) console.warn(`[steel] ${describeCoverage(coverage)}`);
|
|
67955
68121
|
applyBeamClearance(elements, beamClears, refusedJointIds(view.doc.joints, joints.skipped));
|
|
67956
68122
|
for (const id of applyMemberTrims(elements, joints.memberTrims)) skipped.push(`trim:${id}`);
|
|
67957
68123
|
for (const part of joints.elements) elements.push(part);
|
|
@@ -67963,7 +68129,8 @@ function sceneFromModel(view) {
|
|
|
67963
68129
|
scene: { meta: { name: "Steel Model", units: "mm", up: "z" }, groups, elements },
|
|
67964
68130
|
skipped,
|
|
67965
68131
|
operations: joints.operations,
|
|
67966
|
-
diagnostics: joints.diagnostics
|
|
68132
|
+
diagnostics: joints.diagnostics,
|
|
68133
|
+
coverage
|
|
67967
68134
|
};
|
|
67968
68135
|
}
|
|
67969
68136
|
function modelGridRecords(grid) {
|
|
@@ -68099,7 +68266,7 @@ function awareSceneFromModel(contractInput, sourceId) {
|
|
|
68099
68266
|
};
|
|
68100
68267
|
assertExportIdentityNamespace(scene, producerUnsupported);
|
|
68101
68268
|
scene.meta.sceneHash = sceneHash(scene);
|
|
68102
|
-
return { scene, skipped: legacy.skipped, producerUnsupported };
|
|
68269
|
+
return { scene, skipped: legacy.skipped, producerUnsupported, coverage: legacy.coverage };
|
|
68103
68270
|
}
|
|
68104
68271
|
|
|
68105
68272
|
// ../web/steel-detail-refs.js
|
|
@@ -68757,6 +68924,17 @@ function registerRevisionRoutes(app) {
|
|
|
68757
68924
|
return { ok: true, version: version2, contractType: STEEL_V2 };
|
|
68758
68925
|
} catch (error) {
|
|
68759
68926
|
if (error instanceof ContractTransactionError) {
|
|
68927
|
+
const expectedRace = error.code === "contract-changed" || error.code === "history-already-exists";
|
|
68928
|
+
req.log[expectedRace ? "warn" : "error"](
|
|
68929
|
+
{
|
|
68930
|
+
projectId: project.id,
|
|
68931
|
+
requestId: request.id,
|
|
68932
|
+
code: error.code,
|
|
68933
|
+
reason: error.message,
|
|
68934
|
+
...error.details === void 0 ? {} : { details: error.details }
|
|
68935
|
+
},
|
|
68936
|
+
`initial read refused: ${error.code}`
|
|
68937
|
+
);
|
|
68760
68938
|
return reply.status(400).send({ ok: false, error: error.message, code: error.code });
|
|
68761
68939
|
}
|
|
68762
68940
|
throw error;
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"additionalProperties": true,
|
|
313
313
|
"description": "A placed connection the connection engine expands into real 3D parts. A parametric RECIPE kind (base-plate, shear-plate) derives all geometry from its `params` + the live member positions, so it moves/re-solves with its members. A 'custom' kind is an imported connection (read from IFC via AWARE's connection-reader) that carries its own opaque tessellated `geometry` and a `place` point — move / replace only, no per-dimension edit. Distinct from the `connections[]` library (vendor-neutral type/detail/targets identities a joint can cite). v1 kinds: base-plate, shear-plate, custom.",
|
|
314
314
|
"properties": {
|
|
315
|
-
"id": { "type": "string", "description": "Stable joint id, e.g. j-bp-1 / sp-b3-e0 / cx-<id>." },
|
|
315
|
+
"id": { "type": "string", "minLength": 1, "description": "Stable joint id, e.g. j-bp-1 / sp-b3-e0 / cx-<id>. NON-EMPTY, matching steel.model/v2: every connection part's scene id is derived as `${joint.id}:…`, so a blank id yields parts named `:plate` / `:rod0` and the joint is recorded as the positional `joint#<i>` instead — a specified connection that reaches neither the model, IFC nor Tekla, while the inventory gate still reports ok. `required` alone permitted \"\"." },
|
|
316
316
|
"kind": { "type": "string", "description": "Connection kind: base-plate, shear-plate (parametric recipes the engine expands), or custom (imported IFC geometry). end-plate / cap-plate / … follow." },
|
|
317
317
|
"main": { "type": "string", "description": "Id of the host member this joint hangs off. For a base-plate this is the column; for a shear-plate this is the SUPPORTED BEAM (the joint sits at one of the beam's ends — see `at`). Required for the recipe kinds; optional for 'custom' (an imported connection carries its own geometry rather than deriving it from a member)." },
|
|
318
318
|
"secondaries": { "type": "array", "items": { "type": "string" }, "description": "Ids of the other members this joint binds — e.g. the SUPPORT a shear-plate frames into. Optional and inferred by geometry; the shear-plate engine does not require it (the fin plate is placed off the beam end + beam axis). Empty for a base-plate." },
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: floless-app-queue
|
|
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).
|
|
3
|
+
description: This skill should be used when the user has MULTIPLE floless.app requests queued from the Dashboard and wants to see them and choose which to process, rather than the AI just picking up the oldest one. Use it when the user says things like "what's in my floless queue", "list my queued floless requests", "show me the pending requests and let me pick", "I queued a few tweaks — which should I apply?", "let me choose what to process", or "pick from the floless queue". It lists the pending requests from GET /api/requests in plain language (type, which app/node/project, the instruction), asks the user which one(s) to apply, then hands each chosen request to the owning skill (floless-app-workflows / -tweak-contract / -ui / -rebake / -onboarding / -new-workflow / -steel-takeoff / -vectorize / -knowledge) which applies it and clears it. It is the interactive picker that sits in front of floless-app-bridge (which is the actual pull-apply-clear engine).
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.
|
|
5
|
+
version: 0.2.0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# floless.app queue picker
|
|
9
9
|
|
|
10
10
|
floless.app is the **thin web UI**; the **terminal AI (you) is the brain**. The UI cannot edit
|
|
11
|
-
`.flo` files — it **queues requests** (Tweak / use-template / customize-UI / rebake / edit-contract
|
|
12
|
-
|
|
11
|
+
`.flo` files — it **queues requests** (Tweak / use-template / customize-UI / rebake / edit-contract /
|
|
12
|
+
walk-me-through / new-workflow / read-this-drawing / organize-or-adjust-the-knowledge-base) to a
|
|
13
|
+
local API. The **`floless-app-bridge`** skill pulls those and applies them, but it processes
|
|
13
14
|
the queue **oldest-first with no choice step**. This skill adds the missing affordance: **list the
|
|
14
15
|
whole queue in plain English and let the user pick which one(s) to process** — then route each pick
|
|
15
16
|
through the normal bridge flow.
|
|
@@ -27,14 +28,22 @@ curl -s http://127.0.0.1:4317/api/health # → {"ok":true,...}; if down, user
|
|
|
27
28
|
curl -s http://127.0.0.1:4317/api/requests # → { "ok": true, "requests": [ ... ] }
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
`requests` is
|
|
31
|
+
`requests` is the whole queue, oldest first. If it's empty, tell the user the queue is
|
|
31
32
|
empty and stop — there is nothing to pick.
|
|
32
33
|
|
|
34
|
+
**Read each row's `status`.** The route applies no filter, so a non-`pending` row comes back with the
|
|
35
|
+
rest and is not pickable here: a `failed` revision-read is the UI's error card (the user re-attaches the
|
|
36
|
+
set to retry). `staged` is the same rule for the steel.model/v2 read described in §4 — a finished read
|
|
37
|
+
waiting on the user's review in the app; nothing shipped sets it yet, so expect it rather than look for
|
|
38
|
+
it. Listing them is fine; offering them as work is not.
|
|
39
|
+
|
|
33
40
|
## 2. Present the queue in plain language
|
|
34
41
|
|
|
35
42
|
Render a **numbered list** the user can choose from. For each request show the index, a short id
|
|
36
|
-
(first 8 chars), and a one-line plain-English summary by `type` — never raw JSON.
|
|
37
|
-
|
|
43
|
+
(first 8 chars), and a one-line plain-English summary by `type` — never raw JSON. (`floless-app-bridge`
|
|
44
|
+
documents the field shapes for `tweak` and `use-template`; for the rest, read the `FlolessRequest`
|
|
45
|
+
interface in `server/floless-store.ts` — its comments say which type each field belongs to.) The types
|
|
46
|
+
map to:
|
|
38
47
|
|
|
39
48
|
| `type` | Plain-English line | Owning skill |
|
|
40
49
|
|---|---|---|
|
|
@@ -43,6 +52,16 @@ documented in `floless-app-bridge`; the five types map to:
|
|
|
43
52
|
| `tweak-contract` | "Edit the Steel Model contract for **`<appId>`** — *<instruction>* (+N screenshot(s))" | `floless-app-tweak-contract` |
|
|
44
53
|
| `ui-customize` | "Customize the Dashboard (optionally `panel <panelId>`) — *<instruction>*" | `floless-app-ui` |
|
|
45
54
|
| `rebake` | "Re-read the **<inputName>** drawing (<sourceName>) in **`<appId>`** — *<instruction>*" | `floless-app-rebake` |
|
|
55
|
+
| `guide` | "Walk me through **`<appId>`** — what it does and how to run it. **Read-only**, it changes nothing" | `floless-app-onboarding` |
|
|
56
|
+
| `new-workflow` | "Build a brand-new workflow from scratch" (workspace-level — carries no `appId`, none exists yet) | `floless-app-new-workflow` |
|
|
57
|
+
| `revision-read` | "Read the attached drawing(s) into project **`<project>`** as a new version (+N file(s))" — the **initial** read when `baseVersion` is absent or ≤ 0, otherwise a **re-read** of a revised set | `floless-app-steel-takeoff` — but `floless-app-vectorize` when the app's lineage root (`appTemplateId`, falling back to `appId`) is `vectorize` |
|
|
58
|
+
| `knowledge-organize` | "Organize the Project Knowledge Base for project **`<project>`**" | `floless-app-knowledge` |
|
|
59
|
+
| `knowledge-adjust` | "Reshape the Project Knowledge Base for project **`<project>`** — *<instruction>*" | `floless-app-knowledge` |
|
|
60
|
+
|
|
61
|
+
The type union itself is `FlolessRequest` in `server/floless-store.ts` — a type in the union with no row
|
|
62
|
+
above means this table is stale, and the union is right. The routing is `REQUEST_SKILL` in
|
|
63
|
+
`web/aware.js`, with the `revision-read` app-aware override right below it; it now covers every member
|
|
64
|
+
of the union, so if it and this table disagree, the code is right and this table is stale — say so.
|
|
46
65
|
|
|
47
66
|
Note the count of screenshots for requests that carry `snapshots`. If a request has an unfamiliar
|
|
48
67
|
`type`, show it verbatim and flag it rather than guessing what it does.
|
|
@@ -56,7 +75,7 @@ touching any `.flo`, contract, or panel.
|
|
|
56
75
|
## 4. Process each chosen request — route to the owning skill
|
|
57
76
|
|
|
58
77
|
For each pick, hand it to the skill in the table above (the type→skill routing
|
|
59
|
-
`floless-app-bridge` uses for pasted markers, extended here to
|
|
78
|
+
`floless-app-bridge` uses for pasted markers, extended here to cover the whole union).
|
|
60
79
|
That skill does the real work — read the app's
|
|
61
80
|
current `.flo`/contract/panel, apply the change, recompile if needed — **and clears the request**:
|
|
62
81
|
|
|
@@ -64,14 +83,36 @@ current `.flo`/contract/panel, apply the change, recompile if needed — **and c
|
|
|
64
83
|
curl -s -X DELETE http://127.0.0.1:4317/api/requests/<id> # the UI's "requests" badge updates live over SSE
|
|
65
84
|
```
|
|
66
85
|
|
|
86
|
+
**Two types are LIFECYCLE-OWNED — never `DELETE` them.** They are resolved by their own POST, so a
|
|
87
|
+
`DELETE` doesn't complete them, it breaks them:
|
|
88
|
+
|
|
89
|
+
| `type` | What resolves it | What a stray `DELETE` costs |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| `revision-read` | `POST /api/projects/<project>/revision-read` (that POST clears it), or `POST /api/projects/<project>/revision-requests/<id>/fail` when the set can't be read. A `steel.model/v2` project answers **202 and stages** the read instead — the request stays `staged` until the user confirms it in the app (`…/revision-read/confirm`, which is theirs to trigger, not yours), and that is not a failure. | the completion POST is refused **400** ("a valid queued revision-read requestId … is required") and the finished read is thrown away |
|
|
92
|
+
| `knowledge-organize` | `POST /api/projects/<project>/knowledge/requests/<id>/finish` (or `…/fail`) — after claiming the pass with `…/start` | the lock you took at `…/start` is only reclaimable after `LOCK_STALE_MS` (**10 minutes**) — and the leftover `organize.json`, which only finish/fail removes, leaves the Knowledge pane showing "Organizing…" with Organize **disabled indefinitely**, so the user cannot even re-queue |
|
|
93
|
+
|
|
94
|
+
Every other type is applied-then-`DELETE`d as above. This is the same per-type rule the UI encodes in
|
|
95
|
+
`markedInstruction()`'s `clears` branch (`web/aware.js`) — check there if a type's ending is unclear.
|
|
96
|
+
|
|
67
97
|
Process the picks in the order the user gave (or oldest-first if they said "all"). Re-run the
|
|
68
98
|
owning skill's normal verification before reporting each one done.
|
|
69
99
|
|
|
70
100
|
## 5. The un-picked rest
|
|
71
101
|
|
|
72
102
|
Leave any request the user did **not** pick in the queue — do nothing to it. If the user wants to
|
|
73
|
-
**discard** one without processing, `DELETE /api/requests/<id
|
|
74
|
-
the
|
|
103
|
+
**discard** one without processing, `DELETE /api/requests/<id>` — that is a genuine discard, and it's
|
|
104
|
+
what the ✕ in the Requests panel does. Two carve-outs:
|
|
105
|
+
|
|
106
|
+
- **`knowledge-organize` is never discarded by `DELETE`.** The UI hides its ✕ for exactly this reason.
|
|
107
|
+
A pass you already `…/start`ed is released with its `…/fail` POST. One that was only ever *queued*
|
|
108
|
+
has a purpose-built cancel: `DELETE /api/projects/<project>/knowledge/requests/<id>`, which refuses
|
|
109
|
+
with **409** the moment an organize is actually in flight — that guard is the whole difference from
|
|
110
|
+
the generic verb.
|
|
111
|
+
- **`DELETE /api/requests` ("Clear all") is a blunt server-side bulk delete** that takes a queued
|
|
112
|
+
`knowledge-organize` with it. The UI avoids that by deleting the others one id at a time and keeping
|
|
113
|
+
every organize; do the same rather than reaching for the bulk verb while one is pending.
|
|
114
|
+
|
|
115
|
+
Only delete on an explicit ask.
|
|
75
116
|
|
|
76
117
|
When you're done, tell the user what was processed and **what is still queued**, so the picker can
|
|
77
118
|
be re-run for the remainder.
|
|
@@ -82,7 +123,10 @@ be re-run for the remainder.
|
|
|
82
123
|
triages the queue and delegates each pick to the owning authoring skill.
|
|
83
124
|
- **Choose, don't bulk-apply.** Listing is non-destructive; only act on the user's explicit picks.
|
|
84
125
|
Never silently process the whole queue without an explicit "all".
|
|
85
|
-
- **Always
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
126
|
+
- **Always resolve a processed request** so the UI's count reflects reality — by `DELETE` for most
|
|
127
|
+
types, by the lifecycle POST for `revision-read` and `knowledge-organize` (§4). Only `DELETE` an
|
|
128
|
+
*un*-processed request when the user asks to discard it.
|
|
129
|
+
- **Don't invent request types** — the real set is the `FlolessRequest` union in
|
|
130
|
+
`server/floless-store.ts`, listed in §2. Every type in that table is legitimate and shipped;
|
|
131
|
+
surface anything *outside* it rather than guessing. This is the picker; **`floless-app-bridge`** is
|
|
132
|
+
the puller/applier it sits in front of.
|
|
@@ -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 steel.model/v2 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. The reader composes steel.takeoff/v1 only as internal first-read staging; floless.app converts it transactionally so a new project is born steel.model/v2. 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.7.0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Steel Model — guide a steel drawing set into an editable model
|
|
@@ -288,6 +288,35 @@ it lands on. Member ends are usually placed at WORK POINTS, which sit on the sup
|
|
|
288
288
|
inside it — so a member must be trimmed back to the support's actual face plus its erection gap, and that
|
|
289
289
|
distance grows with the skew of the crossing. Verify the trim, not just the joint.
|
|
290
290
|
|
|
291
|
+
**Count what you built against what you specified.** Every check above scores a connection that *exists*.
|
|
292
|
+
None of them can see the two failures that leave nothing behind to measure: a connection you specified and
|
|
293
|
+
never built, and two connections that collapsed into one part. Both survive every dimensional check by
|
|
294
|
+
default — the first because there is no geometry to fault, the second because a fused part measures as one
|
|
295
|
+
correct-looking body. Both models open, render and export without complaint.
|
|
296
|
+
|
|
297
|
+
So reconcile the inventory each time you build, and treat two of the four outcomes as failures:
|
|
298
|
+
|
|
299
|
+
- **FAIL — specified, never built.** Every row in `joints[]` — the PLACED connections, not the
|
|
300
|
+
`connections[]` library they cite — owns at least one part in the model. A row that produced nothing is
|
|
301
|
+
a detail you read, reported and priced, and did not deliver. (Judge the placed rows: a library row that
|
|
302
|
+
is referenced for spec and pricing but never placed owns no parts and is not a failure.)
|
|
303
|
+
- **FAIL — two specified, one built.** No two rows share a part. A pair of plates modelled as a single
|
|
304
|
+
body has the right total area and the right weight, and cannot be fabricated as drawn.
|
|
305
|
+
- **WARN — read, never specified.** A detail callout found on the drawings that never became a
|
|
306
|
+
`connections[]` row. Not necessarily wrong — you may have refused it under stage 7 — but it gets named,
|
|
307
|
+
never silently dropped.
|
|
308
|
+
- **WARN — built, unnamed.** A part belonging to no connection. Usually debris left by an earlier build;
|
|
309
|
+
occasionally the only evidence that a recipe is emitting geometry nobody asked for.
|
|
310
|
+
|
|
311
|
+
Decide what counts as ONE part once, and make the count and the model share that definition. If the two
|
|
312
|
+
disagree about where a connection ends, both are wrong — and the disagreement will read as a coverage
|
|
313
|
+
failure on a model that is actually fine, which is the fastest way to get the gate switched off.
|
|
314
|
+
|
|
315
|
+
**Say what this gate does not prove, every time you report it: it proves you built what you specified,
|
|
316
|
+
never that you specified enough.** It is the only check in this stage that scores the INVENTORY — every
|
|
317
|
+
other one scores the dimensions of a connection that is already there. An inventory missing half the
|
|
318
|
+
details on the sheet passes all of them, and passes this one too.
|
|
319
|
+
|
|
291
320
|
**Where this class of bug hides: nominal-vs-real section data.** A designation carries its thickness
|
|
292
321
|
(an angle's leg, a tube's wall) and that token is easy to drop on the way to geometry — leaving a guessed
|
|
293
322
|
or zero thickness behind, which silently misplaces everything that references it. If a placement depends
|
|
@@ -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.
|
|
5
|
+
version: 0.4.0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Handle a `tweak-contract` request (Slice 2 AI round-trip)
|
|
@@ -15,10 +15,24 @@ member as moment-frame") and optionally pastes screenshots, then clicks **Send**
|
|
|
15
15
|
a `tweak-contract` request in the reverse channel. You pick it up here, edit the contract
|
|
16
16
|
document, write it back, and the editor reloads it.
|
|
17
17
|
|
|
18
|
-
The contract is
|
|
19
|
-
|
|
20
|
-
server
|
|
21
|
-
|
|
18
|
+
The contract is the single source of truth — the editor is its view, and the exporters
|
|
19
|
+
(IFC/Tekla/viewer-3d) consume server-resolved export sources. A PUT writeback is schema-validated on
|
|
20
|
+
the server; a 400 means invalid — fix and retry.
|
|
21
|
+
|
|
22
|
+
**Two things about WHICH document you are editing. Get both wrong and you edit the wrong file.**
|
|
23
|
+
|
|
24
|
+
1. **The shape is not always `steel.takeoff/v1`.** A migrated project holds **`steel.model/v2`**, whose
|
|
25
|
+
members live in ONE root `members[]` array in world millimetres — it has no `plans[i].members[j]`,
|
|
26
|
+
so the v1 field map in §4 does not apply to it. **Read the document's own `type` field in step 2
|
|
27
|
+
and write back that SAME shape.** Never convert one into the other: this verb patches the document
|
|
28
|
+
it just read, and a shape change is refused. For v2 the field reference is
|
|
29
|
+
`schemas/steel.model.v2.schema.json`; for v1 it is `schemas/steel.takeoff.v1.schema.json`.
|
|
30
|
+
2. **The store is project-keyed when the request carries a `project`.** A workspace project's document
|
|
31
|
+
lives at `~/.floless/projects/<project>/contract.json` and is reached with
|
|
32
|
+
`?project=<project>` on both the GET and the PUT. Only a request with **no** `project` targets the
|
|
33
|
+
legacy app-keyed `~/.floless/contracts/<appId>.json`. Omit the query on a project request and you
|
|
34
|
+
read (and may CREATE) an app-scoped contract while the user's project document is never touched —
|
|
35
|
+
they will see no change and have no idea why.
|
|
22
36
|
|
|
23
37
|
> **Pasted a request?** If the user pastes a message with a `[floless-request type=tweak-contract id=…]`
|
|
24
38
|
> marker, that is a request **copied from the FloLess Dashboard**. Resolve it via
|
|
@@ -31,23 +45,41 @@ means invalid — fix and retry.
|
|
|
31
45
|
`type: "tweak-contract"`. It carries:
|
|
32
46
|
- `id` — the request id (used to DELETE it when done)
|
|
33
47
|
- `appId` — which app's contract to edit
|
|
48
|
+
- `project` — **present on a workspace request**; when it is there, every GET and PUT below takes
|
|
49
|
+
`?project=<project>`. Absent means the legacy app-keyed store. Never guess it.
|
|
34
50
|
- `instruction` — the user's plain-English ask
|
|
35
51
|
- `snapshots` — absolute paths to screenshot files saved under
|
|
36
52
|
`~/.floless/requests/<id>/` (PNG/JPEG/WebP). These are the key input — the user
|
|
37
53
|
pasted them to show you exactly which region or member they mean.
|
|
54
|
+
- `intent` + `target` — present only on an **insert-a-detail** request from the editor's detailing
|
|
55
|
+
flow. `intent` is `"create"` (place a new detail) or `"modify"` (change one already placed), and
|
|
56
|
+
`target` is `{ sheet, ids }` naming the sheet and the host member / placed-detail ids to act
|
|
57
|
+
against. They exist so you do not have to infer create-vs-edit from the prose — honour them.
|
|
38
58
|
|
|
39
59
|
The port is the same base URL the floless.app server is on (check `/api/health` or use
|
|
40
60
|
the port the skill context provides — typically 4317 for the installed app, 4318 for the
|
|
41
61
|
dev server).
|
|
42
62
|
|
|
43
|
-
2. **Read the current contract.** `GET http://localhost:<port>/api/contract/<appId>`
|
|
44
|
-
|
|
63
|
+
2. **Read the current contract.** `GET http://localhost:<port>/api/contract/<appId>` — **plus
|
|
64
|
+
`?project=<project>` when the request carries one** — returns the full JSON document. **Read its
|
|
65
|
+
`type` field**: `steel.takeoff/v1` or `steel.model/v2` decides which field map in step 4 applies,
|
|
66
|
+
and step 5 writes back that same shape. **Keep the `ETag` response header** — step 5 sends it
|
|
45
67
|
back so your write cannot silently overwrite someone else's.
|
|
46
|
-
You can also read
|
|
68
|
+
You can also read the file off disk (`~/.floless/projects/<project>/contract.json`, or
|
|
69
|
+
`~/.floless/contracts/<appId>.json` when there is no project), but then you have no
|
|
47
70
|
ETag and **the write in step 5 will be REFUSED (`428`)** — the server requires a precondition.
|
|
48
71
|
Use the HTTP read whenever you intend to write.
|
|
49
72
|
|
|
50
|
-
|
|
73
|
+
**If `type` is `steel.model/v2`**, the shapes below do NOT apply. Read
|
|
74
|
+
`schemas/steel.model.v2.schema.json` instead: members are one root `members[]` array in world
|
|
75
|
+
millimetres and ids are model-global rather than sheet-scoped. `from`/`to` are `{x, y, z}` — but
|
|
76
|
+
**`z` is a tagged union, not a bare number**: a known elevation is `z: { known: 3000 }` and one the
|
|
77
|
+
drawing never gave is `z: { unknown: true }`. The schema sets `additionalProperties: false`, so a
|
|
78
|
+
bare `z: 3000` is refused with a 400. Never substitute a default for an unknown elevation — a
|
|
79
|
+
fabricated elevation moves steel. Everything else in this loop (ETag, preconditions, preserve what
|
|
80
|
+
you are not changing, never auto-approve) is identical.
|
|
81
|
+
|
|
82
|
+
**If `type` is `steel.takeoff/v1`**, the schema is at `schemas/steel.takeoff.v1.schema.json` and the
|
|
51
83
|
field reference is `docs/superpowers/specs/2026-06-17-steel-takeoff-agent-guidance.md` §3.
|
|
52
84
|
Key shapes you'll edit:
|
|
53
85
|
- Top-level: `type` (const `"steel.takeoff/v1"`), `active`, `palette`, `weights{profile→plf}`,
|
|
@@ -66,7 +98,8 @@ means invalid — fix and retry.
|
|
|
66
98
|
beam") only resolves with the visual context ("this beam" = the one circled in red on the
|
|
67
99
|
screenshot).
|
|
68
100
|
|
|
69
|
-
4. **Produce the edit.** Modify the contract JSON to satisfy the instruction
|
|
101
|
+
4. **Produce the edit.** Modify the contract JSON to satisfy the instruction. The bullets below are
|
|
102
|
+
the **`steel.takeoff/v1`** field map; for `steel.model/v2` work from its own schema per step 2:
|
|
70
103
|
- Profile changes: update `members[j].profile`; if the new profile resolves in the AISC
|
|
71
104
|
table update `weights` too (plf from the AISC designation). Set `rfi: false` when you
|
|
72
105
|
assign a real AISC size; `rfi: true` for marks (`MF`, `BF`) or unknowns.
|
|
@@ -77,19 +110,22 @@ means invalid — fix and retry.
|
|
|
77
110
|
`tosDef: false` means the value came from the drawing, not the plan default.
|
|
78
111
|
- Connection notes / detail refs: update `ends[].note` or `ends[].detail` (e.g. `"5-S504"`).
|
|
79
112
|
- Flag adjustments: `mf: true` for moment-frame members; `rfi: true` for unresolved sizes.
|
|
80
|
-
- **Preserve everything you're not changing** —
|
|
113
|
+
- **Preserve everything you're not changing** — both shapes are a full-document writeback; partial
|
|
81
114
|
objects are not supported.
|
|
82
115
|
|
|
83
|
-
5. **Write it back.** `PUT http://localhost:<port>/api/contract/<appId>` with the
|
|
84
|
-
|
|
116
|
+
5. **Write it back.** `PUT http://localhost:<port>/api/contract/<appId>` — **with the same
|
|
117
|
+
`?project=<project>` you read with** — carrying the full updated document
|
|
118
|
+
(Content-Type: application/json) **and a precondition header**:
|
|
85
119
|
- **`If-Match: <the ETag from step 2>`** — the usual case, replacing a contract you read.
|
|
86
120
|
- **`If-None-Match: *`** — ONLY when the GET returned **no** ETag at all. That happens on an app
|
|
87
121
|
whose contract is still the baked example with no saved draft yet; it means "I believe this
|
|
88
122
|
store is empty" and is refused if a draft appeared meanwhile.
|
|
89
123
|
|
|
90
124
|
A PUT carrying neither is refused with **`428`** — the server never accepts a blind write.
|
|
91
|
-
- **400** — schema-invalid. Read the error
|
|
92
|
-
`schemas/steel.takeoff.v1.schema.json
|
|
125
|
+
- **400** — schema-invalid, or a refused shape transition. Read the error and fix the structure
|
|
126
|
+
against the schema for the `type` you read in step 2 (`schemas/steel.takeoff.v1.schema.json` or
|
|
127
|
+
`schemas/steel.model.v2.schema.json`), then retry. A `contract-transition-refused` means you
|
|
128
|
+
changed the document's shape — write back the shape you read.
|
|
93
129
|
- **412** — someone else (the user in the editor, another tool, a workflow run) wrote to this
|
|
94
130
|
contract after you read it. **Do NOT retry the same body**: that would destroy their change.
|
|
95
131
|
Re-read from step 2, re-apply your edit to the NEW document, and write again.
|
|
@@ -114,9 +150,10 @@ means invalid — fix and retry.
|
|
|
114
150
|
- **Preserve unedited data.** Coordinates, rasters (`raster_b64`), detail bubbles, sheet
|
|
115
151
|
previews — if you're not changing them, copy them through unchanged. Dropping fields silently
|
|
116
152
|
corrupts the contract.
|
|
117
|
-
- **
|
|
118
|
-
geometry (`wp`, `segments`) is
|
|
119
|
-
`tos` / `bos` / `elev_in`
|
|
153
|
+
- **Units differ by shape — check `type` before you trust a number.** In `steel.takeoff/v1` member
|
|
154
|
+
geometry (`wp`, `segments`) is display-space points (not feet, not native PDF coords) and
|
|
155
|
+
`tos` / `bos` / `elev_in` are decimal inches (`16.5` = 16½ inches). In `steel.model/v2` members are
|
|
156
|
+
world **millimetres**. Reading a v2 coordinate as if it were v1 display space moves steel.
|
|
120
157
|
- **Screenshots don't lie; instructions generalize.** If the screenshot shows a specific member
|
|
121
158
|
and the instruction says "this beam", resolve "this" from the visual, not a guess.
|
|
122
159
|
- **Never auto-approve.** Writing the contract back is the AI act. If the user asks what changed,
|
package/dist/web/aware.js
CHANGED
|
@@ -6750,9 +6750,14 @@
|
|
|
6750
6750
|
|
|
6751
6751
|
// ── reverse channel: record intent for the host AI, copy a paste-ready line ──
|
|
6752
6752
|
function instructionFor(req) {
|
|
6753
|
+
// `t.node` guarded, not assumed: a template saved by an older build (or hand-edited in
|
|
6754
|
+
// templates.json) can carry a name and no node, and reading `.agent` off undefined THREW out of
|
|
6755
|
+
// renderRequests' .map(), so `$list.innerHTML` was never assigned and loadRequests' `catch {}`
|
|
6756
|
+
// ate it — the chip kept counting requests over a list that had silently stopped rendering.
|
|
6753
6757
|
if (req.type === 'use-template' && req.template) {
|
|
6754
6758
|
const t = req.template;
|
|
6755
|
-
|
|
6759
|
+
const n = t.node || {};
|
|
6760
|
+
return `In floless app "${req.appId}", add a node from my saved template "${t.name}" (agent ${n.agent || n.kind || 'unspecified — read the template from GET /api/templates'}${n.command ? ' / ' + n.command : ''}, config ${JSON.stringify(n.config || {})}). Edit the .flo, then run \`aware app compile\`.`;
|
|
6756
6761
|
}
|
|
6757
6762
|
if (req.type === 'tweak') {
|
|
6758
6763
|
const base = `In floless app "${req.appId}", change only node "${req.nodeId}": ${req.instruction}. Edit just that node in the .flo, then run \`aware app compile\`.`;
|
|
@@ -6821,6 +6826,29 @@
|
|
|
6821
6826
|
}
|
|
6822
6827
|
return `In floless project "${req.project}" (app "${req.appId}"), a REVISED drawing set was attached — re-read it into the SAME project as a new version (do NOT create a new project). Follow the floless-app-steel-takeoff skill's mandatory two-phase gate. FIRST, GET /api/contract/${req.appId}?project=${req.project} to read the CURRENT contract, then do the deterministic PyMuPDF steel-filter pass only for the revised drawing set: identify the framing-plan sheets, enumerate drawing elements by layer/thickness/color into contract.filter.sheets/facets, preserve any compatible existing filter selections, send ONLY the pre-read blocks to PUT /api/projects/${req.project}/steel-prepass with { filter } and If-Match: <the ETag from the GET you just did> — never the whole contract, because this project already holds a model and a full PUT would replace its members without review. The verb takes filter, datum and per-sheet { grid, datum_at, datum_ref, control2_at, control2_ref, elevation_in } and refuses everything else by name. A write with no precondition is refused with 428, and If-Match must be the exact ETag — If-Match: * is refused, because this verb patches the document you read. On 412 re-GET, re-apply, and retry rather than repeating the same body. Then STOP and tell me to open Drawings → Steel Filter, review/narrow the steel facets, and Save. Do NOT read members, build the model, open 3D, or POST /revision-read until I explicitly come back after saving the filter. AFTER that saved-filter checkpoint, read members from the saved filter selection, compose the updated steel.takeoff/v1 contract, and PRESERVE each still-present member's id AND its sheet label (mint a NEW id only for a genuinely new member; drop the id of a member the revision deleted) so the version comparison matches members — do NOT renumber the whole model. ${post}${snaps}${note}`;
|
|
6823
6828
|
}
|
|
6829
|
+
// The steel-model editor's "Ask AI" box, and the SAME channel its "insert a detail" flow uses.
|
|
6830
|
+
// Deliberately does NOT name a contract shape: this channel serves both steel.takeoff/v1 and
|
|
6831
|
+
// steel.model/v2 projects, and the stored document's own `type` is the authoritative answer the
|
|
6832
|
+
// AI reads in the GET below. Naming a shape here would send a v2 project's edit at a v1 take-off
|
|
6833
|
+
// — the same failure `contractType` exists to prevent on revision-read, solved one rung cheaper
|
|
6834
|
+
// because this verb re-writes the document it just read rather than composing a new one.
|
|
6835
|
+
if (req.type === 'tweak-contract') {
|
|
6836
|
+
const where = req.project ? `?project=${req.project}` : '';
|
|
6837
|
+
const scope = req.project ? `floless project "${req.project}" (app "${req.appId}")` : `floless app "${req.appId}"`;
|
|
6838
|
+
// The insert flow carries a machine-readable intent + target so the AI creates a new detail
|
|
6839
|
+
// rather than editing a placed one (or vice versa) — absent on an ordinary Ask AI request.
|
|
6840
|
+
const detail = req.intent
|
|
6841
|
+
? `\nThis is an insert-a-detail request: intent "${req.intent}"${req.target && req.target.sheet ? ` on sheet "${req.target.sheet}"` : ''}${req.target && req.target.ids && req.target.ids.length ? `, target id(s) ${req.target.ids.join(', ')}` : ''}.`
|
|
6842
|
+
: '';
|
|
6843
|
+
const snaps = req.snapshots && req.snapshots.length
|
|
6844
|
+
? `\nScreenshot${req.snapshots.length > 1 ? 's' : ''} (read these — they show which member or region "this" means): ${req.snapshots.join(', ')}`
|
|
6845
|
+
: '';
|
|
6846
|
+
return `In ${scope}, edit the steel contract per the floless-app-tweak-contract skill: ${req.instruction || 'apply the requested change'}. ` +
|
|
6847
|
+
`GET /api/contract/${req.appId}${where} first and KEEP its ETag — the document's own \`type\` tells you which shape you are editing, and you write back that SAME shape. ` +
|
|
6848
|
+
`Apply the change, preserving every field you are not changing, then PUT the full document to /api/contract/${req.appId}${where} with If-Match: <that ETag> ` +
|
|
6849
|
+
`(If-None-Match: * only when the GET returned no ETag at all). A blind write is refused with 428; on 412 re-GET, re-apply your edit to the NEW document, and retry rather than repeating the same body. ` +
|
|
6850
|
+
`Writing a tweak is not approval — leave the approval gate to the user.${detail}${snaps}`;
|
|
6851
|
+
}
|
|
6824
6852
|
// The Knowledge step's Organize verb. The lifecycle is SERVER-owned: start claims the organize
|
|
6825
6853
|
// lock and mints the generation dir; finish publishes it and clears this request; fail releases
|
|
6826
6854
|
// the lock. Naming the exact project-scoped routes matters — /api/requests/<id> is NOT the
|
|
@@ -6849,6 +6877,7 @@
|
|
|
6849
6877
|
'use-template': 'floless-app-workflows',
|
|
6850
6878
|
tweak: 'floless-app-workflows',
|
|
6851
6879
|
'ui-customize': 'floless-app-ui',
|
|
6880
|
+
'tweak-contract': 'floless-app-tweak-contract',
|
|
6852
6881
|
rebake: 'floless-app-rebake',
|
|
6853
6882
|
'revision-read': 'floless-app-steel-takeoff',
|
|
6854
6883
|
// The guided-tour ask is picked up by onboarding; the instruction body names the
|
|
@@ -6893,9 +6922,36 @@
|
|
|
6893
6922
|
}
|
|
6894
6923
|
|
|
6895
6924
|
async function copyToClipboard(text) {
|
|
6925
|
+
// Nothing in this app ever legitimately copies an empty string — every caller passes a command
|
|
6926
|
+
// or an instruction body. An empty one means the caller has a hole (a request type with no
|
|
6927
|
+
// instructionFor() arm returns '' from markedInstruction), and writing it would still resolve,
|
|
6928
|
+
// so the user gets a green "Copied" over an empty clipboard. Report the failure instead.
|
|
6929
|
+
if (!text) return false;
|
|
6896
6930
|
try { await navigator.clipboard.writeText(text); return true; } catch { return false; }
|
|
6897
6931
|
}
|
|
6898
6932
|
|
|
6933
|
+
// Copy ONE request, distinguishing the two ways it can fail. `copyToClipboard`'s boolean cannot:
|
|
6934
|
+
// "the clipboard API refused" is worth retrying and is usually a permission, while "this type has
|
|
6935
|
+
// no instruction body" will never copy no matter how often it is clicked and needs a developer.
|
|
6936
|
+
// Reporting the second as the first sends the user to debug the wrong thing — and on the
|
|
6937
|
+
// request-help modal it leaves a Copy button offering a retry that cannot succeed.
|
|
6938
|
+
//
|
|
6939
|
+
// WHICH SURFACES MUST USE THIS: every one whose failure message BLAMES a cause — the row ⧉, the
|
|
6940
|
+
// request-help modal, the revision card. The queue-then-best-effort-copy callers (useTemplate,
|
|
6941
|
+
// tweakNode, requestGuide, requestNewWorkflow, panels.js's customize box) say only "queued, not
|
|
6942
|
+
// copied" and name no cause, so they cannot conflate anything and are deliberately left alone. Add
|
|
6943
|
+
// a new surface that names a cause and it belongs here.
|
|
6944
|
+
async function copyRequest(req) {
|
|
6945
|
+
const line = req ? markedInstruction(req) : '';
|
|
6946
|
+
if (!line) return 'empty';
|
|
6947
|
+
return (await copyToClipboard(line)) ? 'ok' : 'denied';
|
|
6948
|
+
}
|
|
6949
|
+
// Total by construction: a lookup miss here would spread `undefined` into showToast and throw inside
|
|
6950
|
+
// an async onclick — silence, which is worse than the wrong message this exists to replace.
|
|
6951
|
+
const copyFailToast = (res) => (res === 'empty'
|
|
6952
|
+
? ['Nothing to copy — this request has no instruction', 'err']
|
|
6953
|
+
: ['copy failed', 'err']);
|
|
6954
|
+
|
|
6899
6955
|
let requestHelpReq = null;
|
|
6900
6956
|
let requestHelpReturnFocus = null;
|
|
6901
6957
|
function closeRequestHelp({ restoreFocus = true } = {}) {
|
|
@@ -7025,13 +7081,19 @@
|
|
|
7025
7081
|
return;
|
|
7026
7082
|
}
|
|
7027
7083
|
$list.innerHTML = pendingRequests.map((r) => {
|
|
7028
|
-
const label = r.type === 'use-template' ? 'template' : r.type === 'ui-customize' ? 'dashboard' : r.type === 'rebake' ? 're-bake' : r.type === 'revision-read' ? 'revision' : r.type === 'guide' ? 'guide' : r.type === 'new-workflow' ? 'new workflow' : r.type === 'knowledge-organize' ? 'organize' : r.type === 'knowledge-adjust' ? 'adjust' : 'tweak';
|
|
7029
|
-
const badgeCls = r.type === 'tweak' || r.type === 'ui-customize' || r.type === 'rebake' || r.type === 'revision-read' || r.type === 'knowledge-organize' || r.type === 'knowledge-adjust' ? 'req-type req-type-tweak' : 'req-type';
|
|
7084
|
+
const label = r.type === 'use-template' ? 'template' : r.type === 'ui-customize' ? 'dashboard' : r.type === 'rebake' ? 're-bake' : r.type === 'revision-read' ? 'revision' : r.type === 'guide' ? 'guide' : r.type === 'new-workflow' ? 'new workflow' : r.type === 'knowledge-organize' ? 'organize' : r.type === 'knowledge-adjust' ? 'adjust' : r.type === 'tweak-contract' ? 'contract' : 'tweak';
|
|
7085
|
+
const badgeCls = r.type === 'tweak' || r.type === 'ui-customize' || r.type === 'rebake' || r.type === 'revision-read' || r.type === 'knowledge-organize' || r.type === 'knowledge-adjust' || r.type === 'tweak-contract' ? 'req-type req-type-tweak' : 'req-type';
|
|
7086
|
+
// The insert-a-detail sheet earns a chip because instructionFor() appends its intent sentence at
|
|
7087
|
+
// the END of the body, and .req-instruction is 3-line-clamped — on an ordinary-length Ask AI note
|
|
7088
|
+
// that is exactly the part that gets clipped. One identifying field per chip, as node/input do:
|
|
7089
|
+
// target.ids is a list and stays in the copied instruction.
|
|
7030
7090
|
const target = r.type === 'tweak' && r.nodeId
|
|
7031
7091
|
? ` · node <code>${escapeHtml(r.nodeId)}</code>`
|
|
7032
7092
|
: r.type === 'rebake' && r.inputName
|
|
7033
7093
|
? ` · input <code>${escapeHtml(r.inputName)}</code>`
|
|
7034
|
-
: ''
|
|
7094
|
+
: r.type === 'tweak-contract' && r.target && r.target.sheet
|
|
7095
|
+
? ` · sheet <code>${escapeHtml(r.target.sheet)}</code>`
|
|
7096
|
+
: '';
|
|
7035
7097
|
const when = r.createdAt ? new Date(r.createdAt) : null;
|
|
7036
7098
|
const time = when && !isNaN(when) ? `<span class="req-time">${escapeHtml(nowStamp(when))}</span>` : '';
|
|
7037
7099
|
// A knowledge-organize is resolved by its own finish/fail lifecycle POST. Offering a ✕ here
|
|
@@ -7045,7 +7107,7 @@
|
|
|
7045
7107
|
<div class="req-item">
|
|
7046
7108
|
<div class="req-info">
|
|
7047
7109
|
<div class="req-head"><span class="${badgeCls}">${label}</span> ${r.appId ? `<code>${escapeHtml(r.appId)}</code>` : ''}${target}${time}</div>
|
|
7048
|
-
<div class="req-instruction">${escapeHtml(instructionFor(r))}</div>
|
|
7110
|
+
<div class="req-instruction">${escapeHtml(instructionFor(r)) || 'This request has no instruction, so it can’t be handed to your terminal AI. Clear it and queue it again.'}</div>
|
|
7049
7111
|
${r.snapshots && r.snapshots.length ? `<div class="req-thumbs">${r.snapshots.map((sp, i) => { const pdf = /\.pdf$/i.test(String(sp)); return `<button type="button" class="req-thumb" data-id="${escapeAttr(r.id)}" data-n="${i}" aria-label="View ${pdf ? 'PDF' : 'screenshot'} ${i + 1}">${pdf ? '<span class="req-thumb-pdf">PDF</span>' : `<img src="/api/requests/${encodeURIComponent(r.id)}/snapshot/${i}" alt="">`}</button>`; }).join('')}</div>` : ''}
|
|
7050
7112
|
</div>
|
|
7051
7113
|
<div class="req-actions">
|
|
@@ -7058,8 +7120,9 @@
|
|
|
7058
7120
|
b.onclick = async () => {
|
|
7059
7121
|
const r = pendingRequests.find((x) => x.id === b.dataset.id);
|
|
7060
7122
|
if (!r) return;
|
|
7061
|
-
const
|
|
7062
|
-
|
|
7123
|
+
const res = await copyRequest(r);
|
|
7124
|
+
if (res === 'ok') showToast('Copied — paste it to your terminal AI', 'ok');
|
|
7125
|
+
else showToast(...copyFailToast(res));
|
|
7063
7126
|
};
|
|
7064
7127
|
});
|
|
7065
7128
|
$list.querySelectorAll('.req-del').forEach((b) => { b.onclick = () => deleteOneRequest(b.dataset.id); });
|
|
@@ -8548,9 +8611,21 @@
|
|
|
8548
8611
|
const $reqCopy = document.getElementById('requests-copy');
|
|
8549
8612
|
if ($reqCopy) $reqCopy.onclick = async () => {
|
|
8550
8613
|
if (!pendingRequests.length) return;
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8614
|
+
// Count what actually made it, not what was in the list. `.filter(Boolean)` silently drops a
|
|
8615
|
+
// request with no instruction body, and reporting pendingRequests.length over that is the
|
|
8616
|
+
// original bug wearing a bulk hat: the user pastes, the AI applies the ones that copied, and the
|
|
8617
|
+
// dropped request never reaches the terminal while the toast said it did.
|
|
8618
|
+
const lines = pendingRequests.map(markedInstruction).filter(Boolean);
|
|
8619
|
+
const dropped = pendingRequests.length - lines.length;
|
|
8620
|
+
if (!lines.length) { showToast('Nothing to copy — none of these requests has an instruction', 'err'); return; }
|
|
8621
|
+
const copied = await copyToClipboard(lines.join('\n\n'));
|
|
8622
|
+
if (!copied) { showToast('copy failed', 'err'); return; }
|
|
8623
|
+
showToast(
|
|
8624
|
+
dropped
|
|
8625
|
+
? `Copied ${lines.length} of ${pendingRequests.length} — ${dropped} had no instruction and ${dropped === 1 ? 'was' : 'were'} skipped`
|
|
8626
|
+
: `Copied ${lines.length} request(s) — paste to your terminal AI`,
|
|
8627
|
+
dropped ? 'warn' : 'ok',
|
|
8628
|
+
);
|
|
8554
8629
|
};
|
|
8555
8630
|
const $requestHelpModal = document.getElementById('request-help-modal');
|
|
8556
8631
|
const $requestHelpOpen = document.getElementById('request-help-open');
|
|
@@ -8563,8 +8638,15 @@
|
|
|
8563
8638
|
if ($requestHelpKeep) $requestHelpKeep.onclick = () => closeRequestHelp();
|
|
8564
8639
|
if ($requestHelpCopy) $requestHelpCopy.onclick = async () => {
|
|
8565
8640
|
if (!requestHelpReq) return;
|
|
8566
|
-
|
|
8567
|
-
|
|
8641
|
+
// Via copyRequest, so an instruction-less type says so rather than "copy failed".
|
|
8642
|
+
const res = await copyRequest(requestHelpReq);
|
|
8643
|
+
const copied = res === 'ok';
|
|
8644
|
+
if (copied) showToast('Copied — paste it to your terminal AI', 'ok');
|
|
8645
|
+
else showToast(...copyFailToast(res));
|
|
8646
|
+
// 'denied' keeps the button — a clipboard permission is worth retrying. 'empty' hides it exactly
|
|
8647
|
+
// as success does: there is no instruction body, so no number of clicks will ever produce one, and
|
|
8648
|
+
// leaving Copy there offers a retry that cannot succeed.
|
|
8649
|
+
if (res === 'empty') $requestHelpCopy.hidden = true;
|
|
8568
8650
|
if (copied) {
|
|
8569
8651
|
$requestHelpCopy.hidden = true;
|
|
8570
8652
|
const $sub = document.getElementById('request-help-sub');
|
|
@@ -8767,6 +8849,7 @@
|
|
|
8767
8849
|
copyToClipboard,
|
|
8768
8850
|
instructionFor,
|
|
8769
8851
|
markedInstruction, // marked (paste-safe) form for clipboard copies — panels.js uses it (#73)
|
|
8852
|
+
copyRequest, // copy ONE request, telling "no instruction body" apart from "clipboard refused"
|
|
8770
8853
|
showRequestQueuedModal,
|
|
8771
8854
|
formModal, // the shared styled prompt/form modal — workspaces.js reuses it (never a native prompt)
|
|
8772
8855
|
// One owner for runtime upgrades. Workspaces may open this surface but must
|
|
@@ -498,7 +498,15 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
498
498
|
#moreMenu button:disabled{opacity:.4;cursor:default;background:transparent}
|
|
499
499
|
#moreMenu button.on{color:var(--brand)}
|
|
500
500
|
button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
|
|
501
|
-
|
|
501
|
+
/* Provenance is an at-a-glance marker, not a second sheet selector: a muted label plus one short bold
|
|
502
|
+
value, the way the header's other stat chips read (Members 6, Axes Global), with the full caption in
|
|
503
|
+
data-tip. Capping the value holds the whole chip to 173px even on a name that overruns (master's ran
|
|
504
|
+
to 240px), which is what keeps a 1920 window's button bank on one row — the header is flex-wrap:wrap,
|
|
505
|
+
so it still wraps below ~1870px, and sooner the longer the value. `b` needs
|
|
506
|
+
inline-block for max-width to apply at all, and vertical-align:bottom to hold its baseline with the
|
|
507
|
+
sibling chips (overflow:hidden makes an inline-block's bottom edge its own baseline). */
|
|
508
|
+
#srcStat{white-space:nowrap}
|
|
509
|
+
#srcStat b{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
|
|
502
510
|
#detailNewForm input#dnName{margin:2px 0 10px}
|
|
503
511
|
#dnDrop{border:1px dashed #475569;border-radius:8px;background:#0b1220;min-height:88px;display:flex;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--mut);cursor:pointer;padding:12px;font-size:12px}
|
|
504
512
|
#dnDrop:hover{border-color:var(--brand);color:var(--text)} #dnDrop.has{border-style:solid;border-color:var(--brand)}
|
|
@@ -1165,9 +1173,12 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1165
1173
|
<b>Steel Model</b>
|
|
1166
1174
|
<div id=viewToggle role=group aria-label="Canvas view"><button id=vt2d class="seg on" aria-pressed=true data-tip="Plan view (2D overlay)">2D</button><button id=vt3d class=seg aria-pressed=false data-tip="3D model view">3D</button></div>
|
|
1167
1175
|
<!-- Plan switcher. See the .plan-* rules for why this is not a <select>. Unlike the sibling page's sheet
|
|
1168
|
-
switcher it is NOT hidden for a single plan: this control is the
|
|
1169
|
-
|
|
1170
|
-
dead control. (
|
|
1176
|
+
switcher it is NOT hidden for a single plan: this control is the only place the name of the plan you
|
|
1177
|
+
are LOOKING AT appears, so hiding it for a one-plan model would delete information rather than a
|
|
1178
|
+
dead control. (#srcStat is not a second one: it names the READ, and only ever with C.source.name or
|
|
1179
|
+
the read date — never C.source.sheet, which is why the header can never appear to name the plan you
|
|
1180
|
+
are on. A read that recorded ONLY a sheet shows no chip at all.)
|
|
1181
|
+
(An earlier version of this comment justified that by claiming the sibling can hide
|
|
1171
1182
|
because the sheet is also named on its #src readout. That is false — #src renders `C.source.name`,
|
|
1172
1183
|
the source FILE's name — and the sibling really does leave a lone sheet unnamed on screen. The
|
|
1173
1184
|
decision here stands on its own; it does not need a claim about the other page.) -->
|
|
@@ -4956,8 +4967,13 @@ async function connModifyRequest(j){
|
|
|
4956
4967
|
const onMember=j.main?' on member '+j.main:'';
|
|
4957
4968
|
const label=j.kind==='custom'&&j.name?' ("'+j.name+'")':'';
|
|
4958
4969
|
const instruction='Modify the '+kindName+' connection "'+j.id+'"'+label+onMember+' (sheet '+((P&&P.sheet)||'?')+') — adjust, replace or move it per my request.';
|
|
4970
|
+
// `project` like both sibling producers (detailRequest, Ask AI): without it the relay composes an
|
|
4971
|
+
// APP-keyed GET/PUT, so in a workspace project the AI reads the wrong store — and if that app store
|
|
4972
|
+
// is empty the GET falls through to the baked publication, which carries no ETag, at which point the
|
|
4973
|
+
// instruction's own "If-None-Match: * when there was no ETag" rule has it CREATE an app-scoped
|
|
4974
|
+
// contract while the user's project document is never touched.
|
|
4959
4975
|
try{const res=await fetch('/api/contract-request',{method:'POST',headers:{'content-type':'application/json'},
|
|
4960
|
-
body:JSON.stringify({appId:APP_ID,instruction,intent:'modify',target:{sheet:(P&&P.sheet)||undefined,ids:[j.id,j.main].filter(Boolean)}})});
|
|
4976
|
+
body:JSON.stringify({appId:APP_ID,project:PROJECT||undefined,instruction,intent:'modify',target:{sheet:(P&&P.sheet)||undefined,ids:[j.id,j.main].filter(Boolean)}})});
|
|
4961
4977
|
toast(res.ok?'Change queued for your terminal AI session':'Could not queue the request');
|
|
4962
4978
|
}catch(_){toast('Could not queue the request');}
|
|
4963
4979
|
}
|
|
@@ -13862,16 +13878,48 @@ if(new URLSearchParams(location.search).get('selftest')==='1'){(function(){
|
|
|
13862
13878
|
const msg=fails.length?('SELFTEST FAIL: '+fails.join(' | ')):'SELFTEST PASS (frame + snap + transform + brace math)';
|
|
13863
13879
|
console[fails.length?'error':'log'](msg);try{toast(msg);}catch(_){}
|
|
13864
13880
|
})();}
|
|
13865
|
-
// --- provenance
|
|
13881
|
+
// --- provenance chip: contract.source (name/sheet/read_at) → "Source <file>", full caption in the tooltip ---
|
|
13882
|
+
// contract.source is authored by the terminal AI that read the drawing, so a source that is PRESENT but
|
|
13883
|
+
// unusable is a real upstream bug, not an empty state. An ABSENT one stays silent — a hand-built model
|
|
13884
|
+
// legitimately has none — but anything else warns, so a reader that drifts its shape is not mistaken for
|
|
13885
|
+
// "this model was never read from a drawing". console.warn, not error: the E2E gate reads the error channel
|
|
13886
|
+
// and a malformed contract must not spend it. (silent-failure review; same rule as normBrace above.)
|
|
13866
13887
|
(function(){
|
|
13867
|
-
const src=C.source;if(
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
if(src.
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13888
|
+
const src=C.source;if(src==null)return; // no provenance recorded — the legitimate empty state
|
|
13889
|
+
// Each call states its OWN consequence: a refused field still leaves a chip, a refused source does not.
|
|
13890
|
+
const warn=(why,got)=>{console.warn('steel-editor: contract.source '+why,got);};
|
|
13891
|
+
if(typeof src!=='object'||Array.isArray(src)){warn('is not an object — the provenance chip stays hidden',src);return;}
|
|
13892
|
+
// Never coerce: every field here is drawing-derived, and an object reaching String() paints the literal
|
|
13893
|
+
// "[object Object]" into the header — the same reason planLabel refuses it. A non-string is not a value.
|
|
13894
|
+
// Refusing it WARNS, because partial drift is the likelier kind: a reader that starts emitting epoch-ms
|
|
13895
|
+
// for read_at, or a number for sheet, would otherwise have that one field vanish from the tooltip with
|
|
13896
|
+
// everything else still rendering, and nothing anywhere to notice. Absent — missing, null, or the empty
|
|
13897
|
+
// string a serializer writes for "unknown" — is silent; 0, false and objects are drift and are not.
|
|
13898
|
+
const str=(v,k)=>{if(v==null||v==='')return'';if(typeof v==='string'&&v.trim())return v.trim();warn('carried a '+k+' that is not a usable string — that field is left out of the chip',v);return'';};
|
|
13899
|
+
const name=str(src.name,'name'),sheet=str(src.sheet,'sheet'),stamp=str(src.read_at,'read_at');
|
|
13900
|
+
const parts=[];let day='';
|
|
13901
|
+
if(name)parts.push('read from '+name);
|
|
13902
|
+
if(sheet)parts.push(sheet);
|
|
13903
|
+
// No try/catch: new Date(<string>) never throws — it returns Invalid Date, which isNaN already catches.
|
|
13904
|
+
// Requiring a STRING also keeps read_at 0/null/true out; each of those is a VALID Date of 1 Jan 1970,
|
|
13905
|
+
// so a looser guard would stamp the chip with an epoch date nobody's drawing was read on.
|
|
13906
|
+
if(stamp){const d=new Date(stamp);if(isNaN(d.getTime()))warn('carried an unreadable read_at — the date is left out of the chip',src.read_at);else{day=d.toLocaleDateString(undefined,{timeZone:'UTC'});parts.push(day);}}
|
|
13907
|
+
if(!parts.length){warn('recorded no name, sheet or readable date — the provenance chip stays hidden',src);return;}
|
|
13908
|
+
const el=document.getElementById('srcStat');
|
|
13909
|
+
if(!el){warn('cannot render — #srcStat is missing from the header',null);return;}
|
|
13910
|
+
// The value must be one that CANNOT go stale, because this block runs once at boot and nothing re-runs
|
|
13911
|
+
// it on setPlan(). The file and the read date are fixed for the life of the page; source.sheet is not.
|
|
13912
|
+
// It is the single sheet the drawing was READ from, while plans[] holds many and C.active is restored
|
|
13913
|
+
// from localStorage — so a multi-sheet model opens on S-202 with the chip stamped S-201, in a row of
|
|
13914
|
+
// live per-sheet stats (Members, Dup, Axes) where that reads as "current". So the sheet NEVER heads this
|
|
13915
|
+
// chip, not even as a last resort: a source with no file and no readable date has recorded no stale-proof
|
|
13916
|
+
// identity, and a readout that is wrong is worse than one that is absent (see the per-sheet counts
|
|
13917
|
+
// above). That is the same call as the {path, sha256} case just above — hide, and say why. The sheet
|
|
13918
|
+
// still reaches the tooltip whenever anything else earns the chip, where "read from …" dates it.
|
|
13919
|
+
const val=name||day;
|
|
13920
|
+
if(!val){warn('recorded only a sheet, which cannot head this chip without reading as the plan you are on — the provenance chip stays hidden',src);return;}
|
|
13921
|
+
el.textContent='Source ';el.append(Object.assign(document.createElement('b'),{textContent:val}));
|
|
13922
|
+
el.dataset.tip=parts.join(' · ');el.style.display='';
|
|
13875
13923
|
})();
|
|
13876
13924
|
// --- Ask AI: send instruction + optional screenshots → POST /api/contract-request ---
|
|
13877
13925
|
// The server records a tweak-contract request; the terminal AI picks it up async and PUTs
|
package/dist/web/workspaces.js
CHANGED
|
@@ -5291,8 +5291,8 @@
|
|
|
5291
5291
|
const req = res && res.request;
|
|
5292
5292
|
// Copy the paste-ready instruction so the user can hand it to their terminal AI (best-effort).
|
|
5293
5293
|
let copied = false;
|
|
5294
|
-
if (req && bridge.
|
|
5295
|
-
try { copied = await bridge.
|
|
5294
|
+
if (req && bridge.copyRequest) {
|
|
5295
|
+
try { copied = (await bridge.copyRequest(req)) === 'ok'; } catch { copied = false; }
|
|
5296
5296
|
}
|
|
5297
5297
|
if (bridge.loadRequests) bridge.loadRequests().catch(() => {}); // refresh the footer Requests popover
|
|
5298
5298
|
if (current !== proj) return; // switched away while posting — don't drive the wrong project's card/poll
|
|
@@ -5423,9 +5423,13 @@
|
|
|
5423
5423
|
if (!req) return;
|
|
5424
5424
|
if (e.target.closest('[data-revreview]')) {
|
|
5425
5425
|
openRevisionReview(req);
|
|
5426
|
-
} else if (e.target.closest('[data-revcopy]') && bridge.
|
|
5427
|
-
|
|
5428
|
-
|
|
5426
|
+
} else if (e.target.closest('[data-revcopy]') && bridge.copyRequest) {
|
|
5427
|
+
// "no instruction body" must not be reported as "copy blocked": that sends the user to the
|
|
5428
|
+
// Requests panel, where the ⧉ gives the real reason and contradicts this toast.
|
|
5429
|
+
const res = await bridge.copyRequest(req);
|
|
5430
|
+
if (res === 'ok') showToast('Instruction copied', 'ok');
|
|
5431
|
+
else if (res === 'empty') showToast('Nothing to copy — this request has no instruction', 'err');
|
|
5432
|
+
else showToast('Copy blocked — use the Requests panel', 'warn');
|
|
5429
5433
|
} else if (e.target.closest('[data-revdismiss]')) {
|
|
5430
5434
|
try { await api(`/api/requests/${encodeURIComponent(req.id)}`, { method: 'DELETE' }); } catch { /* already gone */ }
|
|
5431
5435
|
lastRevState = 'none';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floless/app",
|
|
3
|
-
"version": "0.124.
|
|
3
|
+
"version": "0.124.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
|
|
6
6
|
"bin": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"build:exe": "node build/bundle.mjs && node build/make-sea.mjs",
|
|
27
27
|
"verify:skills": "node build/verify-shipped-skills.mjs",
|
|
28
28
|
"verify:skill-versions": "node build/verify-skill-versions.mjs",
|
|
29
|
+
"verify:skill-parity": "node build/verify-skill-parity.mjs",
|
|
29
30
|
"verify:flo": "node build/verify-flo-descriptions.mjs",
|
|
30
31
|
"verify:flo-naming": "node build/verify-flo-naming.mjs",
|
|
31
32
|
"verify:no-title": "node build/verify-no-title.mjs",
|