suppa-mcp-2 1.45.0 → 1.46.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/README.md +15 -8
- package/dist/bin.js +32 -1
- package/dist/cli/api.js +102 -21
- package/dist/cli/run.js +6 -3
- package/dist/server.js +103 -13
- package/dist/startupRepair.js +1 -1
- package/dist/toolTable.js +1 -1
- package/dist/tools/customOrder.js +307 -0
- package/dist/tools/docs.js +48 -27
- package/dist/tools/entity.js +82 -11
- package/dist/tools/recordOrder.js +266 -0
- package/dist/tools/tasks.js +82 -16
- package/package.json +1 -1
- package/skills/suppa-cli/SKILL.md +13 -7
- package/skills/suppa-form-v2/code-form/SOURCE.json +3 -3
- package/skills/suppa-form-v2/scripts/code-form/code-form-core.mjs +8 -8
- package/skills/suppa-form-v2/scripts/form-core.mjs +24 -24
- package/skills/suppa-form-v2/scripts/validate-form-schema.mjs +42 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/generated/v2-component-manifest.js
|
|
2
2
|
var rawV2Manifest = {
|
|
3
3
|
"version": 2,
|
|
4
4
|
"basePropMeta": [
|
|
@@ -1513,7 +1513,7 @@ var rawV2Manifest = {
|
|
|
1513
1513
|
};
|
|
1514
1514
|
var v2_component_manifest_default = rawV2Manifest;
|
|
1515
1515
|
|
|
1516
|
-
//
|
|
1516
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/manifest.js
|
|
1517
1517
|
var V2_ELEMENT_TYPES = [
|
|
1518
1518
|
// base 12 (post-2.1; `dateView` removed)
|
|
1519
1519
|
"input",
|
|
@@ -1684,7 +1684,7 @@ function v2ReadModeOptInTypes(m) {
|
|
|
1684
1684
|
}
|
|
1685
1685
|
var v2ComponentManifest = loadV2Manifest(v2_component_manifest_default);
|
|
1686
1686
|
|
|
1687
|
-
//
|
|
1687
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/util.js
|
|
1688
1688
|
function isObj(v) {
|
|
1689
1689
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
1690
1690
|
}
|
|
@@ -1695,7 +1695,7 @@ function deepEqualJson(a, b) {
|
|
|
1695
1695
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
-
//
|
|
1698
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/customChart.js
|
|
1699
1699
|
var CUSTOM_NAME_PATTERN = /^[a-z][A-Za-z0-9_]*$/;
|
|
1700
1700
|
var PROTOTYPE_NAMES = new Set(Object.getOwnPropertyNames(Object.prototype));
|
|
1701
1701
|
function isCustomCodeName(name) {
|
|
@@ -1783,7 +1783,7 @@ function deriveCodeName(text, taken, fallback) {
|
|
|
1783
1783
|
return `${base}${n}`;
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
//
|
|
1786
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/generated/v2-icon-registry.js
|
|
1787
1787
|
var V2_ICON_NAMES = ["add", "addChat", "addPlan", "addUser", "agents", "ai", "alert", "alignCenter", "alignEnd", "alignStart", "alignStretch", "analytics", "arrow", "arrowLeft", "arrowRight", "arrowSide", "back", "bag", "barChart", "binoculars", "bold", "bookmark", "box", "briefcase", "building", "bullet", "cake", "calendar", "calendarUpload", "call", "cart", "centerView", "chats", "checkboxCircle", "checkboxSquare", "checkboxSquareChecked", "checkmark", "chevronDoubleRight", "chevronDown", "chevronLeft", "chevronRight", "chevronUp", "clapperboard", "clock", "close", "closeFolder", "closedTickets", "code", "codeFile", "coin", "cold", "collapse", "collapseSideways", "collection", "color", "colorSwatch", "columns", "connection", "connections", "copy", "copySimple", "database", "deadline", "delete", "density", "desktop", "development", "discard", "dislike", "doubleScreen", "download", "dragIndicator", "duplicate", "edit", "editUser", "editorImage", "editorLink", "email", "emoji", "eraser", "events", "expand", "expandDiagonal", "expandSideways", "fileAttach", "fileBookmark", "fileTypeCode", "fileTypeDocs", "fileTypeExe", "fileTypeImage", "fileTypeJson", "fileTypeOther", "fileTypePdf", "fileTypeTxt", "fileTypeVideo", "fileTypeZip", "fileUpload", "filebox", "filesNotes", "film", "filter2", "filters", "flag", "flow", "fold", "foldItems", "folder", "folderOpen", "fullScreen", "furniture", "gannt", "gem", "goals", "groups", "growStats", "heart", "help", "hide", "highPriority", "highestPriority", "home", "image", "import", "indentDecrease", "indentIncrease", "installation", "italic", "justifyBetween", "justifyCenter", "justifyEnd", "kanban", "keyboard", "knowledgeBase", "lightningBolt", "like", "link", "list", "list1", "listSquare", "loader", "loaderArc", "loaderRing", "location", "lock", "lockOpen", "logout", "lowPriority", "lowestPriority", "magicWand", "map", "meetings", "mention", "message", "messageRead", "messageSent", "microphone", "microphoneMute", "midPriority", "minus", "minusCircle", "money", "moneyStack", "moneysign", "more", "muteNotifications", "note", "notes", "notifications", "numberList", "paint", "paperclip", "pause", "photo", "pin", "pinActive", "play", "playCircle", "plug", "plus", "plusCircle", "print", "priority", "puzzle", "qRCode", "quote", "radioEmpty", "reaction", "replace", "reply", "report", "save", "search", "searchTab", "security", "sendMessage", "service", "settings", "settings2", "shipping", "shop", "shoppingBag", "shuffle", "sideLayout", "sidebar", "sidebarCollapse", "smartphone", "sorting", "sound", "sounds", "stack", "stats", "status", "statusDotBlue", "statusDotCrimson", "statusDotGreen", "statusDotOrange", "statusDotPink", "statusDotRed", "statusDotYellow", "strikethrough", "subtasks", "support", "swipe", "table", "tag", "tasks", "text", "textColor", "ticket", "time", "timeflow", "toDoList", "translate", "twoArrowsLeft", "twoArrowsRight", "type", "underline", "unfold", "unpin", "upload", "user", "userCancel", "userCheck", "userDelete", "userRound", "users", "video", "view", "warm", "warning", "web", "wifiConnection"];
|
|
1788
1788
|
var V2_ICON_ALIASES = {
|
|
1789
1789
|
"AccessRequest": "taskTypeAccessRequest",
|
|
@@ -2618,7 +2618,7 @@ var V2_ICON_ALIASES = {
|
|
|
2618
2618
|
};
|
|
2619
2619
|
var V2_BACKEND_OWNED_ICONS = ["taskTypeAccessRequest", "taskTypeBug", "taskTypeDeal", "taskTypeDefect", "taskTypeDesignTask", "taskTypeDevelopmentTask", "taskTypeEpic", "taskTypeProject", "taskTypeSalesRequest", "taskTypeService", "taskTypeSubTask", "taskTypeSuggestion", "taskTypeTask"];
|
|
2620
2620
|
|
|
2621
|
-
//
|
|
2621
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/iconRegistry.js
|
|
2622
2622
|
var BUNDLED = new Set(V2_ICON_NAMES);
|
|
2623
2623
|
var BACKEND_OWNED = new Set(V2_BACKEND_OWNED_ICONS);
|
|
2624
2624
|
function isAuthorableIcon(name) {
|
|
@@ -2655,7 +2655,7 @@ function nearestIcons(wrong, limit = 4) {
|
|
|
2655
2655
|
return scored.sort((a, b) => a.score - b.score || a.name.length - b.name.length || a.name.localeCompare(b.name)).slice(0, limit).map((s) => s.name);
|
|
2656
2656
|
}
|
|
2657
2657
|
|
|
2658
|
-
//
|
|
2658
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/cellWidgetKeys.js
|
|
2659
2659
|
var CELL_WIDGET_RENDERER = "@dynamic";
|
|
2660
2660
|
var WIDGET_COLUMN_KEY_RE = /^widget_[0-9a-f]{10}$/;
|
|
2661
2661
|
function cellWidgetKindOf(col) {
|
|
@@ -2681,7 +2681,7 @@ function columnCodeKeys(col) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
var CELL_WIDGET_ENTRY_KEYS = /* @__PURE__ */ new Set(["template", "script", "style", "compiledRender", "translations"]);
|
|
2683
2683
|
|
|
2684
|
-
//
|
|
2684
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/validator.js
|
|
2685
2685
|
var V2_BASE_PROPS = [
|
|
2686
2686
|
// `dataSource` being base-allowlisted is load-bearing and has ONE known blind spot worth naming here so it
|
|
2687
2687
|
// is not rediscovered a third time (audit contract-4, 2026-09-16): because the key is allowed on EVERY
|
|
@@ -5588,10 +5588,10 @@ function hasImageBinding(ds) {
|
|
|
5588
5588
|
return str(ds.fieldPath) || str(ds.variable);
|
|
5589
5589
|
}
|
|
5590
5590
|
|
|
5591
|
-
//
|
|
5591
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/uxVerify.js
|
|
5592
5592
|
var READ_MODE_OPT_IN_TYPES = new Set(v2ReadModeOptInTypes(v2ComponentManifest));
|
|
5593
5593
|
|
|
5594
|
-
//
|
|
5594
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/requiredConfig.js
|
|
5595
5595
|
var KIND_SENSITIVE_TYPES = /* @__PURE__ */ new Set(["select", "table", "chips"]);
|
|
5596
5596
|
var SQL_INFERRED_SOURCE_TYPES = /* @__PURE__ */ new Set(["chart", "table"]);
|
|
5597
5597
|
function inferDataSourceKind(el) {
|
|
@@ -5632,7 +5632,7 @@ var GLOBAL_SYSTEM_RECORD_CARD_ENTITIES = new Set([
|
|
|
5632
5632
|
"AutomationCredentials"
|
|
5633
5633
|
].map((name) => name.toLowerCase()));
|
|
5634
5634
|
|
|
5635
|
-
//
|
|
5635
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/entitySpec.js
|
|
5636
5636
|
var BASE_FIELD_NAMES = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt", "deletedAt", "createdBy", "removedBy"]);
|
|
5637
5637
|
var PLATFORM_RESERVED_FIELD_NAMES = [
|
|
5638
5638
|
"parent",
|
|
@@ -5678,7 +5678,7 @@ var HIERARCHY_DEPTH_LIMIT_MIN = 1;
|
|
|
5678
5678
|
var HIERARCHY_DEPTH_LIMIT_MAX = 20;
|
|
5679
5679
|
var DEPTH_LIMIT_SHAPE = `a whole number of levels, ${HIERARCHY_DEPTH_LIMIT_MIN}\u2013${HIERARCHY_DEPTH_LIMIT_MAX} (a root is level 1)`;
|
|
5680
5680
|
|
|
5681
|
-
//
|
|
5681
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/diff.js
|
|
5682
5682
|
var isEmptyValue = (v) => v === void 0 || v === null || v === "" || Array.isArray(v) && v.length === 0 || isObj(v) && Object.keys(v).length === 0;
|
|
5683
5683
|
function diffValues(before, after, prefix, out) {
|
|
5684
5684
|
if (isObj(before) && isObj(after)) {
|
|
@@ -5740,7 +5740,7 @@ function diffV2Form(before, after) {
|
|
|
5740
5740
|
};
|
|
5741
5741
|
}
|
|
5742
5742
|
|
|
5743
|
-
//
|
|
5743
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/responsive.js
|
|
5744
5744
|
var PANEL_PARENTS = /* @__PURE__ */ new Set(["tabs", "accordion", "steps"]);
|
|
5745
5745
|
var FILTER_TYPES = /* @__PURE__ */ new Set(["datePicker", "select", "input", "checkbox", "buttonList"]);
|
|
5746
5746
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? Math.floor(v) : d;
|
|
@@ -5851,7 +5851,7 @@ function packBreakpoint(schema, bp, opts) {
|
|
|
5851
5851
|
}
|
|
5852
5852
|
}
|
|
5853
5853
|
|
|
5854
|
-
//
|
|
5854
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/normalize.js
|
|
5855
5855
|
var PRIMARY_BREAKPOINT = "lg";
|
|
5856
5856
|
var DEFAULT_COLUMNS = 12;
|
|
5857
5857
|
function intAtLeast(v, min) {
|
|
@@ -6439,7 +6439,7 @@ function fitContainerHeights(schema, bp) {
|
|
|
6439
6439
|
return changed;
|
|
6440
6440
|
}
|
|
6441
6441
|
|
|
6442
|
-
//
|
|
6442
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/polish.js
|
|
6443
6443
|
var DEFAULT_COLUMNS2 = 12;
|
|
6444
6444
|
var DEFAULT_CANVAS_WIDTH = 1024;
|
|
6445
6445
|
var DEFAULT_X_GAP = 12;
|
|
@@ -6716,7 +6716,7 @@ function tidyFlow(els, bp, cols, baselineIds) {
|
|
|
6716
6716
|
}
|
|
6717
6717
|
}
|
|
6718
6718
|
|
|
6719
|
-
//
|
|
6719
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/themesTokens.js
|
|
6720
6720
|
var SYSTEM_TOKENS = [
|
|
6721
6721
|
{ key: "brand.primary", light: "#3381E5", dark: "#6C9EF2" },
|
|
6722
6722
|
{ key: "brand.primary-hover", light: "#2C6EC2", dark: "#85AEF4" },
|
|
@@ -7047,7 +7047,7 @@ var DATA_COLOR_TOKEN_POOLS = {
|
|
|
7047
7047
|
line: ["border.default", "border.hover", "border.active", "border.disabled", "brand.accent", "feedback.success", "feedback.warning", "feedback.error", "text.primary", "text.secondary", "text.muted"]
|
|
7048
7048
|
};
|
|
7049
7049
|
|
|
7050
|
-
//
|
|
7050
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/themes.js
|
|
7051
7051
|
var clamp = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
7052
7052
|
var toChannel = (v) => clamp(Math.round(v), 0, 255);
|
|
7053
7053
|
var toAlpha = (v) => clamp(v, 0, 1);
|
|
@@ -7502,7 +7502,7 @@ function paintIn(value, themeName, adapt, palette) {
|
|
|
7502
7502
|
return themeHex(adapt ? adaptLiteral(s, adapt, theme) : s);
|
|
7503
7503
|
}
|
|
7504
7504
|
|
|
7505
|
-
//
|
|
7505
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/theme.js
|
|
7506
7506
|
var BRAND = {
|
|
7507
7507
|
primary: "#3381E5",
|
|
7508
7508
|
// BluePrimary
|
|
@@ -7819,7 +7819,7 @@ function applyTheme(draft, rawTheme) {
|
|
|
7819
7819
|
return { draft: out, warnings };
|
|
7820
7820
|
}
|
|
7821
7821
|
|
|
7822
|
-
//
|
|
7822
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/brandConformance.js
|
|
7823
7823
|
var SNAP_DIST = 14;
|
|
7824
7824
|
var RADIUS_SCALE = [8, 12];
|
|
7825
7825
|
var SPACING_SCALE = [4, 6, 8, 12, 16, 20, 24];
|
|
@@ -8086,7 +8086,7 @@ function conformBrandColors(schema, baseline, accentColor, opts = {}) {
|
|
|
8086
8086
|
return { schema: out, warnings };
|
|
8087
8087
|
}
|
|
8088
8088
|
|
|
8089
|
-
//
|
|
8089
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/cardKitPatterns.js
|
|
8090
8090
|
var CARD_KIT_PATTERNS = [
|
|
8091
8091
|
{
|
|
8092
8092
|
name: "p_recordHeader",
|
|
@@ -8455,7 +8455,7 @@ var CARD_KIT_PATTERNS = [
|
|
|
8455
8455
|
}
|
|
8456
8456
|
];
|
|
8457
8457
|
|
|
8458
|
-
//
|
|
8458
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/cardKitLint.js
|
|
8459
8459
|
var KIT_SHADOWS = new Set(["", "none", "0 1px 2px rgba(16,24,40,0.05)", "0 1px 2px rgba(16,24,40,0.06), 0 12px 20px -14px rgba(16,24,40,0.30)"].map((s) => s.replace(/\s+/g, "")));
|
|
8460
8460
|
var urlCalls = (css) => [...css.matchAll(/url\s*\(\s*(?:"([^"]*)"|'([^']*)'|([^"'\s)]*))\s*\)/gi)].map((m) => (m[1] ?? m[2] ?? m[3] ?? "").trim());
|
|
8461
8461
|
var decoded = (u) => {
|
|
@@ -8479,7 +8479,7 @@ var CARD_KIT_GLYPH_URLS = new Set(CARD_KIT_PATTERNS.flatMap((p) => p.components)
|
|
|
8479
8479
|
return out;
|
|
8480
8480
|
}));
|
|
8481
8481
|
|
|
8482
|
-
//
|
|
8482
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/beautify.js
|
|
8483
8483
|
var CARD_SECTION_TYPES = /* @__PURE__ */ new Set(["container"]);
|
|
8484
8484
|
var FIELD_LIKE_TYPES = /* @__PURE__ */ new Set([
|
|
8485
8485
|
"input",
|
|
@@ -8711,7 +8711,7 @@ function beautifyDraft(draft, opts) {
|
|
|
8711
8711
|
return { draft: { ...draft, schema, settings }, changed, notes };
|
|
8712
8712
|
}
|
|
8713
8713
|
|
|
8714
|
-
//
|
|
8714
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/reconcile.js
|
|
8715
8715
|
var layoutOf = (el) => isObj(el.layout) ? el.layout : void 0;
|
|
8716
8716
|
var TOOLBAR_ZONE_SUFFIX = "__actions";
|
|
8717
8717
|
function reconcileTreeIntegrity(rawSchema, baselineSchema) {
|
|
@@ -8977,7 +8977,7 @@ function reconcileTreeIntegrity(rawSchema, baselineSchema) {
|
|
|
8977
8977
|
return { schema: finalSchema, changed, notes };
|
|
8978
8978
|
}
|
|
8979
8979
|
|
|
8980
|
-
//
|
|
8980
|
+
// suppa-ai-agent/packages/formbuilder-agent/dist/schema/templates.js
|
|
8981
8981
|
var SETTINGS = { columnsNumber: 12, xGap: "16px", yGap: "12px" };
|
|
8982
8982
|
var CARD_SETTINGS = { columnsNumber: 12, xGap: "12px", yGap: "12px", backgroundColor: "var(--sp-surface-app-bg, #F5F5FA)" };
|
|
8983
8983
|
var TOP_LABEL = { labelLocation: { flexDirection: "column", gap: "4px" }, labelSettings: { fontSize: "12px", fontWeight: "500", color: "rgb(var(--sp-text-secondary-rgb, 72 73 84))" } };
|
|
@@ -378,31 +378,49 @@ export function normalizeEnvelope(input) {
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
/**
|
|
381
|
-
*
|
|
382
|
-
* `relation_missing_entity` on a form that is fine
|
|
381
|
+
* A relation variable as a tenant hands it back has no `entity`, and the core then reports
|
|
382
|
+
* `relation_missing_entity` on a form that is fine.
|
|
383
383
|
*
|
|
384
|
-
* The server keeps no `entity` column on FormVariables
|
|
385
|
-
*
|
|
386
|
-
* every
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* variable really does need its own entity, and inventing one would hide a real defect. The fill is
|
|
390
|
-
* for the CHECK only — the writers send the file's own variable list, never this copy.
|
|
384
|
+
* The server keeps no `entity` column on FormVariables: what it stores is `relationEntity` (an
|
|
385
|
+
* EntityMetadata reference — entity-builder form-row-mappers.ts mapVariableRow, VARIABLE_SELECT_FIELDS
|
|
386
|
+
* `relationEntity: { id }`), so every variable read back (GET /core/forms/:id/schema, a FormVariables
|
|
387
|
+
* read) arrives with `relationEntity: { id }` at best and never with `entity`. Two fills, for the CHECK
|
|
388
|
+
* only — the writers send the file's own variable list, never this copy:
|
|
391
389
|
*
|
|
392
|
-
*
|
|
390
|
+
* - a relation variable that carries `relationEntity` HAS a target: the server's own. Checked as such —
|
|
391
|
+
* its name when the read gives one, else `#<id>` (the core only asks whether there is one). This is
|
|
392
|
+
* the reported false refusal on publish (2026-11-16): forms whose tabular parts and lookups ride on
|
|
393
|
+
* relation variables an application seeded with `relationEntity`.
|
|
394
|
+
* - the DEFAULT relation variable with no `relationEntity` either (Mykola's list D3, forms 349 and 480,
|
|
395
|
+
* 2026-10-14): the builder re-derives its entity on every open (FE core/utils/defaultVariableFactory.ts
|
|
396
|
+
* `ensure` → `syncDefaultEntity`) and `create()` names it after the entity verbatim, so `entity = name`.
|
|
397
|
+
*
|
|
398
|
+
* A NON-default relation variable with neither `entity` nor `relationEntity` keeps the finding: it
|
|
399
|
+
* really has no target on the server, and inventing one would hide a real defect.
|
|
400
|
+
*
|
|
401
|
+
* @returns {{ variables: unknown[], filled: string[], fromServer: string[] }} a copy; the input is never mutated
|
|
393
402
|
*/
|
|
394
403
|
export function fillDefaultRelationEntity(variables) {
|
|
395
404
|
const filled = [];
|
|
405
|
+
const fromServer = [];
|
|
396
406
|
const list = Array.isArray(variables) ? variables : [];
|
|
397
407
|
const out = list.map((v) => {
|
|
398
|
-
if (!v || typeof v !== "object" || v.
|
|
408
|
+
if (!v || typeof v !== "object" || v.type !== "relation") return v;
|
|
399
409
|
if (typeof v.entity === "string" && v.entity) return v;
|
|
410
|
+
const rel = v.relationEntity ?? v.relatedEntity;
|
|
411
|
+
const relName = rel && typeof rel === "object" && typeof rel.name === "string" && rel.name ? rel.name : null;
|
|
412
|
+
const relId = rel && typeof rel === "object" ? rel.id : typeof rel === "number" ? rel : null;
|
|
413
|
+
if (relName || (relId !== null && relId !== undefined && relId !== "")) {
|
|
414
|
+
fromServer.push(String(v.name));
|
|
415
|
+
return { ...v, entity: relName ?? `#${relId}` };
|
|
416
|
+
}
|
|
417
|
+
if (v.isDefault !== true) return v;
|
|
400
418
|
// `create()` falls back to the name 'record' only when there is no entity at all — not a name to copy.
|
|
401
419
|
if (typeof v.name !== "string" || !v.name || v.name === "record") return v;
|
|
402
420
|
filled.push(v.name);
|
|
403
421
|
return { ...v, entity: v.name };
|
|
404
422
|
});
|
|
405
|
-
return { variables: out, filled };
|
|
423
|
+
return { variables: out, filled, fromServer };
|
|
406
424
|
}
|
|
407
425
|
|
|
408
426
|
/**
|
|
@@ -2013,17 +2031,26 @@ export async function validateForm(input, { baseline = null, normalize = false,
|
|
|
2013
2031
|
// The default relation variable as read back from a tenant, entity restored for the CHECK
|
|
2014
2032
|
// (fillDefaultRelationEntity) — the draft handed back to a writer keeps it, writers send the file's list.
|
|
2015
2033
|
const filledDraft = fillDefaultRelationEntity(draft.variables);
|
|
2016
|
-
if (filledDraft.filled.length) {
|
|
2034
|
+
if (filledDraft.filled.length || filledDraft.fromServer.length) {
|
|
2017
2035
|
draft = { ...draft, variables: filledDraft.variables };
|
|
2018
2036
|
// The "what the repair silenced" comparison below re-checks the AUTHORED envelope; it must not
|
|
2019
2037
|
// report this fill as something --normalize swallowed.
|
|
2020
2038
|
env.draft = draft;
|
|
2039
|
+
}
|
|
2040
|
+
if (filledDraft.filled.length) {
|
|
2021
2041
|
notes.push(
|
|
2022
2042
|
`the default relation variable ${filledDraft.filled.map((n) => `'${n}'`).join(", ")} had no \`entity\` — the shape every ` +
|
|
2023
2043
|
"variable a tenant returns has, because FormVariables keeps no entity column — so it was checked as `entity` = its name, " +
|
|
2024
2044
|
"which is what the builder derives on open (FE core/utils/defaultVariableFactory.ts syncDefaultEntity).",
|
|
2025
2045
|
);
|
|
2026
2046
|
}
|
|
2047
|
+
if (filledDraft.fromServer.length) {
|
|
2048
|
+
notes.push(
|
|
2049
|
+
`the relation variable${filledDraft.fromServer.length > 1 ? "s" : ""} ${filledDraft.fromServer.map((n) => `'${n}'`).join(", ")} had no \`entity\` ` +
|
|
2050
|
+
"but carr" + (filledDraft.fromServer.length > 1 ? "y" : "ies") + " the server's `relationEntity` — where FormVariables keeps the target — so " +
|
|
2051
|
+
"the check took that as the target instead of reporting relation_missing_entity.",
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2027
2054
|
|
|
2028
2055
|
// The baseline is resolved FIRST: brand conformance skips elements the baseline already carries
|
|
2029
2056
|
// by id, which is what keeps an edit from being told off for a colour the form has had for a year.
|
|
@@ -2033,7 +2060,7 @@ export async function validateForm(input, { baseline = null, normalize = false,
|
|
|
2033
2060
|
if (b.error) notes.push(`the baseline was ignored: ${b.error.message}`);
|
|
2034
2061
|
else {
|
|
2035
2062
|
const filledBase = fillDefaultRelationEntity(b.draft.variables);
|
|
2036
|
-
baseDraft = filledBase.filled.length ? { ...b.draft, variables: filledBase.variables } : b.draft;
|
|
2063
|
+
baseDraft = filledBase.filled.length || filledBase.fromServer.length ? { ...b.draft, variables: filledBase.variables } : b.draft;
|
|
2037
2064
|
}
|
|
2038
2065
|
}
|
|
2039
2066
|
|
|
@@ -2451,7 +2478,7 @@ async function main(argv) {
|
|
|
2451
2478
|
* Was this file STARTED, or imported?
|
|
2452
2479
|
*
|
|
2453
2480
|
* Never compare `import.meta.url` against a hand-built `file:///` + path: the URL is
|
|
2454
|
-
* percent-encoded and the path is not, so an install under `C:\\Users\\
|
|
2481
|
+
* percent-encoded and the path is not, so an install under `C:\\Users\\JOHNDO~1\\…`
|
|
2455
2482
|
* (`%7E`), a path with a space, or a non-ASCII user name made this false — and the gate then exited
|
|
2456
2483
|
* 0 having printed nothing, which reads exactly like a pass. Compare realpaths, falling back to the
|
|
2457
2484
|
* encoded URL when a path cannot be resolved.
|