@floless/app 0.101.4 → 0.102.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 +192 -28
- package/dist/schemas/steel.takeoff.v1.schema.json +14 -1
- package/dist/web/app.css +11 -4
- package/dist/web/steel-editor.html +402 -21
- package/dist/web/workspaces.js +72 -17
- package/package.json +1 -1
package/dist/floless-server.cjs
CHANGED
|
@@ -53106,7 +53106,7 @@ function appVersion() {
|
|
|
53106
53106
|
return resolveVersion({
|
|
53107
53107
|
isSea: isSea2(),
|
|
53108
53108
|
sqVersionXml: readSqVersionXml(),
|
|
53109
|
-
define: true ? "0.
|
|
53109
|
+
define: true ? "0.102.0" : void 0,
|
|
53110
53110
|
pkgVersion: readPkgVersion()
|
|
53111
53111
|
});
|
|
53112
53112
|
}
|
|
@@ -53116,7 +53116,7 @@ function resolveChannel(s) {
|
|
|
53116
53116
|
return "dev";
|
|
53117
53117
|
}
|
|
53118
53118
|
function appChannel() {
|
|
53119
|
-
return resolveChannel({ isSea: isSea2(), define: true ? "0.
|
|
53119
|
+
return resolveChannel({ isSea: isSea2(), define: true ? "0.102.0" : void 0 });
|
|
53120
53120
|
}
|
|
53121
53121
|
|
|
53122
53122
|
// workflow-update.ts
|
|
@@ -57080,6 +57080,7 @@ function registerKnowledgeRoutes(app) {
|
|
|
57080
57080
|
// project-versions-store.ts
|
|
57081
57081
|
var import_node_crypto8 = require("node:crypto");
|
|
57082
57082
|
var import_node_fs23 = require("node:fs");
|
|
57083
|
+
var import_promises2 = require("node:fs/promises");
|
|
57083
57084
|
var import_node_path20 = require("node:path");
|
|
57084
57085
|
var BLOB_MIN = 8192;
|
|
57085
57086
|
var BLOB_KEY = "__blobRef__";
|
|
@@ -57191,6 +57192,14 @@ function readVersionSkeleton(id, n) {
|
|
|
57191
57192
|
return null;
|
|
57192
57193
|
}
|
|
57193
57194
|
}
|
|
57195
|
+
async function readVersionSkeletonAsync(id, n) {
|
|
57196
|
+
try {
|
|
57197
|
+
const snap = JSON.parse(await (0, import_promises2.readFile)((0, import_node_path20.join)(versionsDir(id), `${n}.json`), "utf8"));
|
|
57198
|
+
return snap.contract;
|
|
57199
|
+
} catch {
|
|
57200
|
+
return null;
|
|
57201
|
+
}
|
|
57202
|
+
}
|
|
57194
57203
|
|
|
57195
57204
|
// project-contract-hash.ts
|
|
57196
57205
|
var import_node_crypto9 = require("node:crypto");
|
|
@@ -58611,6 +58620,140 @@ function diffContracts(from, to) {
|
|
|
58611
58620
|
}
|
|
58612
58621
|
|
|
58613
58622
|
// version-diff.ts
|
|
58623
|
+
var summaryCache = /* @__PURE__ */ new Map();
|
|
58624
|
+
var baseForVersion = (n, bases) => {
|
|
58625
|
+
if (bases?.has(n)) {
|
|
58626
|
+
const base = bases.get(n);
|
|
58627
|
+
return base == null ? null : base;
|
|
58628
|
+
}
|
|
58629
|
+
return n === 1 ? null : n - 1;
|
|
58630
|
+
};
|
|
58631
|
+
var summaryKey = (id, n, from) => `${id}\0${n}\0${from ?? "baseline"}`;
|
|
58632
|
+
var countWord = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
|
|
58633
|
+
var refName = (ref) => {
|
|
58634
|
+
const name = ref.mark || ref.id;
|
|
58635
|
+
return ref.sheet ? `${name} (${ref.sheet})` : name;
|
|
58636
|
+
};
|
|
58637
|
+
var preview = (items, max2 = 3) => {
|
|
58638
|
+
const shown = items.slice(0, max2);
|
|
58639
|
+
const rest = items.length - shown.length;
|
|
58640
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
58641
|
+
};
|
|
58642
|
+
var pounds = new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 });
|
|
58643
|
+
var cautionsForWarnings = (warnings) => {
|
|
58644
|
+
const cautions = [];
|
|
58645
|
+
if (warnings.identityNotPreserved) cautions.push("Member identities were not preserved, so this comparison may be incomplete.");
|
|
58646
|
+
if (warnings.duplicateKeys?.length) {
|
|
58647
|
+
cautions.push(`${countWord(warnings.duplicateKeys.length, "member")} could not be compared because duplicate IDs were found.`);
|
|
58648
|
+
}
|
|
58649
|
+
if (warnings.ambiguousJoints?.length) cautions.push("Some connection changes could not be attributed to a specific member.");
|
|
58650
|
+
if (warnings.scaleUnknown) cautions.push("Move distances are approximate because a drawing scale is missing.");
|
|
58651
|
+
return cautions;
|
|
58652
|
+
};
|
|
58653
|
+
function summarizeContractDiff(diff) {
|
|
58654
|
+
const bullets = [];
|
|
58655
|
+
let detailCount = 0;
|
|
58656
|
+
const add = (count, text) => {
|
|
58657
|
+
if (!count) return;
|
|
58658
|
+
detailCount += count;
|
|
58659
|
+
bullets.push(text);
|
|
58660
|
+
};
|
|
58661
|
+
add(diff.added.length, `Added ${countWord(diff.added.length, "member")}: ${preview(diff.added.map(refName))}.`);
|
|
58662
|
+
add(diff.removed.length, `Removed ${countWord(diff.removed.length, "member")}: ${preview(diff.removed.map(refName))}.`);
|
|
58663
|
+
add(
|
|
58664
|
+
diff.resized.length,
|
|
58665
|
+
`Resized ${countWord(diff.resized.length, "member")}: ${preview(diff.resized.map((x) => `${refName(x.ref)} (${x.from || "unspecified"} \u2192 ${x.to || "unspecified"})`))}.`
|
|
58666
|
+
);
|
|
58667
|
+
add(
|
|
58668
|
+
diff.moved.length,
|
|
58669
|
+
`Moved ${countWord(diff.moved.length, "member")}: ${preview(diff.moved.map((x) => `${refName(x.ref)} (about ${x.feet} ft)`))}.`
|
|
58670
|
+
);
|
|
58671
|
+
add(
|
|
58672
|
+
diff.material.length,
|
|
58673
|
+
`Changed material on ${countWord(diff.material.length, "member")}: ${preview(diff.material.map((x) => `${refName(x.ref)} (${x.from || "unspecified"} \u2192 ${x.to || "unspecified"})`))}.`
|
|
58674
|
+
);
|
|
58675
|
+
add(
|
|
58676
|
+
diff.connections.length,
|
|
58677
|
+
`Updated connections on ${countWord(diff.connections.length, "member")}: ${preview(diff.connections.map((x) => refName(x.ref)))}.`
|
|
58678
|
+
);
|
|
58679
|
+
if (diff.tonnage.netLb !== 0) {
|
|
58680
|
+
const up = diff.tonnage.netLb > 0;
|
|
58681
|
+
const absLb = Math.abs(diff.tonnage.netLb);
|
|
58682
|
+
const amount = Math.abs(diff.tonnage.netTons) >= 0.1 ? `${Math.abs(diff.tonnage.netTons)} tons (${pounds.format(absLb)} lb)` : `${pounds.format(absLb)} lb`;
|
|
58683
|
+
bullets.push(
|
|
58684
|
+
`Net steel ${up ? "increased" : "decreased"} by ${amount}.`
|
|
58685
|
+
);
|
|
58686
|
+
}
|
|
58687
|
+
const cautions = cautionsForWarnings(diff.warnings);
|
|
58688
|
+
const headline = detailCount > 0 ? `${countWord(detailCount, "model change")} since v${diff.from}` : bullets.length > 0 ? `Steel quantity changed since v${diff.from}` : `No model changes detected since v${diff.from}`;
|
|
58689
|
+
if (!bullets.length) {
|
|
58690
|
+
bullets.push(diff.unchanged > 0 ? `${countWord(diff.unchanged, "member")} unchanged; sign-off recorded.` : "Sign-off recorded with no detectable model changes.");
|
|
58691
|
+
}
|
|
58692
|
+
return { from: diff.from, headline, detailCount, bullets, cautions };
|
|
58693
|
+
}
|
|
58694
|
+
function summarizeSnapshots(n, to, fromVersion, from) {
|
|
58695
|
+
if (fromVersion == null) {
|
|
58696
|
+
const baseline = diffContracts({}, to);
|
|
58697
|
+
const rawPlans = Array.isArray(to?.plans) ? to.plans : [];
|
|
58698
|
+
const plans = rawPlans.length;
|
|
58699
|
+
const memberCount = rawPlans.reduce(
|
|
58700
|
+
(count, plan) => count + (Array.isArray(plan?.members) ? plan.members.length : 0),
|
|
58701
|
+
0
|
|
58702
|
+
);
|
|
58703
|
+
const bullets = [`${countWord(memberCount, "member")} across ${countWord(plans, "drawing sheet")}.`];
|
|
58704
|
+
if (baseline.tonnage.toLb > 0) {
|
|
58705
|
+
bullets.push(baseline.tonnage.toTons > 0 ? `Total modeled steel: ${baseline.tonnage.toTons} tons (${pounds.format(baseline.tonnage.toLb)} lb).` : `Total modeled steel: ${pounds.format(baseline.tonnage.toLb)} lb.`);
|
|
58706
|
+
}
|
|
58707
|
+
return {
|
|
58708
|
+
from: null,
|
|
58709
|
+
headline: "Baseline approved",
|
|
58710
|
+
detailCount: memberCount,
|
|
58711
|
+
bullets,
|
|
58712
|
+
cautions: cautionsForWarnings(baseline.warnings)
|
|
58713
|
+
};
|
|
58714
|
+
}
|
|
58715
|
+
const diff = diffContracts(from, to);
|
|
58716
|
+
diff.from = fromVersion;
|
|
58717
|
+
diff.to = n;
|
|
58718
|
+
return summarizeContractDiff(diff);
|
|
58719
|
+
}
|
|
58720
|
+
function uncachedVersions(id, versions, out, bases) {
|
|
58721
|
+
return [...new Set(versions.filter((n) => Number.isInteger(n) && n > 0))].filter((n) => {
|
|
58722
|
+
const cached = summaryCache.get(summaryKey(id, n, baseForVersion(n, bases)));
|
|
58723
|
+
if (cached) out.set(n, cached);
|
|
58724
|
+
return !cached;
|
|
58725
|
+
});
|
|
58726
|
+
}
|
|
58727
|
+
async function summarizeVersionChangesAsync(id, versions, bases) {
|
|
58728
|
+
const out = /* @__PURE__ */ new Map();
|
|
58729
|
+
const missing = uncachedVersions(id, versions, out, bases);
|
|
58730
|
+
if (!missing.length) return out;
|
|
58731
|
+
try {
|
|
58732
|
+
const needed = /* @__PURE__ */ new Set();
|
|
58733
|
+
for (const n of missing) {
|
|
58734
|
+
needed.add(n);
|
|
58735
|
+
const base = baseForVersion(n, bases);
|
|
58736
|
+
if (base != null) needed.add(base);
|
|
58737
|
+
}
|
|
58738
|
+
const docs = /* @__PURE__ */ new Map();
|
|
58739
|
+
await Promise.all([...needed].map(async (n) => {
|
|
58740
|
+
docs.set(n, await readVersionSkeletonAsync(id, n));
|
|
58741
|
+
}));
|
|
58742
|
+
for (const n of missing) {
|
|
58743
|
+
const to = docs.get(n);
|
|
58744
|
+
if (to == null) continue;
|
|
58745
|
+
const fromVersion = baseForVersion(n, bases);
|
|
58746
|
+
const from = fromVersion != null ? docs.get(fromVersion) : void 0;
|
|
58747
|
+
if (fromVersion != null && from == null) continue;
|
|
58748
|
+
await new Promise((resolve8) => setImmediate(resolve8));
|
|
58749
|
+
const summary = summarizeSnapshots(n, to, fromVersion, from);
|
|
58750
|
+
summaryCache.set(summaryKey(id, n, fromVersion), summary);
|
|
58751
|
+
out.set(n, summary);
|
|
58752
|
+
}
|
|
58753
|
+
} catch {
|
|
58754
|
+
}
|
|
58755
|
+
return out;
|
|
58756
|
+
}
|
|
58614
58757
|
function appSupportsDiff(app) {
|
|
58615
58758
|
return app === "steel-model";
|
|
58616
58759
|
}
|
|
@@ -61869,7 +62012,7 @@ function generateXlsxFileContents(arg1, arg2, arg3) {
|
|
|
61869
62012
|
sheetsOptions = setConditionalFormattingRulesGlobalIndexes(sheetsOptions);
|
|
61870
62013
|
var features = getFeatures(options.features);
|
|
61871
62014
|
var files2 = {};
|
|
61872
|
-
var
|
|
62015
|
+
var readFile3 = function readFile4(path) {
|
|
61873
62016
|
return files2[path];
|
|
61874
62017
|
};
|
|
61875
62018
|
var writeFiles = function writeFiles2(filesToWrite) {
|
|
@@ -61936,7 +62079,7 @@ function generateXlsxFileContents(arg1, arg2, arg3) {
|
|
|
61936
62079
|
sheetIndex++;
|
|
61937
62080
|
}
|
|
61938
62081
|
writeFiles(getWrittenFiles(features, sheetsOptions, {
|
|
61939
|
-
read:
|
|
62082
|
+
read: readFile3
|
|
61940
62083
|
}));
|
|
61941
62084
|
files2["xl/styles.xml"] = generateStylesXml(getCellStyles(), sheetsOptions, features);
|
|
61942
62085
|
files2["xl/sharedStrings.xml"] = generateSharedStringsXml(getSharedStrings());
|
|
@@ -63955,7 +64098,7 @@ var import_node_child_process6 = require("node:child_process");
|
|
|
63955
64098
|
var import_node_crypto11 = require("node:crypto");
|
|
63956
64099
|
var import_node_fs36 = require("node:fs");
|
|
63957
64100
|
var import_node_stream3 = require("node:stream");
|
|
63958
|
-
var
|
|
64101
|
+
var import_promises3 = require("node:stream/promises");
|
|
63959
64102
|
var import_node_path32 = require("node:path");
|
|
63960
64103
|
|
|
63961
64104
|
// post-update-marker.mjs
|
|
@@ -64112,7 +64255,7 @@ async function checkForUpdate() {
|
|
|
64112
64255
|
}
|
|
64113
64256
|
async function sha1OfFile(path) {
|
|
64114
64257
|
const hash = (0, import_node_crypto11.createHash)("sha1");
|
|
64115
|
-
await (0,
|
|
64258
|
+
await (0, import_promises3.pipeline)((0, import_node_fs36.createReadStream)(path), hash);
|
|
64116
64259
|
return hash.digest("hex").toUpperCase();
|
|
64117
64260
|
}
|
|
64118
64261
|
async function downloadPackage(asset) {
|
|
@@ -64127,7 +64270,7 @@ async function downloadPackage(asset) {
|
|
|
64127
64270
|
signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS)
|
|
64128
64271
|
});
|
|
64129
64272
|
if (!res.ok || !res.body) throw new Error(`download failed: HTTP ${res.status} for ${asset.FileName}`);
|
|
64130
|
-
await (0,
|
|
64273
|
+
await (0, import_promises3.pipeline)(import_node_stream3.Readable.fromWeb(res.body), (0, import_node_fs36.createWriteStream)(dest));
|
|
64131
64274
|
const got = await sha1OfFile(dest);
|
|
64132
64275
|
if (got !== want) throw new Error(`SHA1 mismatch for ${asset.FileName}: feed=${want} got=${got}`);
|
|
64133
64276
|
return dest;
|
|
@@ -65026,12 +65169,12 @@ var import_node_fs39 = require("node:fs");
|
|
|
65026
65169
|
|
|
65027
65170
|
// node_modules/chokidar/esm/index.js
|
|
65028
65171
|
var import_fs2 = require("fs");
|
|
65029
|
-
var
|
|
65172
|
+
var import_promises6 = require("fs/promises");
|
|
65030
65173
|
var import_events = require("events");
|
|
65031
65174
|
var sysPath2 = __toESM(require("path"), 1);
|
|
65032
65175
|
|
|
65033
65176
|
// node_modules/readdirp/esm/index.js
|
|
65034
|
-
var
|
|
65177
|
+
var import_promises4 = require("node:fs/promises");
|
|
65035
65178
|
var import_node_stream4 = require("node:stream");
|
|
65036
65179
|
var import_node_path35 = require("node:path");
|
|
65037
65180
|
var EntryTypes = {
|
|
@@ -65098,7 +65241,7 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
|
|
|
65098
65241
|
const { root, type } = opts;
|
|
65099
65242
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
65100
65243
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
65101
|
-
const statMethod = opts.lstat ?
|
|
65244
|
+
const statMethod = opts.lstat ? import_promises4.lstat : import_promises4.stat;
|
|
65102
65245
|
if (wantBigintFsStats) {
|
|
65103
65246
|
this._stat = (path) => statMethod(path, { bigint: true });
|
|
65104
65247
|
} else {
|
|
@@ -65169,7 +65312,7 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
|
|
|
65169
65312
|
async _exploreDir(path, depth) {
|
|
65170
65313
|
let files2;
|
|
65171
65314
|
try {
|
|
65172
|
-
files2 = await (0,
|
|
65315
|
+
files2 = await (0, import_promises4.readdir)(path, this._rdOptions);
|
|
65173
65316
|
} catch (error) {
|
|
65174
65317
|
this._onError(error);
|
|
65175
65318
|
}
|
|
@@ -65207,8 +65350,8 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
|
|
|
65207
65350
|
if (stats && stats.isSymbolicLink()) {
|
|
65208
65351
|
const full = entry2.fullPath;
|
|
65209
65352
|
try {
|
|
65210
|
-
const entryRealPath = await (0,
|
|
65211
|
-
const entryRealPathStats = await (0,
|
|
65353
|
+
const entryRealPath = await (0, import_promises4.realpath)(full);
|
|
65354
|
+
const entryRealPathStats = await (0, import_promises4.lstat)(entryRealPath);
|
|
65212
65355
|
if (entryRealPathStats.isFile()) {
|
|
65213
65356
|
return "file";
|
|
65214
65357
|
}
|
|
@@ -65251,7 +65394,7 @@ function readdirp(root, options = {}) {
|
|
|
65251
65394
|
|
|
65252
65395
|
// node_modules/chokidar/esm/handler.js
|
|
65253
65396
|
var import_fs = require("fs");
|
|
65254
|
-
var
|
|
65397
|
+
var import_promises5 = require("fs/promises");
|
|
65255
65398
|
var sysPath = __toESM(require("path"), 1);
|
|
65256
65399
|
var import_os = require("os");
|
|
65257
65400
|
var STR_DATA = "data";
|
|
@@ -65278,7 +65421,7 @@ var EVENTS = {
|
|
|
65278
65421
|
};
|
|
65279
65422
|
var EV = EVENTS;
|
|
65280
65423
|
var THROTTLE_MODE_WATCH = "watch";
|
|
65281
|
-
var statMethods = { lstat:
|
|
65424
|
+
var statMethods = { lstat: import_promises5.lstat, stat: import_promises5.stat };
|
|
65282
65425
|
var KEY_LISTENERS = "listeners";
|
|
65283
65426
|
var KEY_ERR = "errHandlers";
|
|
65284
65427
|
var KEY_RAW = "rawEmitters";
|
|
@@ -65635,7 +65778,7 @@ var setFsWatchListener = (path, fullPath, options, handlers) => {
|
|
|
65635
65778
|
cont.watcherUnusable = true;
|
|
65636
65779
|
if (isWindows && error.code === "EPERM") {
|
|
65637
65780
|
try {
|
|
65638
|
-
const fd2 = await (0,
|
|
65781
|
+
const fd2 = await (0, import_promises5.open)(path, "r");
|
|
65639
65782
|
await fd2.close();
|
|
65640
65783
|
broadcastErr(error);
|
|
65641
65784
|
} catch (err2) {
|
|
@@ -65764,7 +65907,7 @@ var NodeFsHandler = class {
|
|
|
65764
65907
|
return;
|
|
65765
65908
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
65766
65909
|
try {
|
|
65767
|
-
const newStats2 = await (0,
|
|
65910
|
+
const newStats2 = await (0, import_promises5.stat)(file);
|
|
65768
65911
|
if (this.fsw.closed)
|
|
65769
65912
|
return;
|
|
65770
65913
|
const at = newStats2.atimeMs;
|
|
@@ -65819,7 +65962,7 @@ var NodeFsHandler = class {
|
|
|
65819
65962
|
this.fsw._incrReadyCount();
|
|
65820
65963
|
let linkPath;
|
|
65821
65964
|
try {
|
|
65822
|
-
linkPath = await (0,
|
|
65965
|
+
linkPath = await (0, import_promises5.realpath)(path);
|
|
65823
65966
|
} catch (e) {
|
|
65824
65967
|
this.fsw._emitReady();
|
|
65825
65968
|
return true;
|
|
@@ -65967,7 +66110,7 @@ var NodeFsHandler = class {
|
|
|
65967
66110
|
let closer;
|
|
65968
66111
|
if (stats.isDirectory()) {
|
|
65969
66112
|
const absPath = sysPath.resolve(path);
|
|
65970
|
-
const targetPath = follow ? await (0,
|
|
66113
|
+
const targetPath = follow ? await (0, import_promises5.realpath)(path) : path;
|
|
65971
66114
|
if (this.fsw.closed)
|
|
65972
66115
|
return;
|
|
65973
66116
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -65977,7 +66120,7 @@ var NodeFsHandler = class {
|
|
|
65977
66120
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
65978
66121
|
}
|
|
65979
66122
|
} else if (stats.isSymbolicLink()) {
|
|
65980
|
-
const targetPath = follow ? await (0,
|
|
66123
|
+
const targetPath = follow ? await (0, import_promises5.realpath)(path) : path;
|
|
65981
66124
|
if (this.fsw.closed)
|
|
65982
66125
|
return;
|
|
65983
66126
|
const parent = sysPath.dirname(wh.watchPath);
|
|
@@ -66138,7 +66281,7 @@ var DirEntry = class {
|
|
|
66138
66281
|
return;
|
|
66139
66282
|
const dir = this.path;
|
|
66140
66283
|
try {
|
|
66141
|
-
await (0,
|
|
66284
|
+
await (0, import_promises6.readdir)(dir);
|
|
66142
66285
|
} catch (err2) {
|
|
66143
66286
|
if (this._removeWatcher) {
|
|
66144
66287
|
this._removeWatcher(sysPath2.dirname(dir), sysPath2.basename(dir));
|
|
@@ -66463,7 +66606,7 @@ var FSWatcher = class extends import_events.EventEmitter {
|
|
|
66463
66606
|
const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path) : path;
|
|
66464
66607
|
let stats2;
|
|
66465
66608
|
try {
|
|
66466
|
-
stats2 = await (0,
|
|
66609
|
+
stats2 = await (0, import_promises6.stat)(fullPath);
|
|
66467
66610
|
} catch (err2) {
|
|
66468
66611
|
}
|
|
66469
66612
|
if (!stats2 || this.closed)
|
|
@@ -67390,7 +67533,27 @@ async function startServer() {
|
|
|
67390
67533
|
app.get("/api/projects/:id/versions", async (req, reply) => {
|
|
67391
67534
|
const p = getProject(req.params.id);
|
|
67392
67535
|
if (!p) return reply.status(404).send({ ok: false, error: `unknown project: ${req.params.id}` });
|
|
67393
|
-
|
|
67536
|
+
const versions = listVersions(req.params.id);
|
|
67537
|
+
let enriched = versions;
|
|
67538
|
+
if (appSupportsDiff(p.app)) {
|
|
67539
|
+
const approvals = versions.filter((v) => v.kind === "approve").sort((a, b) => a.n - b.n);
|
|
67540
|
+
const approvalBases = /* @__PURE__ */ new Map();
|
|
67541
|
+
let previousApproval = null;
|
|
67542
|
+
for (const version of approvals) {
|
|
67543
|
+
approvalBases.set(version.n, previousApproval);
|
|
67544
|
+
previousApproval = version.n;
|
|
67545
|
+
}
|
|
67546
|
+
const summaries = await summarizeVersionChangesAsync(
|
|
67547
|
+
p.id,
|
|
67548
|
+
approvals.map((v) => v.n),
|
|
67549
|
+
approvalBases
|
|
67550
|
+
);
|
|
67551
|
+
enriched = versions.map((v) => {
|
|
67552
|
+
const changeSummary = summaries.get(v.n);
|
|
67553
|
+
return v.kind === "approve" && changeSummary ? { ...v, changeSummary } : v;
|
|
67554
|
+
});
|
|
67555
|
+
}
|
|
67556
|
+
return { ok: true, versions: enriched, approvedAt: p.approvedAt ?? null };
|
|
67394
67557
|
});
|
|
67395
67558
|
app.get(
|
|
67396
67559
|
"/api/projects/:id/versions/:n/diff",
|
|
@@ -67609,15 +67772,16 @@ async function startServer() {
|
|
|
67609
67772
|
}
|
|
67610
67773
|
broadcast({ type: "compiled", id: req.params.appId, lockPath: result.lockPath });
|
|
67611
67774
|
let approvedAt;
|
|
67775
|
+
let version;
|
|
67612
67776
|
if (project) {
|
|
67613
67777
|
const latest = readContract(req.params.appId, project);
|
|
67614
67778
|
if (latest == null || contractHash(latest) !== approvingHash) {
|
|
67615
67779
|
return reply.status(409).send({ ok: false, error: "contract changed while approval was running \u2014 review the latest draft and Approve again" });
|
|
67616
67780
|
}
|
|
67617
|
-
createVersion(project, doc, { author: "You", message: "Approved this version", gate: "model", kind: "approve" });
|
|
67781
|
+
version = createVersion(project, doc, { author: "You", message: "Approved this version", gate: "model", kind: "approve" });
|
|
67618
67782
|
approvedAt = markApproved(project).approvedAt;
|
|
67619
67783
|
}
|
|
67620
|
-
return { ok: true, result, approvedAt };
|
|
67784
|
+
return { ok: true, result, approvedAt, version };
|
|
67621
67785
|
});
|
|
67622
67786
|
app.post(
|
|
67623
67787
|
"/api/contract/:appId/score",
|
|
@@ -68250,11 +68414,11 @@ async function startServer() {
|
|
|
68250
68414
|
}
|
|
68251
68415
|
const token = (0, import_node_crypto12.randomUUID)();
|
|
68252
68416
|
registerStage(token, tempHome, result.agentId);
|
|
68253
|
-
const
|
|
68417
|
+
const preview2 = buildPreview(manifest, sourceKind, sourceRef, token);
|
|
68254
68418
|
if ((0, import_node_fs40.existsSync)((0, import_node_path37.join)(graftAgentsDir(), result.agentId))) {
|
|
68255
|
-
|
|
68419
|
+
preview2.warnings.unshift(`An agent named "${result.agentId}" is already installed \u2014 creating it will overwrite it.`);
|
|
68256
68420
|
}
|
|
68257
|
-
return { ok: true, preview };
|
|
68421
|
+
return { ok: true, preview: preview2 };
|
|
68258
68422
|
});
|
|
68259
68423
|
app.post("/api/graft/commit", async (req, reply) => {
|
|
68260
68424
|
const { stagedRef, force = false } = req.body ?? {};
|
|
@@ -355,7 +355,20 @@
|
|
|
355
355
|
"b": { "$ref": "#/$defs/point2", "description": "Second snapped anchor, display space." },
|
|
356
356
|
"axis": { "enum": ["free", "x", "y"], "description": "free = aligned distance hypot(b-a); x = along local-X; y = along local-Y. With no frame (rot 0) x/y are screen-horizontal/vertical." },
|
|
357
357
|
"off": { "type": "number", "description": "Dimension-line offset: for axis x the dim-line Y; for axis y the dim-line X; for free the signed perpendicular distance from the a-b baseline. Stored in the dim's own (rot-rotated) frame." },
|
|
358
|
-
"rot": { "type": "number", "description": "Local-frame bearing (radians) baked at creation; 0 = global axes. x/y measure along this rotated frame so resetting the plan frame never moves placed dims." }
|
|
358
|
+
"rot": { "type": "number", "description": "Local-frame bearing (radians) baked at creation; 0 = global axes. x/y measure along this rotated frame so resetting the plan frame never moves placed dims." },
|
|
359
|
+
"aRef": { "$ref": "#/$defs/dimRef", "description": "F9 magnetic dim: OPTIONAL link from anchor a to a plain beam's work-point in THIS plan. When present the ref is authoritative and a is a cache reanchored from the member every render; editor-only, stripped before bake (contract-bake deletes each plan's whole dims array — never in the lock / 3D / IFC / BOM)." },
|
|
360
|
+
"bRef": { "$ref": "#/$defs/dimRef", "description": "As aRef, for anchor b." },
|
|
361
|
+
"pin": { "type": "boolean", "description": "F9 magnetic dim: false = the link is DORMANT (user unpinned it) — the refs are kept but the dim neither follows its members nor moves them on a value edit, until re-pinned. Absent/true = pinned (magnetic). Only meaningful alongside aRef/bRef; dropped by the sanitizer otherwise. Editor-only like the refs." }
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"dimRef": {
|
|
365
|
+
"type": "object",
|
|
366
|
+
"additionalProperties": false,
|
|
367
|
+
"description": "One of TWO shapes (the in-house validator has no oneOf, so both keys are optional here; the editor's load-boundary sanitizer enforces the real invariant): a MEMBER ref {m, pt} or a GRID-LINE ref {g}.",
|
|
368
|
+
"properties": {
|
|
369
|
+
"m": { "type": "string", "description": "Member ref: a member id in the SAME plan the dim lives in. Beams and columns — never a brace (a ref to anything else is dropped at the load boundary / on reanchor). Pair with pt." },
|
|
370
|
+
"pt": { "enum": ["a", "b", "mid"], "description": "Member ref: which of the member's DRAWN points the anchor tracks — a = start work-point, b = end work-point, mid = midpoint. A column resolves to its single plan point regardless." },
|
|
371
|
+
"g": { "type": "string", "description": "Grid-line ref: the plan-local synthetic grid id ('gv:<i>' / 'gh:<i>' spacing lines, 'gl:<id>' free lines — the same ids the grid selection uses). The anchor is the grid line ∩ the dim's own offset row; index-based, so a respace/re-infer safe-freezes the dim." }
|
|
359
372
|
}
|
|
360
373
|
},
|
|
361
374
|
"dim3": {
|
package/dist/web/app.css
CHANGED
|
@@ -3614,7 +3614,7 @@ table.hist { width:100%; border-collapse:collapse; font-size:12.5px; }
|
|
|
3614
3614
|
table.hist th { text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:.1em; color:var(--text-dim);
|
|
3615
3615
|
font-weight:600; padding:0 12px 8px; border-bottom:1px solid var(--border); white-space:nowrap; }
|
|
3616
3616
|
table.hist td { padding:11px 12px; border-bottom:1px solid var(--border); color:var(--text); vertical-align:middle; }
|
|
3617
|
-
table.hist td.change { line-height:1.45; }
|
|
3617
|
+
table.hist td.change { line-height:1.45; min-width:300px; }
|
|
3618
3618
|
table.hist tr:hover td { background:var(--surface-2); }
|
|
3619
3619
|
table.hist tr.current td { background:var(--accent-soft); }
|
|
3620
3620
|
.hist .ver { font-family:var(--mono); font-size:11.5px; color:var(--text-dim); }
|
|
@@ -3630,6 +3630,13 @@ table.hist tr.current td { background:var(--accent-soft); }
|
|
|
3630
3630
|
.hist .gate-badge { display:inline-block; padding:2px 7px; border-radius:4px; font-size:9.5px; font-weight:600;
|
|
3631
3631
|
text-transform:uppercase; letter-spacing:.05em; background:transparent; border:1px solid var(--border-strong); color:var(--text-dim); }
|
|
3632
3632
|
.hist .gate-badge.model { background:var(--accent-soft); border-color:var(--accent-dim); color:var(--accent-bright); }
|
|
3633
|
+
.hist-event { color:var(--text); }
|
|
3634
|
+
.hist-change-head { color:var(--text); font-weight:600; margin-bottom:4px; }
|
|
3635
|
+
.hist-change-list { margin:0; padding-left:17px; color:var(--text-muted); }
|
|
3636
|
+
.hist-change-list li { margin:1px 0; padding-left:1px; }
|
|
3637
|
+
.hist-change-list li::marker { color:var(--text-dim); }
|
|
3638
|
+
.hist-change-list .hist-change-more { color:var(--text-dim); font-style:italic; }
|
|
3639
|
+
.hist-change-caution { margin-top:5px; color:var(--warn); font-size:11px; }
|
|
3633
3640
|
.hist .btn-mini, .ws-drawings-bar .btn-mini, .ws-revision-card .btn-mini { background:none; border:1px solid var(--border-strong); color:var(--text-muted); border-radius:6px;
|
|
3634
3641
|
padding:4px 10px; font-size:11px; cursor:pointer; white-space:nowrap; }
|
|
3635
3642
|
.hist .btn-mini:hover, .ws-drawings-bar .btn-mini:hover, .ws-revision-card .btn-mini:hover { color:var(--text); border-color:var(--accent); }
|
|
@@ -3667,10 +3674,10 @@ table.hist tr.current td { background:var(--accent-soft); }
|
|
|
3667
3674
|
/* ── Workspaces ▸ History ▸ "What changed" semantic diff (Slice 5) ──────────────
|
|
3668
3675
|
A per-version disclosure row (colspan) under table.hist. Uses only History tokens; group
|
|
3669
3676
|
headers follow the same mono-uppercase idiom as table.hist th. No new fonts/colors/widgets. */
|
|
3670
|
-
.
|
|
3671
|
-
|
|
3672
|
-
display:inline-flex; align-items:center; border-radius:4px; line-height:1; }
|
|
3677
|
+
.hd-toggle { background:none; border:none; padding:3px 5px; margin:6px 0 0 -5px; cursor:pointer; color:var(--accent);
|
|
3678
|
+
display:inline-flex; align-items:center; gap:5px; border-radius:4px; line-height:1.2; font:inherit; font-size:11px; }
|
|
3673
3679
|
.hd-toggle:hover, .hd-toggle[aria-expanded="true"] { color:var(--text); background:var(--surface-2); }
|
|
3680
|
+
.hd-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
|
|
3674
3681
|
.hd-caret { display:inline-block; font-size:10px; transition:transform .18s ease-out; }
|
|
3675
3682
|
.hd-toggle[aria-expanded="true"] .hd-caret { transform:rotate(90deg); }
|
|
3676
3683
|
table.hist tr.hd-open td { background:var(--surface-2); }
|