@neocompose/cli 0.48.2 → 0.49.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/neo.mjs
CHANGED
|
@@ -20094,16 +20094,8 @@ var init_project_source_construction_diagnostics = __esm({
|
|
|
20094
20094
|
"parameter-default-type-mismatch": "error",
|
|
20095
20095
|
/** §2.5 g. An initializer key naming no member of the constructed class. */
|
|
20096
20096
|
"unknown-initializer-member": "error",
|
|
20097
|
-
/**
|
|
20098
|
-
|
|
20099
|
-
*
|
|
20100
|
-
* Ships as a warning for this release (§5 step 1). A value seed whose
|
|
20101
|
-
* members are supplied by stored value rows rather than by initializer text
|
|
20102
|
-
* reads as unsettled to an analysis that only sees source, so promoting this
|
|
20103
|
-
* to an error would reject the existing corpus. Every other rule below is
|
|
20104
|
-
* decidable from source alone and is already an error.
|
|
20105
|
-
*/
|
|
20106
|
-
"unsettled-required-member": "warning",
|
|
20097
|
+
/** §2.5 f. Every construction must settle its required members. */
|
|
20098
|
+
"unsettled-required-member": "error",
|
|
20107
20099
|
/** §2.4. A declared constructor that is not a complete construction path. */
|
|
20108
20100
|
"constructor-unsettled-member": "error",
|
|
20109
20101
|
/** §2.4. An S1 header plus `init` block that is not a complete path. */
|
|
@@ -20989,19 +20981,34 @@ function buildNeoConstructionIndex(documents) {
|
|
|
20989
20981
|
}
|
|
20990
20982
|
return { classes, interfaceNames, requiredMemberCache: /* @__PURE__ */ new Map() };
|
|
20991
20983
|
}
|
|
20992
|
-
function requiredMembersForClass(index, className) {
|
|
20993
|
-
const
|
|
20984
|
+
function requiredMembersForClass(index, className, typeArguments = []) {
|
|
20985
|
+
const cacheKey = JSON.stringify([className, typeArguments]);
|
|
20986
|
+
const cached = index.requiredMemberCache.get(cacheKey);
|
|
20994
20987
|
if (cached) return cached;
|
|
20995
20988
|
const entry = index.classes.get(className);
|
|
20996
20989
|
if (!entry) return [];
|
|
20997
20990
|
const required2 = [];
|
|
20998
20991
|
const seen = /* @__PURE__ */ new Set();
|
|
20999
|
-
|
|
20992
|
+
const hops = baseChain(index, entry, typeArguments).hops;
|
|
20993
|
+
const defaults = /* @__PURE__ */ new Map();
|
|
20994
|
+
for (const hop of hops) {
|
|
20995
|
+
for (const member of hop.entry.declaration.members) {
|
|
20996
|
+
if (member.kind !== "field") continue;
|
|
20997
|
+
const key = member.name.toLowerCase();
|
|
20998
|
+
if (defaults.has(key)) continue;
|
|
20999
|
+
if (member.initializer !== void 0 || member.flowInitializer !== void 0)
|
|
21000
|
+
defaults.set(key, member);
|
|
21001
|
+
}
|
|
21002
|
+
}
|
|
21003
|
+
for (const hop of hops) {
|
|
21000
21004
|
for (const member of hop.entry.declaration.members) {
|
|
21001
21005
|
const key = member.name.toLowerCase();
|
|
21002
21006
|
if (seen.has(key)) continue;
|
|
21003
21007
|
seen.add(key);
|
|
21004
21008
|
if (!isRequiredMember(member, hop.bindings)) continue;
|
|
21009
|
+
const declaredDefault = defaults.get(key);
|
|
21010
|
+
if (declaredDefault !== void 0 && declaredDefault.initializer?.text.trim() !== "null")
|
|
21011
|
+
continue;
|
|
21005
21012
|
required2.push({
|
|
21006
21013
|
name: member.name,
|
|
21007
21014
|
declaringClassName: hop.entry.declaration.name,
|
|
@@ -21010,16 +21017,16 @@ function requiredMembersForClass(index, className) {
|
|
|
21010
21017
|
});
|
|
21011
21018
|
}
|
|
21012
21019
|
}
|
|
21013
|
-
index.requiredMemberCache.set(
|
|
21020
|
+
index.requiredMemberCache.set(cacheKey, required2);
|
|
21014
21021
|
return required2;
|
|
21015
21022
|
}
|
|
21016
|
-
function unsettledRequiredMembers(index, className, settledNames) {
|
|
21023
|
+
function unsettledRequiredMembers(index, className, settledNames, typeArguments = []) {
|
|
21017
21024
|
const entry = index.classes.get(className);
|
|
21018
21025
|
if (!entry) return [];
|
|
21019
21026
|
const settled = /* @__PURE__ */ new Set();
|
|
21020
21027
|
for (const name of settledNames) settled.add(name.toLowerCase());
|
|
21021
21028
|
for (const name of declarationSettledMembers(index, entry)) settled.add(name);
|
|
21022
|
-
return requiredMembersForClass(index, className).filter(
|
|
21029
|
+
return requiredMembersForClass(index, className, typeArguments).filter(
|
|
21023
21030
|
(member) => !settled.has(member.name.toLowerCase())
|
|
21024
21031
|
);
|
|
21025
21032
|
}
|
|
@@ -21046,7 +21053,8 @@ function validateNeoConstructionSite(index, call) {
|
|
|
21046
21053
|
const unsettled = unsettledRequiredMembers(
|
|
21047
21054
|
index,
|
|
21048
21055
|
call.className,
|
|
21049
|
-
call.initializerNames
|
|
21056
|
+
call.initializerNames,
|
|
21057
|
+
call.typeArguments
|
|
21050
21058
|
);
|
|
21051
21059
|
if (unsettled.length > 0) {
|
|
21052
21060
|
diagnostics.push({
|
|
@@ -21080,6 +21088,7 @@ function validateBaseConstruction(index, entry, diagnostics) {
|
|
|
21080
21088
|
}
|
|
21081
21089
|
for (const diagnostic of validateNeoConstructionSite(index, {
|
|
21082
21090
|
className: baseClause.type.name,
|
|
21091
|
+
typeArguments: baseClause.type.typeArguments.map(typeShape),
|
|
21083
21092
|
argumentNames: (baseClause.arguments ?? []).map(
|
|
21084
21093
|
(argument2) => argument2.name ?? null
|
|
21085
21094
|
),
|
|
@@ -21354,11 +21363,16 @@ function stripOuterBraces(text) {
|
|
|
21354
21363
|
const trimmed = text.trim();
|
|
21355
21364
|
return trimmed.startsWith("{") && trimmed.endsWith("}") ? trimmed.slice(1, -1) : text;
|
|
21356
21365
|
}
|
|
21357
|
-
function baseChain(index, start) {
|
|
21366
|
+
function baseChain(index, start, typeArguments = []) {
|
|
21358
21367
|
const hops = [];
|
|
21359
21368
|
const visited = /* @__PURE__ */ new Set();
|
|
21360
21369
|
let current = start;
|
|
21361
|
-
let bindings =
|
|
21370
|
+
let bindings = new Map(
|
|
21371
|
+
start.declaration.genericParameters.flatMap((parameter4, position) => {
|
|
21372
|
+
const argument2 = typeArguments[position];
|
|
21373
|
+
return argument2 === void 0 ? [] : [[parameter4.name, argument2]];
|
|
21374
|
+
})
|
|
21375
|
+
);
|
|
21362
21376
|
let complete2 = true;
|
|
21363
21377
|
while (current !== void 0 && !visited.has(current.declaration.name)) {
|
|
21364
21378
|
visited.add(current.declaration.name);
|
|
@@ -21412,12 +21426,17 @@ function typeShape(type) {
|
|
|
21412
21426
|
}
|
|
21413
21427
|
function substitute(type, bindings) {
|
|
21414
21428
|
const bound = bindings.get(type.name);
|
|
21415
|
-
if (bound !== void 0 && type.arguments
|
|
21416
|
-
return {
|
|
21429
|
+
if (bound !== void 0 && (type.arguments?.length ?? 0) === 0) {
|
|
21430
|
+
return {
|
|
21431
|
+
...bound,
|
|
21432
|
+
nullable: bound.nullable === true || type.nullable === true
|
|
21433
|
+
};
|
|
21417
21434
|
}
|
|
21418
21435
|
return {
|
|
21419
21436
|
...type,
|
|
21420
|
-
arguments: type.arguments.map(
|
|
21437
|
+
arguments: (type.arguments ?? []).map(
|
|
21438
|
+
(argument2) => substitute(argument2, bindings)
|
|
21439
|
+
)
|
|
21421
21440
|
};
|
|
21422
21441
|
}
|
|
21423
21442
|
function describeParameterList(className, parameters) {
|
|
@@ -23086,6 +23105,7 @@ function validateExpression(expression, expected, scope, environment, uri, range
|
|
|
23086
23105
|
environment.construction,
|
|
23087
23106
|
{
|
|
23088
23107
|
className: declaration.name,
|
|
23108
|
+
typeArguments: expression.typeArguments?.map(semanticAstType) ?? (expression.className === null ? expected?.arguments : void 0) ?? [],
|
|
23089
23109
|
argumentNames: variantSite?.argumentNames ?? siteArgumentNames,
|
|
23090
23110
|
initializerNames: variantSite?.initializerNames ?? siteInitializerNames
|
|
23091
23111
|
}
|
|
@@ -38022,7 +38042,7 @@ function memberToDocumentFields(member, baseData3) {
|
|
|
38022
38042
|
}
|
|
38023
38043
|
function preserveOverrideNulls(fields, member, baseData3) {
|
|
38024
38044
|
if (member.overrideOf === null || baseData3 === void 0) return;
|
|
38025
|
-
for (const field of
|
|
38045
|
+
for (const field of NULLABLE_OVERRIDE_MEMBER_FIELDS) {
|
|
38026
38046
|
if (Object.hasOwn(baseData3, field) && baseData3[field] === null) {
|
|
38027
38047
|
fields[field] = null;
|
|
38028
38048
|
}
|
|
@@ -38782,7 +38802,7 @@ function invalidDocument(record4, path, message) {
|
|
|
38782
38802
|
`${record4.recordKind}:${record4.recordId}.${path} ${message}.`
|
|
38783
38803
|
);
|
|
38784
38804
|
}
|
|
38785
|
-
var MEMBER_KIND, MEMBER_MODIFIERS, MEMBER_ACCESS, MEMBER_STORAGE, MEMBER_DISTRIBUTION, STRING_FORMAT, MEMBER_SEARCH_BY, MEMBER_SELECTION, FUNCTION_DISPATCH, FUNCTION_BODY, MEMBER_PAYLOAD, DICTIONARY_KEY, LIST_KIND, LIST_INDEX, COLUMN_VISIBILITY, COLUMN_PIN, COLUMN_OVERFLOW, GENERIC_BINDING, TYPE_KIND_BY_MEMBER_KIND, SIMPLE_MEMBER_KIND_BY_KIND, MEMBER_KIND_BY_KIND, TYPE_MEMBER_KIND_BY_KIND, MEMBER_IDENTITY_FIELDS, INHERITED_MEMBER_ORDINAL_FIELDS,
|
|
38805
|
+
var MEMBER_KIND, MEMBER_MODIFIERS, MEMBER_ACCESS, MEMBER_STORAGE, MEMBER_DISTRIBUTION, STRING_FORMAT, MEMBER_SEARCH_BY, MEMBER_SELECTION, FUNCTION_DISPATCH, FUNCTION_BODY, MEMBER_PAYLOAD, DICTIONARY_KEY, LIST_KIND, LIST_INDEX, COLUMN_VISIBILITY, COLUMN_PIN, COLUMN_OVERFLOW, GENERIC_BINDING, TYPE_KIND_BY_MEMBER_KIND, SIMPLE_MEMBER_KIND_BY_KIND, MEMBER_KIND_BY_KIND, TYPE_MEMBER_KIND_BY_KIND, MEMBER_IDENTITY_FIELDS, INHERITED_MEMBER_ORDINAL_FIELDS, NULLABLE_OVERRIDE_MEMBER_FIELDS;
|
|
38786
38806
|
var init_codecs = __esm({
|
|
38787
38807
|
"src/project-manifest/record-adapters/codecs.ts"() {
|
|
38788
38808
|
"use strict";
|
|
@@ -38925,7 +38945,7 @@ var init_codecs = __esm({
|
|
|
38925
38945
|
"dispatch",
|
|
38926
38946
|
"bodyMode"
|
|
38927
38947
|
]);
|
|
38928
|
-
|
|
38948
|
+
NULLABLE_OVERRIDE_MEMBER_FIELDS = [
|
|
38929
38949
|
"defaultValue",
|
|
38930
38950
|
"storageKey",
|
|
38931
38951
|
"minValue",
|
|
@@ -44162,36 +44182,36 @@ var MemberKind;
|
|
|
44162
44182
|
var init_member_kind_enum = __esm({
|
|
44163
44183
|
"../src/models/members/member-kind-enum.ts"() {
|
|
44164
44184
|
"use strict";
|
|
44165
|
-
MemberKind = /* @__PURE__ */ ((
|
|
44166
|
-
|
|
44167
|
-
|
|
44168
|
-
|
|
44169
|
-
|
|
44170
|
-
|
|
44171
|
-
|
|
44172
|
-
|
|
44173
|
-
|
|
44174
|
-
|
|
44175
|
-
|
|
44176
|
-
|
|
44177
|
-
|
|
44178
|
-
|
|
44179
|
-
|
|
44180
|
-
|
|
44181
|
-
|
|
44182
|
-
|
|
44183
|
-
|
|
44184
|
-
|
|
44185
|
-
|
|
44186
|
-
|
|
44187
|
-
|
|
44188
|
-
|
|
44189
|
-
|
|
44190
|
-
|
|
44191
|
-
|
|
44192
|
-
|
|
44193
|
-
|
|
44194
|
-
return
|
|
44185
|
+
MemberKind = /* @__PURE__ */ ((MemberKind15) => {
|
|
44186
|
+
MemberKind15[MemberKind15["Null"] = 0] = "Null";
|
|
44187
|
+
MemberKind15[MemberKind15["Bool"] = 1] = "Bool";
|
|
44188
|
+
MemberKind15[MemberKind15["Int"] = 2] = "Int";
|
|
44189
|
+
MemberKind15[MemberKind15["String"] = 3] = "String";
|
|
44190
|
+
MemberKind15[MemberKind15["Float"] = 4] = "Float";
|
|
44191
|
+
MemberKind15[MemberKind15["Dictionary"] = 5] = "Dictionary";
|
|
44192
|
+
MemberKind15[MemberKind15["List"] = 6] = "List";
|
|
44193
|
+
MemberKind15[MemberKind15["Class"] = 7] = "Class";
|
|
44194
|
+
MemberKind15[MemberKind15["Enum"] = 8] = "Enum";
|
|
44195
|
+
MemberKind15[MemberKind15["Lookup"] = 9] = "Lookup";
|
|
44196
|
+
MemberKind15[MemberKind15["NSProperty"] = 10] = "NSProperty";
|
|
44197
|
+
MemberKind15[MemberKind15["Sprite"] = 11] = "Sprite";
|
|
44198
|
+
MemberKind15[MemberKind15["Audio"] = 12] = "Audio";
|
|
44199
|
+
MemberKind15[MemberKind15["Function"] = 13] = "Function";
|
|
44200
|
+
MemberKind15[MemberKind15["Vector2"] = 14] = "Vector2";
|
|
44201
|
+
MemberKind15[MemberKind15["Vector2Int"] = 15] = "Vector2Int";
|
|
44202
|
+
MemberKind15[MemberKind15["Vector3"] = 16] = "Vector3";
|
|
44203
|
+
MemberKind15[MemberKind15["Vector3Int"] = 17] = "Vector3Int";
|
|
44204
|
+
MemberKind15[MemberKind15["DialogueLookup"] = 18] = "DialogueLookup";
|
|
44205
|
+
MemberKind15[MemberKind15["Color"] = 19] = "Color";
|
|
44206
|
+
MemberKind15[MemberKind15["Decimal"] = 20] = "Decimal";
|
|
44207
|
+
MemberKind15[MemberKind15["Generic"] = 21] = "Generic";
|
|
44208
|
+
MemberKind15[MemberKind15["Interface"] = 22] = "Interface";
|
|
44209
|
+
MemberKind15[MemberKind15["NSFunction"] = 23] = "NSFunction";
|
|
44210
|
+
MemberKind15[MemberKind15["FunctionRef"] = 24] = "FunctionRef";
|
|
44211
|
+
MemberKind15[MemberKind15["NSDelegate"] = 25] = "NSDelegate";
|
|
44212
|
+
MemberKind15[MemberKind15["NSAction"] = 26] = "NSAction";
|
|
44213
|
+
MemberKind15[MemberKind15["Variant"] = 27] = "Variant";
|
|
44214
|
+
return MemberKind15;
|
|
44195
44215
|
})(MemberKind || {});
|
|
44196
44216
|
}
|
|
44197
44217
|
});
|
|
@@ -46054,6 +46074,7 @@ function isGenericParamDeclaration(value) {
|
|
|
46054
46074
|
function isGenericBinding(value) {
|
|
46055
46075
|
const v = value;
|
|
46056
46076
|
if (!v || typeof v !== "object") return false;
|
|
46077
|
+
if (Object.hasOwn(v, "defaultValue")) return false;
|
|
46057
46078
|
if (v.kind === void 0 || v.kind === 0 /* Generic */) {
|
|
46058
46079
|
if (typeof v.genericParamId !== "string") return false;
|
|
46059
46080
|
if (v.genericParamId.length === 0) return false;
|
|
@@ -47370,7 +47391,7 @@ function isAnyMember(value) {
|
|
|
47370
47391
|
function isAnyMemberAuthoredOrCompiled(value) {
|
|
47371
47392
|
return isAnyMember(value) || isUncompiledMemberNSFunctionOverride(value);
|
|
47372
47393
|
}
|
|
47373
|
-
var FunctionArgumentReservedNames, NSFunctionArgumentReservedNames, ListKind,
|
|
47394
|
+
var FunctionArgumentReservedNames, NSFunctionArgumentReservedNames, ListKind, CHAIN_RESOLVED_OPTIONAL_MEMBER_FIELDS, MEMBER_ACCESS_KINDS, DECIMAL_STRING_PATTERN, DECIMAL_MAX_SIGNIFICANT_DIGITS, DECIMAL_MAX_SCALE;
|
|
47374
47395
|
var init_member_kinds = __esm({
|
|
47375
47396
|
"../src/models/members/member-kinds.ts"() {
|
|
47376
47397
|
"use strict";
|
|
@@ -47400,8 +47421,7 @@ var init_member_kinds = __esm({
|
|
|
47400
47421
|
ListKind3[ListKind3["Unordered"] = 1] = "Unordered";
|
|
47401
47422
|
return ListKind3;
|
|
47402
47423
|
})(ListKind || {});
|
|
47403
|
-
|
|
47404
|
-
"defaultValue",
|
|
47424
|
+
CHAIN_RESOLVED_OPTIONAL_MEMBER_FIELDS = [
|
|
47405
47425
|
"storageKey",
|
|
47406
47426
|
"minValue",
|
|
47407
47427
|
"maxValue",
|
|
@@ -47884,6 +47904,7 @@ function resolveMemberWithIndex(member, memberIndex) {
|
|
|
47884
47904
|
for (const link of chain) {
|
|
47885
47905
|
for (const [key, value] of Object.entries(link)) {
|
|
47886
47906
|
if (value === void 0) continue;
|
|
47907
|
+
if (key === "defaultValue" && value === null) continue;
|
|
47887
47908
|
merged[key] = value;
|
|
47888
47909
|
}
|
|
47889
47910
|
if (getField(link, "code") === null) {
|
|
@@ -47896,7 +47917,7 @@ function resolveMemberWithIndex(member, memberIndex) {
|
|
|
47896
47917
|
}
|
|
47897
47918
|
}
|
|
47898
47919
|
delete merged.extendsMemberId;
|
|
47899
|
-
for (const field of
|
|
47920
|
+
for (const field of CHAIN_RESOLVED_OPTIONAL_MEMBER_FIELDS) {
|
|
47900
47921
|
if (merged[field] === null) delete merged[field];
|
|
47901
47922
|
}
|
|
47902
47923
|
if (member.mutability === void 0) {
|
|
@@ -47911,7 +47932,6 @@ function resolveMemberWithIndex(member, memberIndex) {
|
|
|
47911
47932
|
}
|
|
47912
47933
|
if (member.kind === 21 /* Generic */) {
|
|
47913
47934
|
if (member.requirement === void 0) delete merged.requirement;
|
|
47914
|
-
if (member.defaultValue === void 0) delete merged.defaultValue;
|
|
47915
47935
|
}
|
|
47916
47936
|
return Object.freeze(merged);
|
|
47917
47937
|
}
|
|
@@ -50054,8 +50074,10 @@ function substituteMember(member, env, members, preResolvedMember) {
|
|
|
50054
50074
|
access: resolved.access,
|
|
50055
50075
|
system: resolved.system ?? void 0
|
|
50056
50076
|
};
|
|
50057
|
-
if (resolved.defaultValue
|
|
50077
|
+
if (resolved.defaultValue != null) {
|
|
50058
50078
|
substituted.defaultValue = resolved.defaultValue;
|
|
50079
|
+
} else {
|
|
50080
|
+
delete substituted.defaultValue;
|
|
50059
50081
|
}
|
|
50060
50082
|
const slotId = getOptionalString(member, "id");
|
|
50061
50083
|
if (slotId !== void 0) {
|
|
@@ -51021,9 +51043,9 @@ function assertReadOnlyMembersValid(document) {
|
|
|
51021
51043
|
);
|
|
51022
51044
|
}
|
|
51023
51045
|
if (isAbstractMember(member) === true) continue;
|
|
51024
|
-
if (effective.defaultValue
|
|
51046
|
+
if (effective.defaultValue == null) {
|
|
51025
51047
|
throw new Error(
|
|
51026
|
-
`Read-only member "${member.name}" (${member.id}) requires an explicit defaultValue
|
|
51048
|
+
`Read-only member "${member.name}" (${member.id}) requires an explicit field defaultValue in every closed Generic placement; ${ownerContext}.`
|
|
51027
51049
|
);
|
|
51028
51050
|
}
|
|
51029
51051
|
if (isMemberStringBase(effective) && effective.searchBy === 1 /* MemberKey */) {
|
|
@@ -51910,6 +51932,403 @@ var init_storage_partitions = __esm({
|
|
|
51910
51932
|
}
|
|
51911
51933
|
});
|
|
51912
51934
|
|
|
51935
|
+
// ../src/models/constructors/constructors.ts
|
|
51936
|
+
function hasRejectedConstructorKey(value) {
|
|
51937
|
+
return REJECTED_CONSTRUCTOR_KEYS.some((key) => value[key] !== void 0);
|
|
51938
|
+
}
|
|
51939
|
+
function isNamedBaseClauseEntry(value, nameIsValid) {
|
|
51940
|
+
if (typeof value !== "object" || value === null) return false;
|
|
51941
|
+
if (Array.isArray(value)) return false;
|
|
51942
|
+
const candidate = value;
|
|
51943
|
+
if (!Object.keys(candidate).every((key) => key === "name" || key === "code")) {
|
|
51944
|
+
return false;
|
|
51945
|
+
}
|
|
51946
|
+
if (!nameIsValid(candidate.name)) return false;
|
|
51947
|
+
if (typeof candidate.code !== "string") return false;
|
|
51948
|
+
return candidate.code.length > 0;
|
|
51949
|
+
}
|
|
51950
|
+
function isNeoConstructorBaseArgument(value) {
|
|
51951
|
+
return isNamedBaseClauseEntry(value, isValidCallableArgumentIdentifier);
|
|
51952
|
+
}
|
|
51953
|
+
function isNeoConstructorBaseInitializerField(value) {
|
|
51954
|
+
return isNamedBaseClauseEntry(value, isValidSchemaMemberIdentifier);
|
|
51955
|
+
}
|
|
51956
|
+
function isNeoClassConstructorBase(value) {
|
|
51957
|
+
if (typeof value !== "object" || value === null) return false;
|
|
51958
|
+
if (Array.isArray(value)) return false;
|
|
51959
|
+
const v = value;
|
|
51960
|
+
if (hasRejectedConstructorKey(v)) return false;
|
|
51961
|
+
if (!isValidDocsText(v.docsText)) return false;
|
|
51962
|
+
if (typeof v.classId !== "string") return false;
|
|
51963
|
+
if (v.classId.length === 0) return false;
|
|
51964
|
+
if (typeof v.code !== "string" && v.code !== null) return false;
|
|
51965
|
+
if (!Array.isArray(v.argumentTypes)) return false;
|
|
51966
|
+
const parameterNames = /* @__PURE__ */ new Set();
|
|
51967
|
+
const argumentTypes = [];
|
|
51968
|
+
for (const argument2 of v.argumentTypes) {
|
|
51969
|
+
if (!isNSFunctionArgumentTypeInfo(argument2)) return false;
|
|
51970
|
+
if (!isValidCallableArgumentIdentifier(argument2.name)) return false;
|
|
51971
|
+
if (parameterNames.has(argument2.name)) return false;
|
|
51972
|
+
parameterNames.add(argument2.name);
|
|
51973
|
+
argumentTypes.push(argument2);
|
|
51974
|
+
}
|
|
51975
|
+
if (validateParameterDefaults(argumentTypes).length > 0) return false;
|
|
51976
|
+
if (v.baseArguments !== void 0 && v.baseArguments !== null) {
|
|
51977
|
+
if (!Array.isArray(v.baseArguments)) return false;
|
|
51978
|
+
const baseNames = /* @__PURE__ */ new Set();
|
|
51979
|
+
for (const baseArgument of v.baseArguments) {
|
|
51980
|
+
if (!isNeoConstructorBaseArgument(baseArgument)) return false;
|
|
51981
|
+
if (baseNames.has(baseArgument.name)) return false;
|
|
51982
|
+
baseNames.add(baseArgument.name);
|
|
51983
|
+
}
|
|
51984
|
+
}
|
|
51985
|
+
if (v.baseInitializerFields !== void 0 && v.baseInitializerFields !== null) {
|
|
51986
|
+
if (!Array.isArray(v.baseInitializerFields)) return false;
|
|
51987
|
+
const fieldNames = /* @__PURE__ */ new Set();
|
|
51988
|
+
for (const field of v.baseInitializerFields) {
|
|
51989
|
+
if (!isNeoConstructorBaseInitializerField(field)) return false;
|
|
51990
|
+
if (fieldNames.has(field.name)) return false;
|
|
51991
|
+
fieldNames.add(field.name);
|
|
51992
|
+
}
|
|
51993
|
+
}
|
|
51994
|
+
if (v.action !== void 0 && v.action !== null) return false;
|
|
51995
|
+
if (v.compiledBaseArguments !== void 0 && v.compiledBaseArguments !== null) {
|
|
51996
|
+
return false;
|
|
51997
|
+
}
|
|
51998
|
+
return v.compiledBaseInitializerFields === void 0 || v.compiledBaseInitializerFields === null;
|
|
51999
|
+
}
|
|
52000
|
+
function isUncompiledNeoClassConstructor(value) {
|
|
52001
|
+
if (!isNeoClassConstructorBase(value)) return false;
|
|
52002
|
+
const v = value;
|
|
52003
|
+
if (typeof v.id !== "string" || v.id.length === 0) return false;
|
|
52004
|
+
if (typeof v.projectId !== "string" || v.projectId.length === 0) return false;
|
|
52005
|
+
if (!isEpochMillis(v.createdAt)) return false;
|
|
52006
|
+
return isEpochMillis(v.updatedAt);
|
|
52007
|
+
}
|
|
52008
|
+
function hasValidConstructorAction(action, argumentTypes) {
|
|
52009
|
+
if (!isNSFunctionWithReturnType(action)) return false;
|
|
52010
|
+
if (action.typeInfo.type !== 0 /* Null */) return false;
|
|
52011
|
+
if (action.typeInfo.required !== true) return false;
|
|
52012
|
+
if (action.parameters.length !== argumentTypes.length + 2) return false;
|
|
52013
|
+
if (action.parameters[0]?.id !== "__this__") return false;
|
|
52014
|
+
if (action.parameters[1]?.id !== "__root__") return false;
|
|
52015
|
+
for (let index = 0; index < argumentTypes.length; index += 1) {
|
|
52016
|
+
const parameter4 = action.parameters[index + 2];
|
|
52017
|
+
if (parameter4?.id !== `__arg_${index}__`) return false;
|
|
52018
|
+
const declared = argumentTypes[index];
|
|
52019
|
+
if (declared === void 0) return false;
|
|
52020
|
+
if (!typeInfosInvariantlyEqual(parameter4.typeInfo, declared)) return false;
|
|
52021
|
+
}
|
|
52022
|
+
return true;
|
|
52023
|
+
}
|
|
52024
|
+
function compiledBaseClauseGettersAlign(compiled, authored) {
|
|
52025
|
+
const authoredCount = Array.isArray(authored) ? authored.length : 0;
|
|
52026
|
+
if (compiled === void 0 || compiled === null) return authoredCount === 0;
|
|
52027
|
+
if (!Array.isArray(compiled)) return false;
|
|
52028
|
+
if (!compiled.every(isNSGetter)) return false;
|
|
52029
|
+
return compiled.length === authoredCount;
|
|
52030
|
+
}
|
|
52031
|
+
function isNeoClassConstructorProps(value) {
|
|
52032
|
+
if (typeof value !== "object" || value === null) return false;
|
|
52033
|
+
const v = value;
|
|
52034
|
+
const {
|
|
52035
|
+
action: _action,
|
|
52036
|
+
compiledBaseArguments: _compiledBaseArguments,
|
|
52037
|
+
compiledBaseInitializerFields: _compiledBaseInitializerFields,
|
|
52038
|
+
...authored
|
|
52039
|
+
} = v;
|
|
52040
|
+
void _action;
|
|
52041
|
+
void _compiledBaseArguments;
|
|
52042
|
+
void _compiledBaseInitializerFields;
|
|
52043
|
+
if (!isNeoClassConstructorBase(authored)) return false;
|
|
52044
|
+
if (typeof v.id !== "string") return false;
|
|
52045
|
+
if (v.id.length === 0) return false;
|
|
52046
|
+
if (typeof v.projectId !== "string") return false;
|
|
52047
|
+
if (!isEpochMillis(v.createdAt)) return false;
|
|
52048
|
+
if (!isEpochMillis(v.updatedAt)) return false;
|
|
52049
|
+
const argumentTypes = v.argumentTypes;
|
|
52050
|
+
if (!hasValidConstructorAction(v.action, argumentTypes)) return false;
|
|
52051
|
+
if (!compiledBaseClauseGettersAlign(v.compiledBaseArguments, v.baseArguments)) {
|
|
52052
|
+
return false;
|
|
52053
|
+
}
|
|
52054
|
+
return compiledBaseClauseGettersAlign(
|
|
52055
|
+
v.compiledBaseInitializerFields,
|
|
52056
|
+
v.baseInitializerFields
|
|
52057
|
+
);
|
|
52058
|
+
}
|
|
52059
|
+
function isNeoClassConstructor(value) {
|
|
52060
|
+
return isNeoClassConstructorProps(value);
|
|
52061
|
+
}
|
|
52062
|
+
function constructorActionParameterId(constructor2, index) {
|
|
52063
|
+
const action = "action" in constructor2 ? constructor2.action : void 0;
|
|
52064
|
+
if (action !== null && typeof action === "object") {
|
|
52065
|
+
const parameters = action.parameters;
|
|
52066
|
+
if (Array.isArray(parameters)) {
|
|
52067
|
+
const parameter4 = parameters[index + 2];
|
|
52068
|
+
if (parameter4 !== null && typeof parameter4 === "object" && typeof parameter4.id === "string") {
|
|
52069
|
+
return parameter4.id;
|
|
52070
|
+
}
|
|
52071
|
+
}
|
|
52072
|
+
}
|
|
52073
|
+
return `__arg_${index}__`;
|
|
52074
|
+
}
|
|
52075
|
+
var REJECTED_CONSTRUCTOR_KEYS;
|
|
52076
|
+
var init_constructors = __esm({
|
|
52077
|
+
"../src/models/constructors/constructors.ts"() {
|
|
52078
|
+
"use strict";
|
|
52079
|
+
init_core();
|
|
52080
|
+
init_docs_text2();
|
|
52081
|
+
init_member_kinds();
|
|
52082
|
+
init_schema_identifiers();
|
|
52083
|
+
init_neoscript();
|
|
52084
|
+
REJECTED_CONSTRUCTOR_KEYS = [
|
|
52085
|
+
"bodyMode",
|
|
52086
|
+
"uiAction",
|
|
52087
|
+
"returnTypeInfo",
|
|
52088
|
+
"deferred"
|
|
52089
|
+
];
|
|
52090
|
+
}
|
|
52091
|
+
});
|
|
52092
|
+
|
|
52093
|
+
// ../src/models/constructors/index.ts
|
|
52094
|
+
var init_constructors2 = __esm({
|
|
52095
|
+
"../src/models/constructors/index.ts"() {
|
|
52096
|
+
"use strict";
|
|
52097
|
+
init_constructors();
|
|
52098
|
+
}
|
|
52099
|
+
});
|
|
52100
|
+
|
|
52101
|
+
// ../src/models/classes/construction-requirements.ts
|
|
52102
|
+
function requiredMembersForConstruction(classId, document, classArguments2) {
|
|
52103
|
+
return unsettledMembers(
|
|
52104
|
+
classId,
|
|
52105
|
+
contextFor(document),
|
|
52106
|
+
classArguments2,
|
|
52107
|
+
/* @__PURE__ */ new Set()
|
|
52108
|
+
);
|
|
52109
|
+
}
|
|
52110
|
+
function contextFor(document, env = /* @__PURE__ */ new Map()) {
|
|
52111
|
+
return {
|
|
52112
|
+
document,
|
|
52113
|
+
membersById: new Map(document.members.map((member) => [member.id, member])),
|
|
52114
|
+
env
|
|
52115
|
+
};
|
|
52116
|
+
}
|
|
52117
|
+
function unsettledMembers(classId, context, classArguments2, path) {
|
|
52118
|
+
const previousEnv = context.env;
|
|
52119
|
+
context.env = resolveInstanceEnv(
|
|
52120
|
+
classId,
|
|
52121
|
+
classArguments2,
|
|
52122
|
+
context.document.classes
|
|
52123
|
+
);
|
|
52124
|
+
try {
|
|
52125
|
+
return constructionMembers(classId, context).filter(
|
|
52126
|
+
({ member }) => isRequiredMember2(member) && !defaultSettlesConstruction(member, context, path)
|
|
52127
|
+
);
|
|
52128
|
+
} finally {
|
|
52129
|
+
context.env = previousEnv;
|
|
52130
|
+
}
|
|
52131
|
+
}
|
|
52132
|
+
function constructionMembers(classId, context) {
|
|
52133
|
+
const { document, membersById, env } = context;
|
|
52134
|
+
if (firstUnboundParamId(env) !== null) return [];
|
|
52135
|
+
const result = [];
|
|
52136
|
+
for (const entry of mergeStoredInstanceSchema(
|
|
52137
|
+
classId,
|
|
52138
|
+
document.classes,
|
|
52139
|
+
document.members
|
|
52140
|
+
)) {
|
|
52141
|
+
const raw = membersById.get(entry.memberId);
|
|
52142
|
+
if (raw === void 0) continue;
|
|
52143
|
+
const member = {
|
|
52144
|
+
...raw,
|
|
52145
|
+
...substituteMember(
|
|
52146
|
+
raw,
|
|
52147
|
+
env,
|
|
52148
|
+
document.members,
|
|
52149
|
+
resolveMember2(raw, document.members)
|
|
52150
|
+
),
|
|
52151
|
+
id: raw.id
|
|
52152
|
+
};
|
|
52153
|
+
if (isAbstractMember(member)) continue;
|
|
52154
|
+
if (isReadOnlyMember(member)) continue;
|
|
52155
|
+
if (!memberKindOwnsStoredValue(member.kind)) continue;
|
|
52156
|
+
if ("payload" in member && member.payload === 1 /* Partial */)
|
|
52157
|
+
continue;
|
|
52158
|
+
result.push({ schemaKey: entry.schemaKey, member });
|
|
52159
|
+
}
|
|
52160
|
+
return result;
|
|
52161
|
+
}
|
|
52162
|
+
function storedValueSettlesConstruction(member, sourceValue, document, genericEnv) {
|
|
52163
|
+
return valueSettlesConstruction(
|
|
52164
|
+
member,
|
|
52165
|
+
sourceValue,
|
|
52166
|
+
contextFor(document, genericEnv),
|
|
52167
|
+
/* @__PURE__ */ new Set(),
|
|
52168
|
+
true
|
|
52169
|
+
);
|
|
52170
|
+
}
|
|
52171
|
+
function defaultSettlesConstruction(member, context, path) {
|
|
52172
|
+
const body = member.defaultValue;
|
|
52173
|
+
if (body == null) return false;
|
|
52174
|
+
return valueSettlesConstruction(member, body, context, path);
|
|
52175
|
+
}
|
|
52176
|
+
function valueSettlesConstruction(member, body, context, path, storedRow = false) {
|
|
52177
|
+
if (isInitValueContent(body)) return true;
|
|
52178
|
+
const value = body.value;
|
|
52179
|
+
if (value == null) return !isRequiredMember2(member);
|
|
52180
|
+
const isClass = isMemberClassBase(member);
|
|
52181
|
+
const isCollection = isMemberListBase(member) || isMemberDictionaryBase(member);
|
|
52182
|
+
if (!isClass && !isCollection) return true;
|
|
52183
|
+
if (isClass && member.payload === 1 /* Partial */) return true;
|
|
52184
|
+
if (typeof value !== "object") return false;
|
|
52185
|
+
if (path.has(value)) return false;
|
|
52186
|
+
path.add(value);
|
|
52187
|
+
const previousEnv = context.env;
|
|
52188
|
+
try {
|
|
52189
|
+
if (isCollection) {
|
|
52190
|
+
if (body.genericBindings != null)
|
|
52191
|
+
context.env = envFromStamp(body.genericBindings);
|
|
52192
|
+
const entry = context.membersById.get(member.entryMemberId);
|
|
52193
|
+
if (entry === void 0) return false;
|
|
52194
|
+
const resolvedEntry = substituteMember(
|
|
52195
|
+
entry,
|
|
52196
|
+
context.env,
|
|
52197
|
+
context.document.members
|
|
52198
|
+
);
|
|
52199
|
+
const entries = Array.isArray(value) ? value : Object.values(value);
|
|
52200
|
+
return entries.every(
|
|
52201
|
+
(entryValue) => suppliedValueSettlesConstruction(
|
|
52202
|
+
resolvedEntry,
|
|
52203
|
+
entryValue,
|
|
52204
|
+
context,
|
|
52205
|
+
path
|
|
52206
|
+
)
|
|
52207
|
+
);
|
|
52208
|
+
}
|
|
52209
|
+
if (!isClass || Array.isArray(value)) return false;
|
|
52210
|
+
const classId = body.classId ?? member.classId;
|
|
52211
|
+
const constructor2 = typeof body.instanceConstructorId === "string" ? context.document.constructors.find(
|
|
52212
|
+
(record4) => record4.id === body.instanceConstructorId && record4.classId === classId
|
|
52213
|
+
) : void 0;
|
|
52214
|
+
if (typeof body.instanceConstructorId === "string" && constructor2 === void 0)
|
|
52215
|
+
return false;
|
|
52216
|
+
if (constructor2 !== void 0 && constructor2.argumentTypes.some(
|
|
52217
|
+
(argument2, index) => !parameterHasDefault(argument2) && !Object.hasOwn(
|
|
52218
|
+
body.constructorArgs ?? {},
|
|
52219
|
+
constructorActionParameterId(constructor2, index)
|
|
52220
|
+
)
|
|
52221
|
+
))
|
|
52222
|
+
return false;
|
|
52223
|
+
const requiredConstructorId2 = context.document.classes.find(
|
|
52224
|
+
(schemaClass2) => schemaClass2.id === classId
|
|
52225
|
+
)?.requiredConstructorId;
|
|
52226
|
+
if (typeof requiredConstructorId2 === "string" && constructor2?.id !== requiredConstructorId2 && !(storedRow && body.instanceConstructorId == null))
|
|
52227
|
+
return false;
|
|
52228
|
+
const classArguments2 = { ...member.classArguments };
|
|
52229
|
+
for (const [parameterId, memberId] of Object.entries(
|
|
52230
|
+
body.genericBindings ?? {}
|
|
52231
|
+
)) {
|
|
52232
|
+
classArguments2[parameterId] = {
|
|
52233
|
+
kind: 1 /* Member */,
|
|
52234
|
+
memberId
|
|
52235
|
+
};
|
|
52236
|
+
}
|
|
52237
|
+
context.env = resolveInstanceEnv(
|
|
52238
|
+
classId,
|
|
52239
|
+
classArguments2,
|
|
52240
|
+
context.document.classes
|
|
52241
|
+
);
|
|
52242
|
+
if (firstUnboundParamId(context.env) !== null) return false;
|
|
52243
|
+
const members = constructionMembers(classId, context);
|
|
52244
|
+
for (const entry of members) {
|
|
52245
|
+
if (Object.hasOwn(value, entry.schemaKey)) {
|
|
52246
|
+
if (!suppliedValueSettlesConstruction(
|
|
52247
|
+
entry.member,
|
|
52248
|
+
Reflect.get(value, entry.schemaKey),
|
|
52249
|
+
context,
|
|
52250
|
+
path
|
|
52251
|
+
))
|
|
52252
|
+
return false;
|
|
52253
|
+
continue;
|
|
52254
|
+
}
|
|
52255
|
+
if (!isRequiredMember2(entry.member)) continue;
|
|
52256
|
+
if (constructor2 !== void 0 || typeof body.instanceVariantId === "string")
|
|
52257
|
+
continue;
|
|
52258
|
+
if (!defaultSettlesConstruction(entry.member, context, path))
|
|
52259
|
+
return false;
|
|
52260
|
+
}
|
|
52261
|
+
return true;
|
|
52262
|
+
} finally {
|
|
52263
|
+
path.delete(value);
|
|
52264
|
+
context.env = previousEnv;
|
|
52265
|
+
}
|
|
52266
|
+
}
|
|
52267
|
+
function suppliedValueSettlesConstruction(member, value, context, path) {
|
|
52268
|
+
if (typeof value === "string") {
|
|
52269
|
+
let row;
|
|
52270
|
+
if (context.document.valueById !== void 0) {
|
|
52271
|
+
row = context.document.valueById(value);
|
|
52272
|
+
} else {
|
|
52273
|
+
context.valuesById ??= new Map(
|
|
52274
|
+
context.document.values?.map((entry) => [entry.id, entry]) ?? []
|
|
52275
|
+
);
|
|
52276
|
+
row = context.valuesById.get(value);
|
|
52277
|
+
}
|
|
52278
|
+
if (row !== void 0 && row !== null)
|
|
52279
|
+
return valueSettlesConstruction(member, row, context, path, true);
|
|
52280
|
+
return false;
|
|
52281
|
+
}
|
|
52282
|
+
return valueSettlesConstruction(member, { value }, context, path);
|
|
52283
|
+
}
|
|
52284
|
+
function resolveConstructionTypeArguments(typeArguments, document) {
|
|
52285
|
+
if (typeArguments === void 0) return void 0;
|
|
52286
|
+
const bindings = {};
|
|
52287
|
+
const projected = /* @__PURE__ */ new Map();
|
|
52288
|
+
for (const [parameterId, typeInfo] of Object.entries(typeArguments)) {
|
|
52289
|
+
let binding;
|
|
52290
|
+
for (const member of document.members) {
|
|
52291
|
+
if (!projected.has(member.id)) {
|
|
52292
|
+
try {
|
|
52293
|
+
projected.set(
|
|
52294
|
+
member.id,
|
|
52295
|
+
genericBindingTypeInfo(member, /* @__PURE__ */ new Map(), document.members)
|
|
52296
|
+
);
|
|
52297
|
+
} catch {
|
|
52298
|
+
projected.set(member.id, null);
|
|
52299
|
+
}
|
|
52300
|
+
}
|
|
52301
|
+
const candidate = projected.get(member.id);
|
|
52302
|
+
if (candidate != null && typeInfosInvariantlyEqual(candidate, typeInfo)) {
|
|
52303
|
+
binding = member;
|
|
52304
|
+
break;
|
|
52305
|
+
}
|
|
52306
|
+
}
|
|
52307
|
+
if (binding === void 0) {
|
|
52308
|
+
throw new Error(
|
|
52309
|
+
`Construction type argument "${parameterId}" has no matching type descriptor in the document.`
|
|
52310
|
+
);
|
|
52311
|
+
}
|
|
52312
|
+
bindings[parameterId] = {
|
|
52313
|
+
kind: 1 /* Member */,
|
|
52314
|
+
memberId: binding.id
|
|
52315
|
+
};
|
|
52316
|
+
}
|
|
52317
|
+
return bindings;
|
|
52318
|
+
}
|
|
52319
|
+
var init_construction_requirements = __esm({
|
|
52320
|
+
"../src/models/classes/construction-requirements.ts"() {
|
|
52321
|
+
"use strict";
|
|
52322
|
+
init_type_info_compatibility();
|
|
52323
|
+
init_classes();
|
|
52324
|
+
init_inheritance();
|
|
52325
|
+
init_generics();
|
|
52326
|
+
init_constructors2();
|
|
52327
|
+
init_parameter_defaults();
|
|
52328
|
+
init_members();
|
|
52329
|
+
}
|
|
52330
|
+
});
|
|
52331
|
+
|
|
51913
52332
|
// ../src/models/unity/unity-import-settings.ts
|
|
51914
52333
|
function buildDefaultUnityTexture2DImportSettings() {
|
|
51915
52334
|
return {
|
|
@@ -53113,13 +53532,10 @@ function directScalarDefaultBody(document, member) {
|
|
|
53113
53532
|
if (member.kind !== 1 /* Bool */ && member.kind !== 2 /* Int */ && member.kind !== 4 /* Float */ && member.kind !== 3 /* String */ && member.kind !== 20 /* Decimal */ && member.kind !== 8 /* Enum */ && member.kind !== 0 /* Null */) {
|
|
53114
53533
|
return void 0;
|
|
53115
53534
|
}
|
|
53116
|
-
if (
|
|
53535
|
+
if (member.defaultValue == null) return void 0;
|
|
53536
|
+
if (documentHasInitValueContent(document, member.defaultValue))
|
|
53117
53537
|
return void 0;
|
|
53118
|
-
|
|
53119
|
-
if (documentHasInitValueContent(document, member.defaultValue)) {
|
|
53120
|
-
return void 0;
|
|
53121
|
-
}
|
|
53122
|
-
const body = member.defaultValue ?? primitiveFallbackValue(document, member);
|
|
53538
|
+
const body = member.defaultValue;
|
|
53123
53539
|
if (!isLiteralValueContent(body)) return void 0;
|
|
53124
53540
|
if (body.value !== null && typeof body.value !== "boolean" && typeof body.value !== "number" && typeof body.value !== "string") {
|
|
53125
53541
|
return void 0;
|
|
@@ -53292,6 +53708,11 @@ function buildDefaultMemberValue(args) {
|
|
|
53292
53708
|
`Cannot create a value of missing class "${effectiveClassId}".`
|
|
53293
53709
|
);
|
|
53294
53710
|
}
|
|
53711
|
+
if (member.payload !== 1 /* Partial */ && typeof effectiveClass.requiredConstructorId === "string" && args.constructorRoot === void 0 && args.authoredRoot === void 0) {
|
|
53712
|
+
throw new Error(
|
|
53713
|
+
`Class "${effectiveClass.name}" declares a required constructor; provide its constructor arguments.`
|
|
53714
|
+
);
|
|
53715
|
+
}
|
|
53295
53716
|
if (isAbstractClass(effectiveClass)) {
|
|
53296
53717
|
throw new Error(
|
|
53297
53718
|
`Cannot create a value of abstract class "${effectiveClass.name}".`
|
|
@@ -53373,6 +53794,13 @@ function buildDefaultMemberValue(args) {
|
|
|
53373
53794
|
)) {
|
|
53374
53795
|
continue;
|
|
53375
53796
|
}
|
|
53797
|
+
if (isRequiredMember2(resolvedChildMember) && resolvedChildMember.defaultValue == null && !(isMemberClassBase(resolvedChildMember) && resolvedChildMember.payload === 1 /* Partial */)) {
|
|
53798
|
+
if (args.constructorRoot?.runsMemberInitializers === true) continue;
|
|
53799
|
+
if (args.constructorRoot?.omitMissingRequired === true) continue;
|
|
53800
|
+
throw new Error(
|
|
53801
|
+
`Class "${effectiveClass.name}" cannot be constructed without required member "${schemaKey}"; supply it or declare a member default.`
|
|
53802
|
+
);
|
|
53803
|
+
}
|
|
53376
53804
|
if (!shouldMaterializeChildDefaultForRoot(
|
|
53377
53805
|
args.constructorRoot,
|
|
53378
53806
|
resolvedChildMember,
|
|
@@ -53383,7 +53811,6 @@ function buildDefaultMemberValue(args) {
|
|
|
53383
53811
|
)) {
|
|
53384
53812
|
continue;
|
|
53385
53813
|
}
|
|
53386
|
-
if (shouldSkipRequiredChildDefault(resolvedChildMember)) continue;
|
|
53387
53814
|
const childValue = directScalarBody === void 0 ? buildDefaultMemberValue({
|
|
53388
53815
|
document: args.document,
|
|
53389
53816
|
projectId: args.projectId,
|
|
@@ -53716,15 +54143,43 @@ function cloneDefaultValueForMember(args) {
|
|
|
53716
54143
|
);
|
|
53717
54144
|
return evaluatedRow;
|
|
53718
54145
|
}
|
|
54146
|
+
if (args.path.size === 0 && !storedValueSettlesConstruction(
|
|
54147
|
+
member,
|
|
54148
|
+
sourceValue,
|
|
54149
|
+
{
|
|
54150
|
+
classes: args.document.classes,
|
|
54151
|
+
members: args.document.members,
|
|
54152
|
+
constructors: args.document.constructors ?? [],
|
|
54153
|
+
values: args.document.values,
|
|
54154
|
+
valueById: args.document.valueById
|
|
54155
|
+
},
|
|
54156
|
+
args.genericEnv
|
|
54157
|
+
)) {
|
|
54158
|
+
throw new Error(
|
|
54159
|
+
`Default value "${args.sourceValueId}" in ${args.referenceLocation} does not satisfy its construction requirements.`
|
|
54160
|
+
);
|
|
54161
|
+
}
|
|
53719
54162
|
let body;
|
|
53720
|
-
if (isMemberClassBase(member)) {
|
|
54163
|
+
if (isMemberClassBase(member) && sourceValue.value === null) {
|
|
54164
|
+
body = cloneMemberValueBase(sourceValue);
|
|
54165
|
+
} else if (isMemberClassBase(member)) {
|
|
53721
54166
|
const effectiveClassId = typeof sourceValue.classId === "string" ? sourceValue.classId : member.classId;
|
|
53722
|
-
const
|
|
54167
|
+
const classArguments2 = { ...member.classArguments };
|
|
54168
|
+
for (const [parameterId, memberId] of Object.entries(
|
|
54169
|
+
sourceValue.genericBindings ?? {}
|
|
54170
|
+
)) {
|
|
54171
|
+
classArguments2[parameterId] = {
|
|
54172
|
+
kind: 1 /* Member */,
|
|
54173
|
+
memberId
|
|
54174
|
+
};
|
|
54175
|
+
}
|
|
54176
|
+
const childEnv = args.document.instanceEnv?.(effectiveClassId, classArguments2) ?? resolveInstanceEnv(
|
|
53723
54177
|
effectiveClassId,
|
|
53724
|
-
|
|
54178
|
+
classArguments2,
|
|
53725
54179
|
args.document.classes
|
|
53726
54180
|
);
|
|
53727
54181
|
body = {
|
|
54182
|
+
...cloneMemberValueBase(sourceValue),
|
|
53728
54183
|
value: cloneDefaultClassRecord({
|
|
53729
54184
|
document: args.document,
|
|
53730
54185
|
projectId: args.projectId,
|
|
@@ -53738,7 +54193,7 @@ function cloneDefaultValueForMember(args) {
|
|
|
53738
54193
|
path: nextPath,
|
|
53739
54194
|
position: args.position
|
|
53740
54195
|
}),
|
|
53741
|
-
classId: effectiveClassId !== member.classId ? effectiveClassId : void 0
|
|
54196
|
+
classId: effectiveClassId !== member.classId || sourceValue.constructorArgs != null ? effectiveClassId : void 0
|
|
53742
54197
|
};
|
|
53743
54198
|
} else if (isMemberListBase(member)) {
|
|
53744
54199
|
body = cloneDefaultListRecord({
|
|
@@ -53749,7 +54204,7 @@ function cloneDefaultValueForMember(args) {
|
|
|
53749
54204
|
createdValues: args.createdValues,
|
|
53750
54205
|
storageKeyDeclarations: args.storageKeyDeclarations,
|
|
53751
54206
|
initEvaluator: args.initEvaluator,
|
|
53752
|
-
genericEnv: args.genericEnv,
|
|
54207
|
+
genericEnv: sourceValue.genericBindings == null ? args.genericEnv : envFromStamp(sourceValue.genericBindings),
|
|
53753
54208
|
path: nextPath,
|
|
53754
54209
|
position: args.position
|
|
53755
54210
|
});
|
|
@@ -53762,7 +54217,7 @@ function cloneDefaultValueForMember(args) {
|
|
|
53762
54217
|
createdValues: args.createdValues,
|
|
53763
54218
|
storageKeyDeclarations: args.storageKeyDeclarations,
|
|
53764
54219
|
initEvaluator: args.initEvaluator,
|
|
53765
|
-
genericEnv: args.genericEnv,
|
|
54220
|
+
genericEnv: sourceValue.genericBindings == null ? args.genericEnv : envFromStamp(sourceValue.genericBindings),
|
|
53766
54221
|
path: nextPath,
|
|
53767
54222
|
position: args.position
|
|
53768
54223
|
});
|
|
@@ -53779,7 +54234,9 @@ function cloneDefaultValueForMember(args) {
|
|
|
53779
54234
|
}
|
|
53780
54235
|
const value = createDocumentValueRow(args.document, args.projectId, body);
|
|
53781
54236
|
value.sourceValueId = sourceValue.sourceValueId ?? sourceValue.id;
|
|
53782
|
-
if (
|
|
54237
|
+
if (sourceValue.genericBindings != null) {
|
|
54238
|
+
value.genericBindings = { ...sourceValue.genericBindings };
|
|
54239
|
+
} else if (isMemberListBase(member) || isMemberDictionaryBase(member)) {
|
|
53783
54240
|
stampGenericBindings(value, member, args);
|
|
53784
54241
|
}
|
|
53785
54242
|
args.createdValues.push(value);
|
|
@@ -53837,10 +54294,6 @@ function stampGenericBindings(value, member, args) {
|
|
|
53837
54294
|
if (stamp === void 0) return;
|
|
53838
54295
|
value.genericBindings = stamp;
|
|
53839
54296
|
}
|
|
53840
|
-
function shouldSkipRequiredChildDefault(member) {
|
|
53841
|
-
if (member.defaultValue !== void 0) return false;
|
|
53842
|
-
return isMemberAudioBase(member);
|
|
53843
|
-
}
|
|
53844
54297
|
function shouldMaterializeChildDefault(member) {
|
|
53845
54298
|
if (isMemberClassBase(member) && member.payload === 1 /* Partial */)
|
|
53846
54299
|
return false;
|
|
@@ -53862,7 +54315,7 @@ function skipProvidedConstructorSchemaKey(constructorRoot, schemaKey, member, is
|
|
|
53862
54315
|
if (constructorRoot.runsMemberInitializers !== true) {
|
|
53863
54316
|
return !isInitializer;
|
|
53864
54317
|
}
|
|
53865
|
-
return member.defaultValue
|
|
54318
|
+
return member.defaultValue == null;
|
|
53866
54319
|
}
|
|
53867
54320
|
function shouldMaterializeChildDefaultForRoot(constructorRoot, member, isInitializer = isInitValueContent(member.defaultValue)) {
|
|
53868
54321
|
if (constructorRoot === void 0)
|
|
@@ -54118,6 +54571,7 @@ var DECLARATION_DEFAULT_POSITION, SPRITE_FILE_ID_KEY;
|
|
|
54118
54571
|
var init_build_default_member_value = __esm({
|
|
54119
54572
|
"../src/models/members/build-default-member-value.ts"() {
|
|
54120
54573
|
"use strict";
|
|
54574
|
+
init_construction_requirements();
|
|
54121
54575
|
init_deep_clone_plain_data();
|
|
54122
54576
|
init_dist_node();
|
|
54123
54577
|
init_inheritance();
|
|
@@ -64603,6 +65057,22 @@ function manifestTypeForMember(context, member) {
|
|
|
64603
65057
|
}
|
|
64604
65058
|
return primitive3;
|
|
64605
65059
|
}
|
|
65060
|
+
if (member.kind === "list" || member.kind === "dictionary") {
|
|
65061
|
+
const entry = context.baseMembers.get(member.entryMemberId);
|
|
65062
|
+
if (entry === void 0)
|
|
65063
|
+
throw new Error(
|
|
65064
|
+
`Collection ${member.name} has no entry member ${member.entryMemberId}.`
|
|
65065
|
+
);
|
|
65066
|
+
const entryType = manifestTypeForMember(context, entry);
|
|
65067
|
+
if (member.kind === "list")
|
|
65068
|
+
return { name: "List", nullable: nullable2, arguments: [entryType] };
|
|
65069
|
+
const keyType = {
|
|
65070
|
+
name: member.key.kind === "string" ? "string" : context.baseEnums.get(member.key.enumId)?.name ?? "object",
|
|
65071
|
+
nullable: false,
|
|
65072
|
+
arguments: []
|
|
65073
|
+
};
|
|
65074
|
+
return { name: "Dictionary", nullable: nullable2, arguments: [keyType, entryType] };
|
|
65075
|
+
}
|
|
64606
65076
|
if (member.kind === "class") {
|
|
64607
65077
|
const schemaClass2 = context.baseClasses.get(member.classId);
|
|
64608
65078
|
const classType = {
|
|
@@ -64848,6 +65318,16 @@ function lowerGenericArgument(context, ownerClass, type, memberId, genericParamI
|
|
|
64848
65318
|
const base = context.baseMembers.get(memberId);
|
|
64849
65319
|
if (base && JSON.stringify(manifestTypeForMember(context, base)) === JSON.stringify(type)) {
|
|
64850
65320
|
context.loweredMembers.set(memberId, { ...base, owner });
|
|
65321
|
+
if (base.kind === "list" || base.kind === "dictionary") {
|
|
65322
|
+
lowerCollectionEntry(
|
|
65323
|
+
context,
|
|
65324
|
+
ownerClass,
|
|
65325
|
+
requiredTypeArgument(type, base.kind === "list" ? 0 : 1),
|
|
65326
|
+
base.entryMemberId,
|
|
65327
|
+
memberId,
|
|
65328
|
+
memberId
|
|
65329
|
+
);
|
|
65330
|
+
}
|
|
64851
65331
|
return;
|
|
64852
65332
|
}
|
|
64853
65333
|
const declaration = {
|
|
@@ -65575,172 +66055,6 @@ var init_lower_variants = __esm({
|
|
|
65575
66055
|
}
|
|
65576
66056
|
});
|
|
65577
66057
|
|
|
65578
|
-
// ../src/models/constructors/constructors.ts
|
|
65579
|
-
function hasRejectedConstructorKey(value) {
|
|
65580
|
-
return REJECTED_CONSTRUCTOR_KEYS.some((key) => value[key] !== void 0);
|
|
65581
|
-
}
|
|
65582
|
-
function isNamedBaseClauseEntry(value, nameIsValid) {
|
|
65583
|
-
if (typeof value !== "object" || value === null) return false;
|
|
65584
|
-
if (Array.isArray(value)) return false;
|
|
65585
|
-
const candidate = value;
|
|
65586
|
-
if (!Object.keys(candidate).every((key) => key === "name" || key === "code")) {
|
|
65587
|
-
return false;
|
|
65588
|
-
}
|
|
65589
|
-
if (!nameIsValid(candidate.name)) return false;
|
|
65590
|
-
if (typeof candidate.code !== "string") return false;
|
|
65591
|
-
return candidate.code.length > 0;
|
|
65592
|
-
}
|
|
65593
|
-
function isNeoConstructorBaseArgument(value) {
|
|
65594
|
-
return isNamedBaseClauseEntry(value, isValidCallableArgumentIdentifier);
|
|
65595
|
-
}
|
|
65596
|
-
function isNeoConstructorBaseInitializerField(value) {
|
|
65597
|
-
return isNamedBaseClauseEntry(value, isValidSchemaMemberIdentifier);
|
|
65598
|
-
}
|
|
65599
|
-
function isNeoClassConstructorBase(value) {
|
|
65600
|
-
if (typeof value !== "object" || value === null) return false;
|
|
65601
|
-
if (Array.isArray(value)) return false;
|
|
65602
|
-
const v = value;
|
|
65603
|
-
if (hasRejectedConstructorKey(v)) return false;
|
|
65604
|
-
if (!isValidDocsText(v.docsText)) return false;
|
|
65605
|
-
if (typeof v.classId !== "string") return false;
|
|
65606
|
-
if (v.classId.length === 0) return false;
|
|
65607
|
-
if (typeof v.code !== "string" && v.code !== null) return false;
|
|
65608
|
-
if (!Array.isArray(v.argumentTypes)) return false;
|
|
65609
|
-
const parameterNames = /* @__PURE__ */ new Set();
|
|
65610
|
-
const argumentTypes = [];
|
|
65611
|
-
for (const argument2 of v.argumentTypes) {
|
|
65612
|
-
if (!isNSFunctionArgumentTypeInfo(argument2)) return false;
|
|
65613
|
-
if (!isValidCallableArgumentIdentifier(argument2.name)) return false;
|
|
65614
|
-
if (parameterNames.has(argument2.name)) return false;
|
|
65615
|
-
parameterNames.add(argument2.name);
|
|
65616
|
-
argumentTypes.push(argument2);
|
|
65617
|
-
}
|
|
65618
|
-
if (validateParameterDefaults(argumentTypes).length > 0) return false;
|
|
65619
|
-
if (v.baseArguments !== void 0 && v.baseArguments !== null) {
|
|
65620
|
-
if (!Array.isArray(v.baseArguments)) return false;
|
|
65621
|
-
const baseNames = /* @__PURE__ */ new Set();
|
|
65622
|
-
for (const baseArgument of v.baseArguments) {
|
|
65623
|
-
if (!isNeoConstructorBaseArgument(baseArgument)) return false;
|
|
65624
|
-
if (baseNames.has(baseArgument.name)) return false;
|
|
65625
|
-
baseNames.add(baseArgument.name);
|
|
65626
|
-
}
|
|
65627
|
-
}
|
|
65628
|
-
if (v.baseInitializerFields !== void 0 && v.baseInitializerFields !== null) {
|
|
65629
|
-
if (!Array.isArray(v.baseInitializerFields)) return false;
|
|
65630
|
-
const fieldNames = /* @__PURE__ */ new Set();
|
|
65631
|
-
for (const field of v.baseInitializerFields) {
|
|
65632
|
-
if (!isNeoConstructorBaseInitializerField(field)) return false;
|
|
65633
|
-
if (fieldNames.has(field.name)) return false;
|
|
65634
|
-
fieldNames.add(field.name);
|
|
65635
|
-
}
|
|
65636
|
-
}
|
|
65637
|
-
if (v.action !== void 0 && v.action !== null) return false;
|
|
65638
|
-
if (v.compiledBaseArguments !== void 0 && v.compiledBaseArguments !== null) {
|
|
65639
|
-
return false;
|
|
65640
|
-
}
|
|
65641
|
-
return v.compiledBaseInitializerFields === void 0 || v.compiledBaseInitializerFields === null;
|
|
65642
|
-
}
|
|
65643
|
-
function isUncompiledNeoClassConstructor(value) {
|
|
65644
|
-
if (!isNeoClassConstructorBase(value)) return false;
|
|
65645
|
-
const v = value;
|
|
65646
|
-
if (typeof v.id !== "string" || v.id.length === 0) return false;
|
|
65647
|
-
if (typeof v.projectId !== "string" || v.projectId.length === 0) return false;
|
|
65648
|
-
if (!isEpochMillis(v.createdAt)) return false;
|
|
65649
|
-
return isEpochMillis(v.updatedAt);
|
|
65650
|
-
}
|
|
65651
|
-
function hasValidConstructorAction(action, argumentTypes) {
|
|
65652
|
-
if (!isNSFunctionWithReturnType(action)) return false;
|
|
65653
|
-
if (action.typeInfo.type !== 0 /* Null */) return false;
|
|
65654
|
-
if (action.typeInfo.required !== true) return false;
|
|
65655
|
-
if (action.parameters.length !== argumentTypes.length + 2) return false;
|
|
65656
|
-
if (action.parameters[0]?.id !== "__this__") return false;
|
|
65657
|
-
if (action.parameters[1]?.id !== "__root__") return false;
|
|
65658
|
-
for (let index = 0; index < argumentTypes.length; index += 1) {
|
|
65659
|
-
const parameter4 = action.parameters[index + 2];
|
|
65660
|
-
if (parameter4?.id !== `__arg_${index}__`) return false;
|
|
65661
|
-
const declared = argumentTypes[index];
|
|
65662
|
-
if (declared === void 0) return false;
|
|
65663
|
-
if (!typeInfosInvariantlyEqual(parameter4.typeInfo, declared)) return false;
|
|
65664
|
-
}
|
|
65665
|
-
return true;
|
|
65666
|
-
}
|
|
65667
|
-
function compiledBaseClauseGettersAlign(compiled, authored) {
|
|
65668
|
-
const authoredCount = Array.isArray(authored) ? authored.length : 0;
|
|
65669
|
-
if (compiled === void 0 || compiled === null) return authoredCount === 0;
|
|
65670
|
-
if (!Array.isArray(compiled)) return false;
|
|
65671
|
-
if (!compiled.every(isNSGetter)) return false;
|
|
65672
|
-
return compiled.length === authoredCount;
|
|
65673
|
-
}
|
|
65674
|
-
function isNeoClassConstructorProps(value) {
|
|
65675
|
-
if (typeof value !== "object" || value === null) return false;
|
|
65676
|
-
const v = value;
|
|
65677
|
-
const {
|
|
65678
|
-
action: _action,
|
|
65679
|
-
compiledBaseArguments: _compiledBaseArguments,
|
|
65680
|
-
compiledBaseInitializerFields: _compiledBaseInitializerFields,
|
|
65681
|
-
...authored
|
|
65682
|
-
} = v;
|
|
65683
|
-
void _action;
|
|
65684
|
-
void _compiledBaseArguments;
|
|
65685
|
-
void _compiledBaseInitializerFields;
|
|
65686
|
-
if (!isNeoClassConstructorBase(authored)) return false;
|
|
65687
|
-
if (typeof v.id !== "string") return false;
|
|
65688
|
-
if (v.id.length === 0) return false;
|
|
65689
|
-
if (typeof v.projectId !== "string") return false;
|
|
65690
|
-
if (!isEpochMillis(v.createdAt)) return false;
|
|
65691
|
-
if (!isEpochMillis(v.updatedAt)) return false;
|
|
65692
|
-
const argumentTypes = v.argumentTypes;
|
|
65693
|
-
if (!hasValidConstructorAction(v.action, argumentTypes)) return false;
|
|
65694
|
-
if (!compiledBaseClauseGettersAlign(v.compiledBaseArguments, v.baseArguments)) {
|
|
65695
|
-
return false;
|
|
65696
|
-
}
|
|
65697
|
-
return compiledBaseClauseGettersAlign(
|
|
65698
|
-
v.compiledBaseInitializerFields,
|
|
65699
|
-
v.baseInitializerFields
|
|
65700
|
-
);
|
|
65701
|
-
}
|
|
65702
|
-
function isNeoClassConstructor(value) {
|
|
65703
|
-
return isNeoClassConstructorProps(value);
|
|
65704
|
-
}
|
|
65705
|
-
function constructorActionParameterId(constructor2, index) {
|
|
65706
|
-
const action = "action" in constructor2 ? constructor2.action : void 0;
|
|
65707
|
-
if (action !== null && typeof action === "object") {
|
|
65708
|
-
const parameters = action.parameters;
|
|
65709
|
-
if (Array.isArray(parameters)) {
|
|
65710
|
-
const parameter4 = parameters[index + 2];
|
|
65711
|
-
if (parameter4 !== null && typeof parameter4 === "object" && typeof parameter4.id === "string") {
|
|
65712
|
-
return parameter4.id;
|
|
65713
|
-
}
|
|
65714
|
-
}
|
|
65715
|
-
}
|
|
65716
|
-
return `__arg_${index}__`;
|
|
65717
|
-
}
|
|
65718
|
-
var REJECTED_CONSTRUCTOR_KEYS;
|
|
65719
|
-
var init_constructors = __esm({
|
|
65720
|
-
"../src/models/constructors/constructors.ts"() {
|
|
65721
|
-
"use strict";
|
|
65722
|
-
init_core();
|
|
65723
|
-
init_docs_text2();
|
|
65724
|
-
init_member_kinds();
|
|
65725
|
-
init_schema_identifiers();
|
|
65726
|
-
init_neoscript();
|
|
65727
|
-
REJECTED_CONSTRUCTOR_KEYS = [
|
|
65728
|
-
"bodyMode",
|
|
65729
|
-
"uiAction",
|
|
65730
|
-
"returnTypeInfo",
|
|
65731
|
-
"deferred"
|
|
65732
|
-
];
|
|
65733
|
-
}
|
|
65734
|
-
});
|
|
65735
|
-
|
|
65736
|
-
// ../src/models/constructors/index.ts
|
|
65737
|
-
var init_constructors2 = __esm({
|
|
65738
|
-
"../src/models/constructors/index.ts"() {
|
|
65739
|
-
"use strict";
|
|
65740
|
-
init_constructors();
|
|
65741
|
-
}
|
|
65742
|
-
});
|
|
65743
|
-
|
|
65744
66058
|
// ../src/models/classes/constructor-parameter-settlement.ts
|
|
65745
66059
|
function createConstructorSettlementResolver(view) {
|
|
65746
66060
|
const classesById = new Map(
|
|
@@ -76724,16 +77038,35 @@ function validateClassConstructorDescriptor(info, ctx, requireEveryRequiredField
|
|
|
76724
77038
|
);
|
|
76725
77039
|
}
|
|
76726
77040
|
const genericSlot = ctx.__constructionGenericSlots?.toReversed().find((slot) => slot.classId === classId) ?? ctx.__storedConstructionReplaySlot;
|
|
76727
|
-
const
|
|
77041
|
+
const slotArguments = genericSlot?.classId === classId ? genericSlot.classArguments : void 0;
|
|
76728
77042
|
const descriptorCache = evaluatorResolutionCache(ctx).validatedConstructorDescriptorByInfo;
|
|
76729
|
-
const descriptorCacheKey = `${requireEveryRequiredField}:${ctx.storedConstructionReplay === true}:${JSON.stringify(
|
|
77043
|
+
const descriptorCacheKey = `${requireEveryRequiredField}:${ctx.storedConstructionReplay === true}:${JSON.stringify(slotArguments ?? info.schemaClassInfo.typeArguments ?? null)}`;
|
|
76730
77044
|
const cachedDescriptor = descriptorCache.get(info)?.get(descriptorCacheKey);
|
|
76731
77045
|
if (cachedDescriptor !== void 0) return cachedDescriptor;
|
|
77046
|
+
const constructionDocument = {
|
|
77047
|
+
classes: ctx.vm.classes,
|
|
77048
|
+
members: ctx.vm.members,
|
|
77049
|
+
constructors: ctx.vm.constructors ?? [],
|
|
77050
|
+
values: ctx.vm.values,
|
|
77051
|
+
valueById: ctx.vm.databaseVM?.valueById
|
|
77052
|
+
};
|
|
77053
|
+
const classArguments2 = slotArguments ?? resolveConstructionTypeArguments(
|
|
77054
|
+
info.schemaClassInfo.typeArguments,
|
|
77055
|
+
constructionDocument
|
|
77056
|
+
);
|
|
76732
77057
|
const cacheDescriptor = (descriptor) => {
|
|
77058
|
+
const complete2 = {
|
|
77059
|
+
...descriptor,
|
|
77060
|
+
requiredSchemaKeys: requiredMembersForConstruction(
|
|
77061
|
+
classId,
|
|
77062
|
+
constructionDocument,
|
|
77063
|
+
classArguments2
|
|
77064
|
+
).map((entry) => entry.schemaKey)
|
|
77065
|
+
};
|
|
76733
77066
|
const variants = descriptorCache.get(info) ?? /* @__PURE__ */ new Map();
|
|
76734
|
-
variants.set(descriptorCacheKey,
|
|
77067
|
+
variants.set(descriptorCacheKey, complete2);
|
|
76735
77068
|
descriptorCache.set(info, variants);
|
|
76736
|
-
return
|
|
77069
|
+
return complete2;
|
|
76737
77070
|
};
|
|
76738
77071
|
const instanceEnv = cachedInstanceEnv(classId, classArguments2, ctx);
|
|
76739
77072
|
if (firstUnboundParamId(instanceEnv) !== null) {
|
|
@@ -77349,6 +77682,7 @@ function constructClassValueWithinFrame(descriptor, scope, ctx) {
|
|
|
77349
77682
|
project: ctx.vm.project,
|
|
77350
77683
|
members: ctx.vm.members,
|
|
77351
77684
|
classes: ctx.vm.classes,
|
|
77685
|
+
constructors: ctx.vm.constructors,
|
|
77352
77686
|
enums: ctx.vm.enums,
|
|
77353
77687
|
// Declaration defaults only reference durable rows. Supplying the
|
|
77354
77688
|
// immutable base plus its indexes avoids copying and linearly scanning
|
|
@@ -77435,6 +77769,15 @@ function constructClassValueWithinFrame(descriptor, scope, ctx) {
|
|
|
77435
77769
|
`Failed to construct '${schemaClass2.name}': ${error instanceof Error ? error.message : String(error)}`
|
|
77436
77770
|
);
|
|
77437
77771
|
}
|
|
77772
|
+
if (ctx.constructionBaselineReplay !== true) {
|
|
77773
|
+
for (const schemaKey of descriptor.requiredSchemaKeys) {
|
|
77774
|
+
if (typeof root.value === "object" && root.value !== null && Reflect.get(root.value, schemaKey) != null)
|
|
77775
|
+
continue;
|
|
77776
|
+
throw new NSGetterRuntimeError(
|
|
77777
|
+
`Class '${schemaClass2.name}' was constructed without settling required member '${schemaKey}'.`
|
|
77778
|
+
);
|
|
77779
|
+
}
|
|
77780
|
+
}
|
|
77438
77781
|
publishConstructedRows({
|
|
77439
77782
|
root,
|
|
77440
77783
|
classId,
|
|
@@ -78931,6 +79274,7 @@ function constructDeclaredClassValueWithinFrame(descriptor, record4, info, scope
|
|
|
78931
79274
|
project: ctx.vm.project,
|
|
78932
79275
|
members: ctx.vm.members,
|
|
78933
79276
|
classes: ctx.vm.classes,
|
|
79277
|
+
constructors: ctx.vm.constructors,
|
|
78934
79278
|
enums: ctx.vm.enums,
|
|
78935
79279
|
values: ctx.vm.values,
|
|
78936
79280
|
memberById: ctx.vm.databaseVM?.memberById,
|
|
@@ -79091,6 +79435,15 @@ function constructDeclaredClassValueWithinFrame(descriptor, record4, info, scope
|
|
|
79091
79435
|
`Failed to construct '${schemaClass2.name}': ${error instanceof Error ? error.message : String(error)}`
|
|
79092
79436
|
);
|
|
79093
79437
|
}
|
|
79438
|
+
if (ctx.constructionBaselineReplay !== true) {
|
|
79439
|
+
for (const schemaKey of descriptor.requiredSchemaKeys) {
|
|
79440
|
+
if (typeof root.value === "object" && root.value !== null && Reflect.get(root.value, schemaKey) != null)
|
|
79441
|
+
continue;
|
|
79442
|
+
throw new NSGetterRuntimeError(
|
|
79443
|
+
`Class '${schemaClass2.name}' was constructed without settling required member '${schemaKey}'.`
|
|
79444
|
+
);
|
|
79445
|
+
}
|
|
79446
|
+
}
|
|
79094
79447
|
publishConstructedRows({
|
|
79095
79448
|
root,
|
|
79096
79449
|
classId,
|
|
@@ -80215,6 +80568,7 @@ var DELEGATE_LEXICAL_THIS, DELEGATE_LEXICAL_ROOT, NonCatchableNSGetterRuntimeErr
|
|
|
80215
80568
|
var init_evaluateNSGetter = __esm({
|
|
80216
80569
|
"../src/runtime/neoscript/evaluateNSGetter.ts"() {
|
|
80217
80570
|
"use strict";
|
|
80571
|
+
init_construction_requirements();
|
|
80218
80572
|
init_deep_clone_plain_data();
|
|
80219
80573
|
init_instance_provenance();
|
|
80220
80574
|
init_NeoScriptScope();
|
|
@@ -107051,7 +107405,7 @@ function materializeDeclarationInitializersForAnimationValidation(document) {
|
|
|
107051
107405
|
return deferredMember;
|
|
107052
107406
|
}
|
|
107053
107407
|
const materialized = materializeInitializerValue2({
|
|
107054
|
-
document: { ...document,
|
|
107408
|
+
document: { ...document, values: [...valuesById.values()] },
|
|
107055
107409
|
member,
|
|
107056
107410
|
row: {
|
|
107057
107411
|
id: `animation-validation-default:${member.id}`,
|
|
@@ -107085,7 +107439,7 @@ function materializeDeclarationInitializersForAnimationValidation(document) {
|
|
|
107085
107439
|
continue;
|
|
107086
107440
|
}
|
|
107087
107441
|
const materialized = materializeInitializerValue2({
|
|
107088
|
-
document: { ...document,
|
|
107442
|
+
document: { ...document, values: [...valuesById.values()] },
|
|
107089
107443
|
member,
|
|
107090
107444
|
row
|
|
107091
107445
|
});
|
|
@@ -116497,18 +116851,32 @@ function lowerClassValue(context, member, expression, base, source, outerEnviron
|
|
|
116497
116851
|
`Class value ${String(base.id)}.${assignment.name} cannot place existing value ${symbolId2} into a new structural slot. Create the nested value inline so the atomic construction transaction can own it.`
|
|
116498
116852
|
);
|
|
116499
116853
|
}
|
|
116500
|
-
|
|
116854
|
+
const rows = /* @__PURE__ */ new Map();
|
|
116855
|
+
const localizedTexts = /* @__PURE__ */ new Map();
|
|
116856
|
+
const seededId = lowerSeedChild(
|
|
116501
116857
|
context,
|
|
116502
116858
|
recursivePartialMember(member, childMember),
|
|
116503
116859
|
assignment.value,
|
|
116504
116860
|
source,
|
|
116505
116861
|
`${String(base.id)}.${assignment.name}`,
|
|
116506
|
-
|
|
116507
|
-
|
|
116862
|
+
rows,
|
|
116863
|
+
localizedTexts,
|
|
116508
116864
|
void 0,
|
|
116509
116865
|
environment,
|
|
116510
116866
|
assignmentSlices.get(assignment.name)
|
|
116511
116867
|
);
|
|
116868
|
+
if (!partial && freshChildReplaysDeclaredDefault({
|
|
116869
|
+
context,
|
|
116870
|
+
childMember,
|
|
116871
|
+
childId: seededId,
|
|
116872
|
+
rows,
|
|
116873
|
+
localizedTexts,
|
|
116874
|
+
environment
|
|
116875
|
+
})) {
|
|
116876
|
+
deleteSeedRow(context, rows, seededId);
|
|
116877
|
+
continue;
|
|
116878
|
+
}
|
|
116879
|
+
body[assignment.name] = seededId;
|
|
116512
116880
|
continue;
|
|
116513
116881
|
}
|
|
116514
116882
|
const symbolId = sourceValueSymbol(context, assignment.value);
|
|
@@ -118309,23 +118677,33 @@ function freshChildReplaysDeclaredDefault(args) {
|
|
|
118309
118677
|
if (child.instanceVariantId != null) return false;
|
|
118310
118678
|
if (child.instanceVariantRowValueId != null) return false;
|
|
118311
118679
|
if (context.collectionBindingMemberIds.has(childMember.id)) return false;
|
|
118312
|
-
const defaultValue = childMember.defaultValue;
|
|
118313
|
-
if (defaultValue === null || defaultValue === void 0) return false;
|
|
118314
|
-
if (!("value" in defaultValue)) return false;
|
|
118315
118680
|
const resolved = resolveGenericSchemaMember(
|
|
118316
118681
|
context,
|
|
118317
118682
|
childMember,
|
|
118318
118683
|
environment
|
|
118319
118684
|
);
|
|
118685
|
+
let defaultValue = null;
|
|
118686
|
+
if (resolved.defaultValue && "value" in resolved.defaultValue) {
|
|
118687
|
+
defaultValue = resolved.defaultValue;
|
|
118688
|
+
} else if (resolved.defaultValue && "serverValueId" in resolved.defaultValue) {
|
|
118689
|
+
const storedMember = context.state[`member:${resolved.id}`]?.data;
|
|
118690
|
+
const storedDefault = isObjectRecord2(storedMember) ? storedMember.defaultValue : null;
|
|
118691
|
+
if (isObjectRecord2(storedDefault) && "value" in storedDefault) {
|
|
118692
|
+
defaultValue = {
|
|
118693
|
+
value: storedDefault.value,
|
|
118694
|
+
classId: storedDefault.classId
|
|
118695
|
+
};
|
|
118696
|
+
}
|
|
118697
|
+
}
|
|
118698
|
+
if (defaultValue === null) return false;
|
|
118320
118699
|
if (resolved.kind === "lookup" || resolved.kind === "dialogueLookup") {
|
|
118321
118700
|
return false;
|
|
118322
118701
|
}
|
|
118323
118702
|
if (resolved.kind === "class") {
|
|
118324
|
-
return freshConstructionReplaysDeclaredDefault(
|
|
118325
|
-
|
|
118326
|
-
|
|
118327
|
-
|
|
118328
|
-
);
|
|
118703
|
+
return freshConstructionReplaysDeclaredDefault(resolved, child, {
|
|
118704
|
+
value: defaultValue.value,
|
|
118705
|
+
classId: defaultValue.classId
|
|
118706
|
+
});
|
|
118329
118707
|
}
|
|
118330
118708
|
if (resolved.kind === "list") {
|
|
118331
118709
|
return Array.isArray(child.value) && child.value.length === 0 && !context.pendingContainerChildCounts.has(childId) && Array.isArray(defaultValue.value) && defaultValue.value.length === 0 && child.classId == null && (child.constructorArgs == null || Object.keys(child.constructorArgs).length === 0) && child.instanceConstructorId == null;
|
|
@@ -119918,7 +120296,13 @@ function resolveGenericValueMember(context, member, environment) {
|
|
|
119918
120296
|
`Stored Generic member ${String(member.name ?? member.id)} resolves to missing binding member ${bindingMemberId}.`
|
|
119919
120297
|
);
|
|
119920
120298
|
}
|
|
119921
|
-
return
|
|
120299
|
+
return {
|
|
120300
|
+
...bindingMember,
|
|
120301
|
+
id: member.id,
|
|
120302
|
+
name: member.name,
|
|
120303
|
+
defaultValue: member.defaultValue,
|
|
120304
|
+
...member.payload === 1 /* Partial */ ? { payload: 1 /* Partial */ } : {}
|
|
120305
|
+
};
|
|
119922
120306
|
}
|
|
119923
120307
|
function declaringClassGenericEnvironment(context, member) {
|
|
119924
120308
|
const classId = context.ownerClassIds.get(stringField3(member, "id")) ?? memberRecordOwnerClassId(member);
|
|
@@ -119990,11 +120374,17 @@ function resolveGenericSchemaMember(context, member, environment) {
|
|
|
119990
120374
|
`Stored Generic member ${member.name} resolves to missing binding member ${bindingMemberId}.`
|
|
119991
120375
|
);
|
|
119992
120376
|
}
|
|
119993
|
-
|
|
119994
|
-
|
|
119995
|
-
|
|
120377
|
+
const resolved = {
|
|
120378
|
+
...bindingMember,
|
|
120379
|
+
id: member.id,
|
|
120380
|
+
name: member.name,
|
|
120381
|
+
defaultValue: member.defaultValue
|
|
120382
|
+
};
|
|
120383
|
+
if (member.partial !== true) return resolved;
|
|
120384
|
+
if (resolved.kind === "class" || resolved.kind === "generic") {
|
|
120385
|
+
return { ...resolved, partial: true };
|
|
119996
120386
|
}
|
|
119997
|
-
return structuredLeafPartialChild(true,
|
|
120387
|
+
return structuredLeafPartialChild(true, resolved);
|
|
119998
120388
|
}
|
|
119999
120389
|
function lowerInstanceGenericEnvironment(context, classId, member, outerEnvironment) {
|
|
120000
120390
|
const bindings = classGenericBindings(context.classes, classId);
|
|
@@ -120708,7 +121098,9 @@ function emitProjectDocumentFilesV4(records2, options = {}) {
|
|
|
120708
121098
|
})
|
|
120709
121099
|
);
|
|
120710
121100
|
const errors = analysis.diagnostics.filter(
|
|
120711
|
-
(diagnostic) => diagnostic.severity === "error" &&
|
|
121101
|
+
(diagnostic) => diagnostic.severity === "error" && // Pull must expose incomplete stored objects so source can repair them.
|
|
121102
|
+
// Status, tests, and push still reject these construction errors.
|
|
121103
|
+
diagnostic.code !== "unsettled-required-member" && !isPullRecoveryDiagnosticCode(diagnostic.code)
|
|
120712
121104
|
);
|
|
120713
121105
|
if (errors.length > 0) {
|
|
120714
121106
|
throw new Error(
|
|
@@ -131454,7 +131846,7 @@ var init_registry2 = __esm({
|
|
|
131454
131846
|
"schema-contract/registry.mjs"() {
|
|
131455
131847
|
"use strict";
|
|
131456
131848
|
PROJECT_SCHEMA_CONTRACT = Object.freeze({
|
|
131457
|
-
cliVersion: "0.
|
|
131849
|
+
cliVersion: "0.49.0",
|
|
131458
131850
|
projectFileUploadBatchSize: 32,
|
|
131459
131851
|
documentRecords: {
|
|
131460
131852
|
member: {
|
|
@@ -138504,7 +138896,7 @@ There is no --keep-current: preserving current semantic state defines flatten.
|
|
|
138504
138896
|
async function main() {
|
|
138505
138897
|
const args = parseArgs(process.argv.slice(2));
|
|
138506
138898
|
if (args.command === "--version") {
|
|
138507
|
-
console.log("0.
|
|
138899
|
+
console.log("0.49.0");
|
|
138508
138900
|
return;
|
|
138509
138901
|
}
|
|
138510
138902
|
if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {
|