@neocompose/cli 0.38.4 → 0.38.5
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
|
@@ -936,7 +936,7 @@ var init_login = __esm({
|
|
|
936
936
|
"project:release-channel:write",
|
|
937
937
|
"project:release-channel:publish"
|
|
938
938
|
];
|
|
939
|
-
sleep = (ms) => new Promise((
|
|
939
|
+
sleep = (ms) => new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
940
940
|
}
|
|
941
941
|
});
|
|
942
942
|
|
|
@@ -44110,6 +44110,18 @@ var init_neoscript = __esm({
|
|
|
44110
44110
|
}
|
|
44111
44111
|
});
|
|
44112
44112
|
|
|
44113
|
+
// ../src/common/collections.ts
|
|
44114
|
+
function indexById2(records2) {
|
|
44115
|
+
const indexed = /* @__PURE__ */ new Map();
|
|
44116
|
+
for (const record3 of records2) indexed.set(record3.id, record3);
|
|
44117
|
+
return indexed;
|
|
44118
|
+
}
|
|
44119
|
+
var init_collections = __esm({
|
|
44120
|
+
"../src/common/collections.ts"() {
|
|
44121
|
+
"use strict";
|
|
44122
|
+
}
|
|
44123
|
+
});
|
|
44124
|
+
|
|
44113
44125
|
// ../src/models/classes/classes.ts
|
|
44114
44126
|
function isGenericParamConstraint(value) {
|
|
44115
44127
|
const v = value;
|
|
@@ -44245,6 +44257,7 @@ var RETIRED_CONSTRUCTOR_PROJECTIONS_FIELD;
|
|
|
44245
44257
|
var init_classes = __esm({
|
|
44246
44258
|
"../src/models/classes/classes.ts"() {
|
|
44247
44259
|
"use strict";
|
|
44260
|
+
init_collections();
|
|
44248
44261
|
init_core();
|
|
44249
44262
|
init_docs_text2();
|
|
44250
44263
|
init_member_storage();
|
|
@@ -45432,6 +45445,9 @@ function membersById(members) {
|
|
|
45432
45445
|
});
|
|
45433
45446
|
return byId;
|
|
45434
45447
|
}
|
|
45448
|
+
function classIndexFor(classes) {
|
|
45449
|
+
return classesById(classes);
|
|
45450
|
+
}
|
|
45435
45451
|
function createMergeMemo() {
|
|
45436
45452
|
const byClasses = /* @__PURE__ */ new WeakMap();
|
|
45437
45453
|
return (classId, classIndex, memberIndex, compute) => {
|
|
@@ -45574,8 +45590,9 @@ function findNearestAncestorSchemaPlacement(ownerClass, schemaKey, classesById2)
|
|
|
45574
45590
|
function walkExtendsMemberChain(startId, members, pick, options) {
|
|
45575
45591
|
const requireKind = options?.requireKind;
|
|
45576
45592
|
const maxHops = options?.maxHops ?? 16;
|
|
45577
|
-
const byId = membersById(members);
|
|
45578
|
-
|
|
45593
|
+
const byId = options?.memberById === void 0 ? membersById(members) : null;
|
|
45594
|
+
const getMember = (id2) => options?.memberById?.(id2) ?? byId?.get(id2) ?? null;
|
|
45595
|
+
let cursor = getMember(startId);
|
|
45579
45596
|
for (let i = 0; cursor && i < maxHops; i++) {
|
|
45580
45597
|
if (requireKind !== void 0 && cursor.kind !== requireKind) {
|
|
45581
45598
|
return void 0;
|
|
@@ -45584,7 +45601,7 @@ function walkExtendsMemberChain(startId, members, pick, options) {
|
|
|
45584
45601
|
if (v !== void 0) return v;
|
|
45585
45602
|
const nextId = getOptionalString(cursor, "extendsMemberId");
|
|
45586
45603
|
if (nextId === void 0) return void 0;
|
|
45587
|
-
cursor =
|
|
45604
|
+
cursor = getMember(nextId);
|
|
45588
45605
|
}
|
|
45589
45606
|
return void 0;
|
|
45590
45607
|
}
|
|
@@ -48220,6 +48237,14 @@ var init_generics = __esm({
|
|
|
48220
48237
|
});
|
|
48221
48238
|
|
|
48222
48239
|
// ../src/models/members/instance-provenance.ts
|
|
48240
|
+
function overlayLiteralValueContent(base, override) {
|
|
48241
|
+
const merged = { ...base, ...override };
|
|
48242
|
+
if (!("value" in override) || override.value !== null) return merged;
|
|
48243
|
+
for (const field of LITERAL_INSTANCE_IDENTITY_FIELDS) {
|
|
48244
|
+
if (!Object.hasOwn(override, field)) Reflect.deleteProperty(merged, field);
|
|
48245
|
+
}
|
|
48246
|
+
return merged;
|
|
48247
|
+
}
|
|
48223
48248
|
function pickInstanceProvenance(source) {
|
|
48224
48249
|
return {
|
|
48225
48250
|
...source.constructorArgs === void 0 ? {} : { constructorArgs: source.constructorArgs },
|
|
@@ -48238,10 +48263,19 @@ function carriesCompleteConstructionRecipe(value) {
|
|
|
48238
48263
|
if (typeof value.instanceVariantId === "string") return true;
|
|
48239
48264
|
return value.constructorArgs !== void 0;
|
|
48240
48265
|
}
|
|
48266
|
+
var LITERAL_INSTANCE_IDENTITY_FIELDS;
|
|
48241
48267
|
var init_instance_provenance = __esm({
|
|
48242
48268
|
"../src/models/members/instance-provenance.ts"() {
|
|
48243
48269
|
"use strict";
|
|
48244
48270
|
init_member_kinds();
|
|
48271
|
+
LITERAL_INSTANCE_IDENTITY_FIELDS = [
|
|
48272
|
+
"classId",
|
|
48273
|
+
"constructorArgs",
|
|
48274
|
+
"instanceConstructorId",
|
|
48275
|
+
"instanceVariantId",
|
|
48276
|
+
"instanceVariantRowValueId",
|
|
48277
|
+
"genericBindings"
|
|
48278
|
+
];
|
|
48245
48279
|
}
|
|
48246
48280
|
});
|
|
48247
48281
|
|
|
@@ -56740,6 +56774,7 @@ var init_common = __esm({
|
|
|
56740
56774
|
"../src/common/index.ts"() {
|
|
56741
56775
|
"use strict";
|
|
56742
56776
|
init_benchmark();
|
|
56777
|
+
init_collections();
|
|
56743
56778
|
init_error_message();
|
|
56744
56779
|
init_retree_input_diagnostics();
|
|
56745
56780
|
}
|
|
@@ -67231,7 +67266,121 @@ function validateInternalRecordRelations(args) {
|
|
|
67231
67266
|
});
|
|
67232
67267
|
}
|
|
67233
67268
|
function resolveEffectiveClassRelations(args) {
|
|
67234
|
-
|
|
67269
|
+
return createEffectiveClassRelationResolver({
|
|
67270
|
+
classes: args.classes,
|
|
67271
|
+
relations: args.relations,
|
|
67272
|
+
contracts: args.contracts
|
|
67273
|
+
}).resolve(args.relationKind, args.sourceClassId);
|
|
67274
|
+
}
|
|
67275
|
+
function createEffectiveClassRelationResolver(args) {
|
|
67276
|
+
const contracts = args.contracts ?? INTERNAL_RECORD_RELATION_KIND_CONTRACTS;
|
|
67277
|
+
const contractsByKind = /* @__PURE__ */ new Map();
|
|
67278
|
+
for (const contract of contracts) {
|
|
67279
|
+
contractsByKind.set(contract.relationKind, contract);
|
|
67280
|
+
}
|
|
67281
|
+
const classesById2 = args.classesById ?? classIndexFor(args.classes);
|
|
67282
|
+
const classRelationsByKind = /* @__PURE__ */ new Map();
|
|
67283
|
+
const relationsByIdByKind = /* @__PURE__ */ new Map();
|
|
67284
|
+
const directByKindAndSource = /* @__PURE__ */ new Map();
|
|
67285
|
+
for (const relation of args.relations) {
|
|
67286
|
+
if (relation.sourceRecordKind !== "class" || relation.targetRecordKind !== "class") {
|
|
67287
|
+
continue;
|
|
67288
|
+
}
|
|
67289
|
+
const relations = classRelationsByKind.get(relation.relationKind);
|
|
67290
|
+
if (relations === void 0) {
|
|
67291
|
+
classRelationsByKind.set(relation.relationKind, [relation]);
|
|
67292
|
+
} else relations.push(relation);
|
|
67293
|
+
}
|
|
67294
|
+
const relationById = (relationKind, id2) => {
|
|
67295
|
+
let byId = relationsByIdByKind.get(relationKind);
|
|
67296
|
+
if (byId === void 0) {
|
|
67297
|
+
byId = indexById2(classRelationsByKind.get(relationKind) ?? []);
|
|
67298
|
+
relationsByIdByKind.set(relationKind, byId);
|
|
67299
|
+
}
|
|
67300
|
+
return byId.get(id2);
|
|
67301
|
+
};
|
|
67302
|
+
const ancestryByClassId = /* @__PURE__ */ new Map();
|
|
67303
|
+
const concreteDescendantsByClassId = /* @__PURE__ */ new Map();
|
|
67304
|
+
const childrenByClassId = /* @__PURE__ */ new Map();
|
|
67305
|
+
for (const schemaClass2 of args.classes) {
|
|
67306
|
+
if (schemaClass2.extendsClassId === void 0) continue;
|
|
67307
|
+
const children = childrenByClassId.get(schemaClass2.extendsClassId);
|
|
67308
|
+
if (children === void 0) {
|
|
67309
|
+
childrenByClassId.set(schemaClass2.extendsClassId, [schemaClass2.id]);
|
|
67310
|
+
} else {
|
|
67311
|
+
children.push(schemaClass2.id);
|
|
67312
|
+
}
|
|
67313
|
+
}
|
|
67314
|
+
const ancestry = (classId) => {
|
|
67315
|
+
const cached = ancestryByClassId.get(classId);
|
|
67316
|
+
if (cached !== void 0) return cached;
|
|
67317
|
+
const resolved = classAncestry(classId, classesById2);
|
|
67318
|
+
ancestryByClassId.set(classId, resolved);
|
|
67319
|
+
return resolved;
|
|
67320
|
+
};
|
|
67321
|
+
const concreteDescendants = (classId) => {
|
|
67322
|
+
const cached = concreteDescendantsByClassId.get(classId);
|
|
67323
|
+
if (cached !== void 0) return cached;
|
|
67324
|
+
if (!classesById2.has(classId)) return [];
|
|
67325
|
+
const result = [];
|
|
67326
|
+
const pending = [classId];
|
|
67327
|
+
const visited = /* @__PURE__ */ new Set();
|
|
67328
|
+
while (pending.length > 0) {
|
|
67329
|
+
const candidateId = pending.pop();
|
|
67330
|
+
if (visited.has(candidateId)) {
|
|
67331
|
+
throw new Error(
|
|
67332
|
+
`Class inheritance contains a cycle at "${candidateId}".`
|
|
67333
|
+
);
|
|
67334
|
+
}
|
|
67335
|
+
visited.add(candidateId);
|
|
67336
|
+
const candidate = classesById2.get(candidateId);
|
|
67337
|
+
if (candidate !== void 0 && !candidate.isAbstract) {
|
|
67338
|
+
result.push(candidate.id);
|
|
67339
|
+
}
|
|
67340
|
+
for (const childId of childrenByClassId.get(candidateId) ?? []) {
|
|
67341
|
+
pending.push(childId);
|
|
67342
|
+
}
|
|
67343
|
+
}
|
|
67344
|
+
result.sort((left, right) => left.localeCompare(right));
|
|
67345
|
+
concreteDescendantsByClassId.set(classId, result);
|
|
67346
|
+
return result;
|
|
67347
|
+
};
|
|
67348
|
+
const directClassRelations = (relationKind, sourceClassId) => {
|
|
67349
|
+
let bySource = directByKindAndSource.get(relationKind);
|
|
67350
|
+
if (bySource === void 0) {
|
|
67351
|
+
bySource = /* @__PURE__ */ new Map();
|
|
67352
|
+
for (const relation of classRelationsByKind.get(relationKind) ?? []) {
|
|
67353
|
+
const declarations = bySource.get(relation.sourceRecordId);
|
|
67354
|
+
if (declarations === void 0) {
|
|
67355
|
+
bySource.set(relation.sourceRecordId, [relation]);
|
|
67356
|
+
} else declarations.push(relation);
|
|
67357
|
+
}
|
|
67358
|
+
directByKindAndSource.set(relationKind, bySource);
|
|
67359
|
+
}
|
|
67360
|
+
return bySource.get(sourceClassId) ?? [];
|
|
67361
|
+
};
|
|
67362
|
+
const resolve5 = (relationKind, sourceClassId) => {
|
|
67363
|
+
const contract = contractsByKind.get(relationKind);
|
|
67364
|
+
return resolveEffectiveClassRelationsFromIndex({
|
|
67365
|
+
relationKind,
|
|
67366
|
+
sourceClassId,
|
|
67367
|
+
contract,
|
|
67368
|
+
ancestry,
|
|
67369
|
+
concreteDescendants,
|
|
67370
|
+
directClassRelations
|
|
67371
|
+
});
|
|
67372
|
+
};
|
|
67373
|
+
return {
|
|
67374
|
+
classesById: classesById2,
|
|
67375
|
+
relationById,
|
|
67376
|
+
directClassRelations,
|
|
67377
|
+
classAncestry: ancestry,
|
|
67378
|
+
concreteClassDescendants: concreteDescendants,
|
|
67379
|
+
resolve: resolve5
|
|
67380
|
+
};
|
|
67381
|
+
}
|
|
67382
|
+
function resolveEffectiveClassRelationsFromIndex(args) {
|
|
67383
|
+
const contract = args.contract;
|
|
67235
67384
|
if (contract === void 0) {
|
|
67236
67385
|
throw new Error(`Unknown internal relation kind "${args.relationKind}".`);
|
|
67237
67386
|
}
|
|
@@ -67243,15 +67392,12 @@ function resolveEffectiveClassRelations(args) {
|
|
|
67243
67392
|
`Internal relation kind "${args.relationKind}" is not class-to-class.`
|
|
67244
67393
|
);
|
|
67245
67394
|
}
|
|
67246
|
-
const
|
|
67247
|
-
args.classes.map((schemaClass2) => [schemaClass2.id, schemaClass2])
|
|
67248
|
-
);
|
|
67249
|
-
const sourceIds = contract.sourceClassPolicy === "include-descendants" ? classAncestry(args.sourceClassId, classesById2) : [args.sourceClassId];
|
|
67395
|
+
const sourceIds = contract.sourceClassPolicy === "include-descendants" ? args.ancestry(args.sourceClassId) : [args.sourceClassId];
|
|
67250
67396
|
const sourceDepth = new Map(
|
|
67251
67397
|
sourceIds.map((sourceId3, index) => [sourceId3, index])
|
|
67252
67398
|
);
|
|
67253
|
-
const declarations =
|
|
67254
|
-
(
|
|
67399
|
+
const declarations = sourceIds.flatMap(
|
|
67400
|
+
(sourceId3) => args.directClassRelations(args.relationKind, sourceId3)
|
|
67255
67401
|
);
|
|
67256
67402
|
if (contract.merge === "nearest-single") {
|
|
67257
67403
|
const sorted = declarations.sort(
|
|
@@ -67273,11 +67419,7 @@ function resolveEffectiveClassRelations(args) {
|
|
|
67273
67419
|
const byTarget = /* @__PURE__ */ new Map();
|
|
67274
67420
|
for (const declaration of declarations) {
|
|
67275
67421
|
const declarationDepth = sourceDepth.get(declaration.sourceRecordId) ?? 0;
|
|
67276
|
-
const targetIds = contract.targetClassPolicy === "include-descendants" ?
|
|
67277
|
-
declaration.targetRecordId,
|
|
67278
|
-
args.classes,
|
|
67279
|
-
classesById2
|
|
67280
|
-
) : [declaration.targetRecordId];
|
|
67422
|
+
const targetIds = contract.targetClassPolicy === "include-descendants" ? args.concreteDescendants(declaration.targetRecordId) : [declaration.targetRecordId];
|
|
67281
67423
|
for (const targetId of targetIds) {
|
|
67282
67424
|
const current = byTarget.get(targetId);
|
|
67283
67425
|
if (current === void 0) {
|
|
@@ -67474,12 +67616,6 @@ function classAncestry(classId, classesById2) {
|
|
|
67474
67616
|
}
|
|
67475
67617
|
return result;
|
|
67476
67618
|
}
|
|
67477
|
-
function concreteClassDescendants(classId, classes, classesById2) {
|
|
67478
|
-
if (!classesById2.has(classId)) return [];
|
|
67479
|
-
return classes.filter(
|
|
67480
|
-
(candidate) => !candidate.isAbstract && classAncestry(candidate.id, classesById2).includes(classId)
|
|
67481
|
-
).map((candidate) => candidate.id).sort((left, right) => left.localeCompare(right));
|
|
67482
|
-
}
|
|
67483
67619
|
function effectiveRelation(relation, targetRecordId, sourceAncestryDepth) {
|
|
67484
67620
|
return {
|
|
67485
67621
|
relationKind: relation.relationKind,
|
|
@@ -67511,7 +67647,9 @@ var InternalRecordRelationKind, INTERNAL_RECORD_RELATION_KIND_CONTRACTS;
|
|
|
67511
67647
|
var init_internal_record_relations = __esm({
|
|
67512
67648
|
"../src/models/project/internal-record-relations.ts"() {
|
|
67513
67649
|
"use strict";
|
|
67650
|
+
init_collections();
|
|
67514
67651
|
init_classes();
|
|
67652
|
+
init_inheritance();
|
|
67515
67653
|
init_core();
|
|
67516
67654
|
init_project_version_types();
|
|
67517
67655
|
InternalRecordRelationKind = {
|
|
@@ -67667,6 +67805,7 @@ function makeEvaluatorLookups(members, values, options = {}) {
|
|
|
67667
67805
|
const lookups = {
|
|
67668
67806
|
memberById: (id2) => attrMap.get(id2) ?? null,
|
|
67669
67807
|
valueById: (id2) => valMap.get(id2) ?? null,
|
|
67808
|
+
hasStoredValueId: (id2) => valMap.has(id2),
|
|
67670
67809
|
unorderedListEntryIds: (containerValueId) => unorderedListMembership.get(containerValueId) ?? [],
|
|
67671
67810
|
// An index over a plain row set has no virtual expansion: every row it
|
|
67672
67811
|
// can answer with is already in `values`.
|
|
@@ -67698,9 +67837,20 @@ function evalMemberById(vm, id2) {
|
|
|
67698
67837
|
function evalValueById(ctx, id2, runtimeValues, overlayValues) {
|
|
67699
67838
|
const vm = ctx.vm;
|
|
67700
67839
|
const runtime = runtimeValues?.get(id2);
|
|
67701
|
-
if (runtime !== void 0)
|
|
67840
|
+
if (runtime !== void 0) {
|
|
67841
|
+
if (vm.databaseVM?.hasStoredValueId?.(id2) ?? true) {
|
|
67842
|
+
ctx.valueDependencies?.add(id2);
|
|
67843
|
+
}
|
|
67844
|
+
return runtime;
|
|
67845
|
+
}
|
|
67702
67846
|
const overlay = overlayValues?.get(id2);
|
|
67703
|
-
if (overlay !== void 0)
|
|
67847
|
+
if (overlay !== void 0) {
|
|
67848
|
+
if (vm.databaseVM?.hasStoredValueId?.(id2) ?? true) {
|
|
67849
|
+
ctx.valueDependencies?.add(id2);
|
|
67850
|
+
}
|
|
67851
|
+
return overlay;
|
|
67852
|
+
}
|
|
67853
|
+
ctx.valueDependencies?.add(id2);
|
|
67704
67854
|
if (vm.databaseVM?.valueById) return vm.databaseVM.valueById(id2);
|
|
67705
67855
|
return vm.values.find((v) => v.id === id2) ?? null;
|
|
67706
67856
|
}
|
|
@@ -68110,6 +68260,9 @@ function resolveRuntimeReferenceRow(sourceValueId, ctx, withProvenance) {
|
|
|
68110
68260
|
if (!withProvenance) return direct;
|
|
68111
68261
|
const receiver = trackedRowForValueReference(ctx.thisValue, ctx);
|
|
68112
68262
|
if (receiver === null) return direct;
|
|
68263
|
+
ctx.onUnattributableValueRead?.(
|
|
68264
|
+
`runtime-reference-provenance:${sourceValueId}`
|
|
68265
|
+
);
|
|
68113
68266
|
const indexes = evaluatorIndexes(ctx);
|
|
68114
68267
|
const virtualRows = ctx.vm.databaseVM?.virtualInstanceRowsForValue(receiver.id) ?? [];
|
|
68115
68268
|
if (virtualRows.length > 0) {
|
|
@@ -68716,6 +68869,9 @@ function finalizeConstructorAllocations(ctx, returnValue, ownsInvocationState, r
|
|
|
68716
68869
|
}
|
|
68717
68870
|
}
|
|
68718
68871
|
}
|
|
68872
|
+
ctx.onUnattributableValueRead?.(
|
|
68873
|
+
`constructor-argument-list:${argumentId}`
|
|
68874
|
+
);
|
|
68719
68875
|
for (const candidate of evaluatorValues(ctx)) {
|
|
68720
68876
|
if (candidate.containerId === argumentId) {
|
|
68721
68877
|
scanCreationDataRow({
|
|
@@ -68773,6 +68929,7 @@ function finalizeConstructorAllocations(ctx, returnValue, ownsInvocationState, r
|
|
|
68773
68929
|
if (member !== null && isMemberListBase(member)) {
|
|
68774
68930
|
const entryMember = evalMemberById(ctx.vm, member.entryMemberId);
|
|
68775
68931
|
if (member.listKind === "unordered") {
|
|
68932
|
+
ctx.onUnattributableValueRead?.(`constructed-unordered-list:${row.id}`);
|
|
68776
68933
|
for (const candidate of evaluatorValues(ctx)) {
|
|
68777
68934
|
if (candidate.containerId === row.id) {
|
|
68778
68935
|
scanOwnedRow(candidate.id, entryMember);
|
|
@@ -69067,6 +69224,11 @@ function parameterDefaultsAsFullArguments(argumentTypes, subject) {
|
|
|
69067
69224
|
if (!argumentTypes.every(parameterHasDefault)) return null;
|
|
69068
69225
|
return fillTrailingParameterDefaults([], argumentTypes, subject);
|
|
69069
69226
|
}
|
|
69227
|
+
function declarationInitializerArgumentValues(argumentTypes, subject, readsConstructorParameter) {
|
|
69228
|
+
const defaults = parameterDefaultsAsFullArguments(argumentTypes, subject);
|
|
69229
|
+
if (defaults !== null) return defaults;
|
|
69230
|
+
return readsConstructorParameter ? [] : argumentTypes.map(() => null);
|
|
69231
|
+
}
|
|
69070
69232
|
function fillCallableCallSiteArguments(args, member, ctx) {
|
|
69071
69233
|
if (member === null) return args;
|
|
69072
69234
|
if (member.kind !== 13 /* Function */ && member.kind !== 23 /* NSFunction */) {
|
|
@@ -70219,6 +70381,7 @@ function staticBindingTargetId(member, ctx) {
|
|
|
70219
70381
|
`Member '${member.name}' is not a static member.`
|
|
70220
70382
|
);
|
|
70221
70383
|
}
|
|
70384
|
+
ctx.staticMemberDependencies?.add(member.id);
|
|
70222
70385
|
const storage = effectiveStaticStorage(member.id, ctx);
|
|
70223
70386
|
const bindings = storage === "save" /* Save */ ? ctx.__saveStaticBindings : storage === "session" /* Session */ ? ctx.__sessionStaticBindings : void 0;
|
|
70224
70387
|
if (bindings?.has(member.id)) return bindings.get(member.id) ?? null;
|
|
@@ -70266,7 +70429,6 @@ function evalStaticMember(memberId, ctx) {
|
|
|
70266
70429
|
`Static member '${member.name}' is bound to missing value '${targetId}'.`
|
|
70267
70430
|
);
|
|
70268
70431
|
}
|
|
70269
|
-
ctx.valueDependencies?.add(row.id);
|
|
70270
70432
|
return row.value;
|
|
70271
70433
|
}
|
|
70272
70434
|
function evalPointer(pointer, scope, ctx) {
|
|
@@ -70875,6 +71037,7 @@ function delegateClosureLexicalThis(closure, ctx) {
|
|
|
70875
71037
|
"Stored NeoDelegate closure has no resolvable value row; lexical this cannot be reconstructed from ownership."
|
|
70876
71038
|
);
|
|
70877
71039
|
}
|
|
71040
|
+
ctx.onUnattributableValueRead?.(`delegate-owner-resolution:${closureRow.id}`);
|
|
70878
71041
|
const owners = [];
|
|
70879
71042
|
const indexes = evaluatorIndexes(ctx);
|
|
70880
71043
|
for (const [ancestorId, distance] of evaluatorOwnershipDistances(
|
|
@@ -71035,6 +71198,7 @@ function runtimeGenericEnvForValueRow(row, ctx, visited) {
|
|
|
71035
71198
|
}
|
|
71036
71199
|
function runtimeParentGenericEnv(row, ctx, visited) {
|
|
71037
71200
|
const result = /* @__PURE__ */ new Map();
|
|
71201
|
+
ctx.onUnattributableValueRead?.(`generic-parent-resolution:${row.id}`);
|
|
71038
71202
|
for (const link of evaluatorParentLinks(evaluatorIndexes(ctx), row.id)) {
|
|
71039
71203
|
const parent = evalValueById(
|
|
71040
71204
|
ctx,
|
|
@@ -71748,7 +71912,6 @@ function resolveValueIfId(at, ctx) {
|
|
|
71748
71912
|
ctx.__valueOverlay
|
|
71749
71913
|
);
|
|
71750
71914
|
if (!row) return at;
|
|
71751
|
-
ctx.valueDependencies?.add(row.id);
|
|
71752
71915
|
const member = memberForValueRow(row, ctx);
|
|
71753
71916
|
if (member !== null && isMemberListBase(member) && member.listKind === "unordered" && Array.isArray(row.value)) {
|
|
71754
71917
|
return evaluatorUnorderedListEntryIds(row.id, ctx);
|
|
@@ -71765,7 +71928,6 @@ function resolveValueIfIdForMember(at, member, ctx) {
|
|
|
71765
71928
|
ctx.__valueOverlay
|
|
71766
71929
|
);
|
|
71767
71930
|
if (!row) return at;
|
|
71768
|
-
ctx.valueDependencies?.add(row.id);
|
|
71769
71931
|
if (isMemberListBase(member) && member.listKind === "unordered" && Array.isArray(row.value)) {
|
|
71770
71932
|
return evaluatorUnorderedListEntryIds(row.id, ctx);
|
|
71771
71933
|
}
|
|
@@ -71773,6 +71935,7 @@ function resolveValueIfIdForMember(at, member, ctx) {
|
|
|
71773
71935
|
return shouldUnwrapSingleLookupValue(member) ? unwrapSingleLookupValue(value, ctx) : value;
|
|
71774
71936
|
}
|
|
71775
71937
|
function evaluatorUnorderedListEntryIds(containerValueId, ctx) {
|
|
71938
|
+
ctx.containerDependencies?.add(containerValueId);
|
|
71776
71939
|
const runtimeRows = [...ctx.__runtimeSessionValues?.values() ?? []];
|
|
71777
71940
|
const overlayRows = [...ctx.__valueOverlay?.values() ?? []];
|
|
71778
71941
|
const localRows = [...runtimeRows, ...overlayRows];
|
|
@@ -71798,7 +71961,6 @@ function unwrapSingleLookupValue(value, ctx) {
|
|
|
71798
71961
|
ctx.__valueOverlay
|
|
71799
71962
|
);
|
|
71800
71963
|
if (next) {
|
|
71801
|
-
ctx.valueDependencies?.add(next.id);
|
|
71802
71964
|
return next.value;
|
|
71803
71965
|
}
|
|
71804
71966
|
}
|
|
@@ -71839,6 +72001,7 @@ function resolveMemberForValueRow(row, ctx, visited) {
|
|
|
71839
72001
|
if (syntheticMemberId !== null) {
|
|
71840
72002
|
return evalMemberById(ctx.vm, syntheticMemberId);
|
|
71841
72003
|
}
|
|
72004
|
+
ctx.onUnattributableValueRead?.(`member-owner-resolution:${row.id}`);
|
|
71842
72005
|
for (const link of evaluatorParentLinks(indexes, row.id)) {
|
|
71843
72006
|
const parent = evalValueById(
|
|
71844
72007
|
ctx,
|
|
@@ -71903,13 +72066,11 @@ function memberIdFromSyntheticDefaultValueId(valueId) {
|
|
|
71903
72066
|
return valueId.slice(prefix.length, -suffix.length);
|
|
71904
72067
|
}
|
|
71905
72068
|
function resolveLocalizedTextId(value, ctx) {
|
|
72069
|
+
ctx.localizedTextDependencies?.add(value);
|
|
71906
72070
|
const mainLocale = ctx.vm.localizationConfig?.mainLocale;
|
|
71907
72071
|
if (mainLocale === void 0) return value;
|
|
71908
|
-
const text = ctx.vm.localizedTexts?.find(
|
|
71909
|
-
|
|
71910
|
-
);
|
|
71911
|
-
if (text === void 0) return value;
|
|
71912
|
-
ctx.localizedTextDependencies?.add(text.id);
|
|
72072
|
+
const text = ctx.vm.databaseVM?.localizedTextById?.(value) ?? ctx.vm.localizedTexts?.find((candidate) => candidate.id === value) ?? null;
|
|
72073
|
+
if (text === null) return value;
|
|
71913
72074
|
return text.localeValues[mainLocale]?.value ?? "";
|
|
71914
72075
|
}
|
|
71915
72076
|
function evalOperation(operation, scope, ctx) {
|
|
@@ -73350,6 +73511,7 @@ function bindConstructedDelegateTargets(createdValues, ctx) {
|
|
|
73350
73511
|
`NeoDelegate method target '${target.name}' has no declaring Class placement.`
|
|
73351
73512
|
);
|
|
73352
73513
|
}
|
|
73514
|
+
ctx.onUnattributableValueRead?.(`constructed-delegate-owner:${row.id}`);
|
|
73353
73515
|
const matches = [];
|
|
73354
73516
|
for (const [ancestorId, distance] of evaluatorOwnershipDistances(
|
|
73355
73517
|
row.id,
|
|
@@ -74097,6 +74259,17 @@ function constructorInitializerIndexes(ctx) {
|
|
|
74097
74259
|
ctx.__constructorInitializerIndexes = built;
|
|
74098
74260
|
return built;
|
|
74099
74261
|
}
|
|
74262
|
+
function constructorById(constructorId, ctx) {
|
|
74263
|
+
if (ctx.__constructorById === void 0) {
|
|
74264
|
+
ctx.__constructorById = new Map(
|
|
74265
|
+
(ctx.vm.constructors ?? []).map((constructor2) => [
|
|
74266
|
+
constructor2.id,
|
|
74267
|
+
constructor2
|
|
74268
|
+
])
|
|
74269
|
+
);
|
|
74270
|
+
}
|
|
74271
|
+
return ctx.__constructorById.get(constructorId);
|
|
74272
|
+
}
|
|
74100
74273
|
function buildConstructorInitializerIndexes(vm) {
|
|
74101
74274
|
const initializerScopeMemberIds = /* @__PURE__ */ new WeakMap();
|
|
74102
74275
|
const initializerScopeMemberIdsByValueId = /* @__PURE__ */ new Map();
|
|
@@ -74133,6 +74306,9 @@ function buildConstructorInitializerIndexes(vm) {
|
|
|
74133
74306
|
initializerScopeMemberIdsByValueId.set(valueId, rootOwnerId);
|
|
74134
74307
|
}
|
|
74135
74308
|
}
|
|
74309
|
+
const classById = new Map(
|
|
74310
|
+
vm.classes.map((schemaClass2) => [schemaClass2.id, schemaClass2])
|
|
74311
|
+
);
|
|
74136
74312
|
const declaringClassIdsByMemberId = /* @__PURE__ */ new Map();
|
|
74137
74313
|
for (const schemaClass2 of vm.classes) {
|
|
74138
74314
|
for (const memberId of Object.values(schemaClass2.schema)) {
|
|
@@ -74151,6 +74327,7 @@ function buildConstructorInitializerIndexes(vm) {
|
|
|
74151
74327
|
return {
|
|
74152
74328
|
initializerScopeMemberIds,
|
|
74153
74329
|
initializerScopeMemberIdsByValueId,
|
|
74330
|
+
classById,
|
|
74154
74331
|
declaringClassIdsByMemberId,
|
|
74155
74332
|
memberById: memberById2,
|
|
74156
74333
|
containerMemberIdByEntryId
|
|
@@ -74527,10 +74704,9 @@ function resolveVariantGraph(selection2, ctx) {
|
|
|
74527
74704
|
"Base variant selection has no variant graph."
|
|
74528
74705
|
);
|
|
74529
74706
|
}
|
|
74530
|
-
|
|
74531
|
-
|
|
74532
|
-
)
|
|
74533
|
-
if (record3 === void 0) {
|
|
74707
|
+
ctx.variantDependencies?.add(variantId);
|
|
74708
|
+
const record3 = ctx.vm.databaseVM?.variantById?.(variantId) ?? (ctx.vm.variants ?? []).find((candidate) => candidate.id === variantId) ?? null;
|
|
74709
|
+
if (record3 === null) {
|
|
74534
74710
|
throw new NSGetterRuntimeError(
|
|
74535
74711
|
`Variant '${variantId}' does not exist in this project.`
|
|
74536
74712
|
);
|
|
@@ -75395,6 +75571,7 @@ function currentOwnedValueAttachments(valueId, ctx) {
|
|
|
75395
75571
|
});
|
|
75396
75572
|
}
|
|
75397
75573
|
}
|
|
75574
|
+
ctx.onUnattributableValueRead?.(`owned-value-parents:${valueId}`);
|
|
75398
75575
|
const parentIds = new Set(
|
|
75399
75576
|
evaluatorParentLinks(indexes, valueId).map((link) => link.parentId)
|
|
75400
75577
|
);
|
|
@@ -75671,6 +75848,9 @@ function cloneConstructorArgumentGraph(args) {
|
|
|
75671
75848
|
if (member.listKind === "unordered") {
|
|
75672
75849
|
clone.value = [];
|
|
75673
75850
|
const entryEnv2 = envFromStamp(clone.genericBindings);
|
|
75851
|
+
args.ctx.onUnattributableValueRead?.(
|
|
75852
|
+
`constructor-import-list:${source.id}`
|
|
75853
|
+
);
|
|
75674
75854
|
const entries = evaluatorValues(args.ctx).filter((row) => row.containerId === source.id).sort((left, right) => left.id.localeCompare(right.id));
|
|
75675
75855
|
for (const entry of entries) {
|
|
75676
75856
|
cloneRow2(entry, entryMember, entryEnv2, clone.id);
|
|
@@ -75801,7 +75981,19 @@ function materializeConstructorArgumentValue(args) {
|
|
|
75801
75981
|
args.ctx.vm.members
|
|
75802
75982
|
);
|
|
75803
75983
|
const row = registerConstructorArgumentRow(args, []);
|
|
75804
|
-
|
|
75984
|
+
let sourceEntries = args.value;
|
|
75985
|
+
if (args.member.listKind === "unordered" && trackedValueId !== null) {
|
|
75986
|
+
args.ctx.onUnattributableValueRead?.(
|
|
75987
|
+
`constructor-argument-list:${trackedValueId}`
|
|
75988
|
+
);
|
|
75989
|
+
const rows = [];
|
|
75990
|
+
for (const entry of evaluatorValues(args.ctx)) {
|
|
75991
|
+
if (entry.containerId === trackedValueId) rows.push(entry);
|
|
75992
|
+
}
|
|
75993
|
+
rows.sort((left, right) => left.id.localeCompare(right.id));
|
|
75994
|
+
sourceEntries = [];
|
|
75995
|
+
for (const entry of rows) sourceEntries.push(entry.value);
|
|
75996
|
+
}
|
|
75805
75997
|
const ids = [];
|
|
75806
75998
|
for (const [index, rawEntry] of sourceEntries.entries()) {
|
|
75807
75999
|
const entryValue = constructorCollectionEntryValue(
|
|
@@ -75998,6 +76190,7 @@ function cloneClassValueGraph(receiver, expectedClassId, ctx) {
|
|
|
75998
76190
|
const active = /* @__PURE__ */ new Set();
|
|
75999
76191
|
const clonedBySourceId = /* @__PURE__ */ new Map();
|
|
76000
76192
|
const constructorArgumentReferenceCounts = /* @__PURE__ */ new Map();
|
|
76193
|
+
ctx.onUnattributableValueRead?.(`class-clone:${sourceId3}`);
|
|
76001
76194
|
for (const candidate of evaluatorValues(ctx)) {
|
|
76002
76195
|
for (const argument2 of ownedConstructorArgumentValues(candidate, ctx)) {
|
|
76003
76196
|
constructorArgumentReferenceCounts.set(
|
|
@@ -76006,7 +76199,95 @@ function cloneClassValueGraph(receiver, expectedClassId, ctx) {
|
|
|
76006
76199
|
);
|
|
76007
76200
|
}
|
|
76008
76201
|
}
|
|
76009
|
-
|
|
76202
|
+
function cloneInitializerRow(sourceRow, sourceMember, id2, clonedContainerId, sourceTypeInfo) {
|
|
76203
|
+
if (sourceMember === null) {
|
|
76204
|
+
throw new NSGetterRuntimeError(
|
|
76205
|
+
`Class.Clone cannot evaluate initializer-backed value '${sourceRow.id}' because its owning member could not be resolved.`
|
|
76206
|
+
);
|
|
76207
|
+
}
|
|
76208
|
+
const indexes = constructorInitializerIndexes(ctx);
|
|
76209
|
+
const runtimeMemberId = Reflect.get(sourceMember, "id");
|
|
76210
|
+
const compileMemberId = indexes.initializerScopeMemberIds.get(sourceRow.init) ?? indexes.initializerScopeMemberIdsByValueId.get(sourceRow.id) ?? (typeof runtimeMemberId === "string" ? runtimeMemberId : null);
|
|
76211
|
+
const compiled = ensureInitializerCompiled({
|
|
76212
|
+
init: sourceRow.init,
|
|
76213
|
+
member: sourceMember,
|
|
76214
|
+
initializerCompiler: ctx.vm.initializerCompiler,
|
|
76215
|
+
sourceValueId: sourceRow.id,
|
|
76216
|
+
compileMemberId
|
|
76217
|
+
});
|
|
76218
|
+
const declaringClassId = compileMemberId === null ? void 0 : indexes.declaringClassIdsByMemberId.get(compileMemberId)?.values().next().value;
|
|
76219
|
+
const ownerClass = declaringClassId === void 0 ? void 0 : indexes.classById.get(declaringClassId);
|
|
76220
|
+
const constructorId = ownerClass?.requiredConstructorId;
|
|
76221
|
+
const constructor2 = typeof constructorId === "string" ? constructorById(constructorId, ctx) : void 0;
|
|
76222
|
+
const argumentValues = constructor2 === void 0 ? [] : declarationInitializerArgumentValues(
|
|
76223
|
+
constructor2.argumentTypes,
|
|
76224
|
+
`Class.Clone initializer on '${ownerClass?.name ?? sourceMember.name}'`,
|
|
76225
|
+
compiled.parameters.slice(2).some(
|
|
76226
|
+
(parameter4) => runtimeValueReferencesVariable(
|
|
76227
|
+
compiled.instructions,
|
|
76228
|
+
parameter4.id
|
|
76229
|
+
)
|
|
76230
|
+
)
|
|
76231
|
+
);
|
|
76232
|
+
const initializerCreatedValues = [];
|
|
76233
|
+
const evaluated = evaluateInitializerInContext(
|
|
76234
|
+
sourceRow.init,
|
|
76235
|
+
sourceMember,
|
|
76236
|
+
ctx,
|
|
76237
|
+
initializerCreatedValues,
|
|
76238
|
+
argumentValues,
|
|
76239
|
+
sourceRow.id,
|
|
76240
|
+
compileMemberId
|
|
76241
|
+
);
|
|
76242
|
+
if (evaluated.existingValueRow !== void 0) {
|
|
76243
|
+
const adoptedClone = cloneRow2(
|
|
76244
|
+
evaluated.existingValueRow,
|
|
76245
|
+
sourceMember,
|
|
76246
|
+
clonedContainerId,
|
|
76247
|
+
sourceTypeInfo
|
|
76248
|
+
);
|
|
76249
|
+
clonedBySourceId.set(sourceRow.id, adoptedClone);
|
|
76250
|
+
active.delete(sourceRow.id);
|
|
76251
|
+
return adoptedClone;
|
|
76252
|
+
}
|
|
76253
|
+
const {
|
|
76254
|
+
init: _init,
|
|
76255
|
+
value: _value,
|
|
76256
|
+
classId: _classId,
|
|
76257
|
+
...sourceEnvelope
|
|
76258
|
+
} = sourceRow;
|
|
76259
|
+
void _init;
|
|
76260
|
+
void _value;
|
|
76261
|
+
void _classId;
|
|
76262
|
+
const clone = {
|
|
76263
|
+
...sourceEnvelope,
|
|
76264
|
+
id: id2,
|
|
76265
|
+
value: evaluated.value,
|
|
76266
|
+
...evaluated.classId === null ? {} : { classId: evaluated.classId },
|
|
76267
|
+
...evaluated.genericBindings === void 0 ? {} : { genericBindings: { ...evaluated.genericBindings } },
|
|
76268
|
+
...deepClonePlainData(pickInstanceProvenance(evaluated)),
|
|
76269
|
+
containerId: clonedContainerId ?? null
|
|
76270
|
+
};
|
|
76271
|
+
if (evaluated.provisionalRootId !== void 0) {
|
|
76272
|
+
retargetDelegateReceiverValueIds(
|
|
76273
|
+
[clone, ...initializerCreatedValues],
|
|
76274
|
+
evaluated.provisionalRootId,
|
|
76275
|
+
clone.id
|
|
76276
|
+
);
|
|
76277
|
+
}
|
|
76278
|
+
registerRuntimeSessionValue(ctx, clone);
|
|
76279
|
+
clonedBySourceId.set(sourceRow.id, clone);
|
|
76280
|
+
if (typeof clone.value === "object" && clone.value !== null) {
|
|
76281
|
+
ctx.__cloneSourceRowIds ??= /* @__PURE__ */ new WeakMap();
|
|
76282
|
+
ctx.__cloneSourceRowIds.set(clone.value, sourceRow.id);
|
|
76283
|
+
}
|
|
76284
|
+
active.delete(sourceRow.id);
|
|
76285
|
+
if (ctx.__indexes !== void 0) {
|
|
76286
|
+
indexEvaluatorRow(ctx.__indexes, clone);
|
|
76287
|
+
}
|
|
76288
|
+
return clone;
|
|
76289
|
+
}
|
|
76290
|
+
function cloneRow2(sourceRow, sourceMember, clonedContainerId, sourceTypeInfo) {
|
|
76010
76291
|
if (active.has(sourceRow.id)) {
|
|
76011
76292
|
throw new NSGetterRuntimeError(
|
|
76012
76293
|
`Class.Clone found a cycle through owned value '${sourceRow.id}'.`
|
|
@@ -76016,6 +76297,15 @@ function cloneClassValueGraph(receiver, expectedClassId, ctx) {
|
|
|
76016
76297
|
if (prior !== void 0) return prior;
|
|
76017
76298
|
active.add(sourceRow.id);
|
|
76018
76299
|
const id2 = freshCloneValueId();
|
|
76300
|
+
if (isInitValueContent(sourceRow)) {
|
|
76301
|
+
return cloneInitializerRow(
|
|
76302
|
+
sourceRow,
|
|
76303
|
+
sourceMember,
|
|
76304
|
+
id2,
|
|
76305
|
+
clonedContainerId,
|
|
76306
|
+
sourceTypeInfo
|
|
76307
|
+
);
|
|
76308
|
+
}
|
|
76019
76309
|
const clone = {
|
|
76020
76310
|
...sourceRow,
|
|
76021
76311
|
id: id2,
|
|
@@ -76070,6 +76360,9 @@ function cloneClassValueGraph(receiver, expectedClassId, ctx) {
|
|
|
76070
76360
|
entryTypeInfo
|
|
76071
76361
|
).id;
|
|
76072
76362
|
});
|
|
76363
|
+
ctx.onUnattributableValueRead?.(
|
|
76364
|
+
`class-clone-unordered-list:${sourceRow.id}`
|
|
76365
|
+
);
|
|
76073
76366
|
for (const child of evaluatorValues(ctx)) {
|
|
76074
76367
|
if (child.containerId !== sourceRow.id) continue;
|
|
76075
76368
|
cloneRow2(child, entryMember, id2, entryTypeInfo);
|
|
@@ -76116,7 +76409,7 @@ function cloneClassValueGraph(receiver, expectedClassId, ctx) {
|
|
|
76116
76409
|
indexEvaluatorRow(ctx.__indexes, clone);
|
|
76117
76410
|
}
|
|
76118
76411
|
return clone;
|
|
76119
|
-
}
|
|
76412
|
+
}
|
|
76120
76413
|
const rootMember = memberForValueRow(source, ctx);
|
|
76121
76414
|
const typedSource = source.classId === void 0 ? { ...source, classId: runtimeClassId } : source;
|
|
76122
76415
|
const clonedRoot = cloneRow2(typedSource, rootMember);
|
|
@@ -76368,6 +76661,12 @@ var init_evaluateNSGetter = __esm({
|
|
|
76368
76661
|
if (existing !== void 0) return existing;
|
|
76369
76662
|
const source = this.sourceRowById(id2);
|
|
76370
76663
|
if (source === void 0) return void 0;
|
|
76664
|
+
if (isInitValueContent(source)) {
|
|
76665
|
+
const clone2 = { ...source, init: { ...source.init } };
|
|
76666
|
+
super.set(id2, clone2);
|
|
76667
|
+
this.materializedRows.push(clone2);
|
|
76668
|
+
return clone2;
|
|
76669
|
+
}
|
|
76371
76670
|
let value = source.value;
|
|
76372
76671
|
if (Array.isArray(value)) value = [...value];
|
|
76373
76672
|
else if (typeof value === "object" && value !== null) value = { ...value };
|
|
@@ -76691,27 +76990,6 @@ function buildVirtualInstanceMaterializedIndex(args) {
|
|
|
76691
76990
|
})
|
|
76692
76991
|
};
|
|
76693
76992
|
}
|
|
76694
|
-
function firstListInParameterType(typeInfo, depth = 0) {
|
|
76695
|
-
if (typeof typeInfo !== "object" || typeInfo === null) return null;
|
|
76696
|
-
if (depth > CONSTRUCTOR_TYPE_WALK_DEPTH_LIMIT) return "depth-limit";
|
|
76697
|
-
const shape = typeInfo;
|
|
76698
|
-
if (shape.type === 6 /* List */) return "list";
|
|
76699
|
-
const entry = firstListInParameterType(shape.entryTypeInfo, depth + 1);
|
|
76700
|
-
if (entry !== null) return entry;
|
|
76701
|
-
if (Array.isArray(shape.argumentTypes)) {
|
|
76702
|
-
for (const argument2 of shape.argumentTypes) {
|
|
76703
|
-
const nested = firstListInParameterType(argument2, depth + 1);
|
|
76704
|
-
if (nested !== null) return nested;
|
|
76705
|
-
}
|
|
76706
|
-
}
|
|
76707
|
-
return null;
|
|
76708
|
-
}
|
|
76709
|
-
function constructorBodyIsCorpusFree(constructor2) {
|
|
76710
|
-
if (constructor2.code !== null && constructor2.code.trim() !== "") return false;
|
|
76711
|
-
if ((constructor2.baseArguments ?? []).length > 0) return false;
|
|
76712
|
-
if ((constructor2.baseInitializerFields ?? []).length > 0) return false;
|
|
76713
|
-
return true;
|
|
76714
|
-
}
|
|
76715
76993
|
function withoutInitializerConstructionFields(init) {
|
|
76716
76994
|
if (init.compiled === void 0) return init;
|
|
76717
76995
|
const baseline = deepClonePlainData(init);
|
|
@@ -76769,6 +77047,31 @@ function claimVirtualIdentity(args) {
|
|
|
76769
77047
|
}
|
|
76770
77048
|
function expandStoredInstance(args) {
|
|
76771
77049
|
const recorder = args.readRecorder ?? null;
|
|
77050
|
+
const readTracking = recorder === null ? void 0 : new InitializerReadSet();
|
|
77051
|
+
const trackMaterialization = readTracking === void 0 ? (materialize) => materialize() : (materialize) => {
|
|
77052
|
+
try {
|
|
77053
|
+
return materialize();
|
|
77054
|
+
} finally {
|
|
77055
|
+
for (const valueId of readTracking.valueIds) {
|
|
77056
|
+
recorder?.recordValueRead(valueId);
|
|
77057
|
+
}
|
|
77058
|
+
for (const textId of readTracking.localizedTextIds) {
|
|
77059
|
+
recorder?.recordLocalizedTextRead(textId);
|
|
77060
|
+
}
|
|
77061
|
+
for (const variantId of readTracking.variantIds) {
|
|
77062
|
+
recorder?.recordVariantRead(variantId);
|
|
77063
|
+
}
|
|
77064
|
+
for (const memberId of readTracking.staticMemberIds) {
|
|
77065
|
+
recorder?.recordStaticMemberRead(memberId);
|
|
77066
|
+
}
|
|
77067
|
+
for (const containerId of readTracking.containerIds) {
|
|
77068
|
+
recorder?.recordContainerMembershipRead(containerId);
|
|
77069
|
+
}
|
|
77070
|
+
if (readTracking.hasUnattributableValueRead) {
|
|
77071
|
+
recorder?.recordGlobalRead("initializer-runtime");
|
|
77072
|
+
}
|
|
77073
|
+
}
|
|
77074
|
+
};
|
|
76772
77075
|
recorder?.recordValueRead(args.instanceRoot.id);
|
|
76773
77076
|
const rootMember = resolveMember2(args.rootMember, args.document.members);
|
|
76774
77077
|
if (!isMemberClassBase(rootMember)) {
|
|
@@ -76807,25 +77110,6 @@ function expandStoredInstance(args) {
|
|
|
76807
77110
|
`Virtual expansion root "${args.instanceRoot.id}" has no durable overload identity for class "${classId}"; keep this historical graph materialized.`
|
|
76808
77111
|
);
|
|
76809
77112
|
}
|
|
76810
|
-
if (recorder !== null && requiredConstructor !== null) {
|
|
76811
|
-
if (!constructorBodyIsCorpusFree(requiredConstructor)) {
|
|
76812
|
-
recorder.recordGlobalRead(
|
|
76813
|
-
`authored-constructor-body:${requiredConstructor.id}`
|
|
76814
|
-
);
|
|
76815
|
-
}
|
|
76816
|
-
for (const typeInfo of requiredConstructor.argumentTypes) {
|
|
76817
|
-
if (firstListInParameterType(typeInfo) === null) continue;
|
|
76818
|
-
recorder.recordGlobalRead(
|
|
76819
|
-
`constructor-argument-list:${requiredConstructor.id}`
|
|
76820
|
-
);
|
|
76821
|
-
break;
|
|
76822
|
-
}
|
|
76823
|
-
}
|
|
76824
|
-
if (recorder !== null && typeof instanceRoot.instanceVariantId === "string") {
|
|
76825
|
-
recorder.recordGlobalRead(
|
|
76826
|
-
`variant-initialize:${instanceRoot.instanceVariantId}`
|
|
76827
|
-
);
|
|
76828
|
-
}
|
|
76829
77113
|
const storedArgs = instanceRoot.constructorArgs ?? {};
|
|
76830
77114
|
if (requiredConstructor !== null && instanceRoot.constructorArgs == null) {
|
|
76831
77115
|
throw new VirtualExpansionUnsupportedError(
|
|
@@ -76923,22 +77207,32 @@ function expandStoredInstance(args) {
|
|
|
76923
77207
|
code: `virtual-replay:${args.instanceRoot.id}`,
|
|
76924
77208
|
compiled
|
|
76925
77209
|
};
|
|
76926
|
-
return
|
|
76927
|
-
|
|
76928
|
-
|
|
76929
|
-
|
|
76930
|
-
|
|
76931
|
-
|
|
76932
|
-
|
|
77210
|
+
return trackMaterialization(
|
|
77211
|
+
() => materializeInitializerValue({
|
|
77212
|
+
document: args.document,
|
|
77213
|
+
member: replayMember,
|
|
77214
|
+
row: { ...envelope, init },
|
|
77215
|
+
storedConstructionReplay: true,
|
|
77216
|
+
constructionBaselineReplay: fields.length === 0,
|
|
77217
|
+
...readTracking === void 0 ? {} : { readTracking },
|
|
77218
|
+
saveStaticBindings: args.saveStaticBindings,
|
|
77219
|
+
sessionStaticBindings: args.sessionStaticBindings
|
|
77220
|
+
})
|
|
77221
|
+
);
|
|
76933
77222
|
};
|
|
76934
77223
|
const replayDeclaredDefault = () => {
|
|
76935
77224
|
const stampEnv = instanceRoot.genericBindings == null || Object.keys(instanceRoot.genericBindings).length === 0 ? null : envFromStamp(instanceRoot.genericBindings);
|
|
76936
|
-
const built =
|
|
76937
|
-
|
|
76938
|
-
|
|
76939
|
-
|
|
76940
|
-
|
|
76941
|
-
|
|
77225
|
+
const built = trackMaterialization(
|
|
77226
|
+
() => materializeMemberDefaultValue({
|
|
77227
|
+
document: args.document,
|
|
77228
|
+
member: replayMember,
|
|
77229
|
+
envelope,
|
|
77230
|
+
...stampEnv === null ? {} : { genericEnv: stampEnv },
|
|
77231
|
+
...readTracking === void 0 ? {} : { readTracking },
|
|
77232
|
+
saveStaticBindings: args.saveStaticBindings,
|
|
77233
|
+
sessionStaticBindings: args.sessionStaticBindings
|
|
77234
|
+
})
|
|
77235
|
+
);
|
|
76942
77236
|
return {
|
|
76943
77237
|
...built,
|
|
76944
77238
|
root: {
|
|
@@ -77049,8 +77343,7 @@ function resolveVirtualInstanceGraph(args) {
|
|
|
77049
77343
|
const materialized = effectiveMaterializedId === null ? null : readMaterializedRow(effectiveMaterializedId);
|
|
77050
77344
|
const effectiveId = materialized?.id ?? indexed.virtualId;
|
|
77051
77345
|
const effective = {
|
|
77052
|
-
...
|
|
77053
|
-
...materialized === null ? {} : cloneRow(materialized),
|
|
77346
|
+
...mergeExpandedAndMaterializedRow(indexed.expandedRow, materialized),
|
|
77054
77347
|
id: effectiveId,
|
|
77055
77348
|
// Virtual rows inherit partition and timestamps from the root. Real rows
|
|
77056
77349
|
// retain their own envelope through the spread above.
|
|
@@ -77093,7 +77386,7 @@ function resolveVirtualInstanceGraph(args) {
|
|
|
77093
77386
|
const listMember = indexed.member;
|
|
77094
77387
|
effective.value = [];
|
|
77095
77388
|
const childPaths = expansion.childPathsByParentPath.get(pathKey) ?? [];
|
|
77096
|
-
recorder?.
|
|
77389
|
+
recorder?.recordContainerMembershipRead(effectiveId);
|
|
77097
77390
|
const storedEntryIds = materializedUnorderedEntryIdsByContainerId.get(effectiveId) ?? [];
|
|
77098
77391
|
const storedEntries = storedEntryIds.flatMap((storedEntryId) => {
|
|
77099
77392
|
const entry = readMaterializedRow(storedEntryId);
|
|
@@ -77266,19 +77559,18 @@ function resolveVirtualInstanceGraph(args) {
|
|
|
77266
77559
|
root: rootLocation
|
|
77267
77560
|
};
|
|
77268
77561
|
}
|
|
77562
|
+
function mergeExpandedAndMaterializedRow(expanded, materialized) {
|
|
77563
|
+
const expandedClone = cloneRow(expanded);
|
|
77564
|
+
if (materialized === null) return expandedClone;
|
|
77565
|
+
const materializedClone = cloneRow(materialized);
|
|
77566
|
+
return isLiteralValueContent(materialized) ? overlayLiteralValueContent(expandedClone, materializedClone) : { ...expandedClone, ...materializedClone };
|
|
77567
|
+
}
|
|
77269
77568
|
function firstUnattributableExpansionMember(expansion) {
|
|
77270
77569
|
for (const node of expansion.nodesByPath.values()) {
|
|
77271
77570
|
const member = node.member;
|
|
77272
|
-
if (isMemberListBase(member) && listKindOf(member) === "unordered") {
|
|
77273
|
-
return `unordered-list-member:${node.memberId}`;
|
|
77274
|
-
}
|
|
77275
77571
|
if (CORPUS_SCANNING_MEMBER_KINDS.has(member.kind)) {
|
|
77276
77572
|
return `corpus-scanning-member-kind:${node.memberId}`;
|
|
77277
77573
|
}
|
|
77278
|
-
const declaredDefault = member.defaultValue;
|
|
77279
|
-
if (declaredDefault !== void 0 && declaredDefault !== null && "init" in declaredDefault && declaredDefault.init !== void 0 && declaredDefault.init !== null) {
|
|
77280
|
-
return `authored-initializer-member:${node.memberId}`;
|
|
77281
|
-
}
|
|
77282
77574
|
}
|
|
77283
77575
|
return null;
|
|
77284
77576
|
}
|
|
@@ -78668,7 +78960,8 @@ function resolveVariantInstanceGraphForDocument(args) {
|
|
|
78668
78960
|
const priorExpanded = expandStoredInstance({
|
|
78669
78961
|
document,
|
|
78670
78962
|
instanceRoot: args.priorInstanceRoot,
|
|
78671
|
-
rootMember
|
|
78963
|
+
rootMember,
|
|
78964
|
+
readRecorder: args.readRecorder
|
|
78672
78965
|
});
|
|
78673
78966
|
const priorGraph = resolveVirtualInstanceGraph({
|
|
78674
78967
|
document,
|
|
@@ -78676,7 +78969,8 @@ function resolveVariantInstanceGraphForDocument(args) {
|
|
|
78676
78969
|
rootMember,
|
|
78677
78970
|
expandedRoot: priorExpanded.root,
|
|
78678
78971
|
expandedRows: priorExpanded.rows,
|
|
78679
|
-
materializedRows: [...materializedById.values()]
|
|
78972
|
+
materializedRows: [...materializedById.values()],
|
|
78973
|
+
readRecorder: args.readRecorder
|
|
78680
78974
|
});
|
|
78681
78975
|
for (const valueId of args.answeredValueIds) {
|
|
78682
78976
|
if (!priorGraph.locationsById.has(valueId)) {
|
|
@@ -78704,7 +78998,8 @@ function resolveVariantInstanceGraphForDocument(args) {
|
|
|
78704
78998
|
const nextExpanded = expandStoredInstance({
|
|
78705
78999
|
document,
|
|
78706
79000
|
instanceRoot: args.nextInstanceRoot,
|
|
78707
|
-
rootMember
|
|
79001
|
+
rootMember,
|
|
79002
|
+
readRecorder: args.readRecorder
|
|
78708
79003
|
});
|
|
78709
79004
|
const nextGraph = resolveVirtualInstanceGraph({
|
|
78710
79005
|
document,
|
|
@@ -78712,7 +79007,8 @@ function resolveVariantInstanceGraphForDocument(args) {
|
|
|
78712
79007
|
rootMember,
|
|
78713
79008
|
expandedRoot: nextExpanded.root,
|
|
78714
79009
|
expandedRows: nextExpanded.rows,
|
|
78715
|
-
materializedRows: [...materializedById.values()]
|
|
79010
|
+
materializedRows: [...materializedById.values()],
|
|
79011
|
+
readRecorder: args.readRecorder
|
|
78716
79012
|
});
|
|
78717
79013
|
const root = nextGraph.rowsById.get(args.nextInstanceRoot.id);
|
|
78718
79014
|
if (root === void 0) {
|
|
@@ -78787,7 +79083,8 @@ function createHeadlessVirtualInstanceResolver(args) {
|
|
|
78787
79083
|
const expanded = expandStoredInstance({
|
|
78788
79084
|
document: resolverDocument,
|
|
78789
79085
|
instanceRoot,
|
|
78790
|
-
rootMember: member
|
|
79086
|
+
rootMember: member,
|
|
79087
|
+
readRecorder: args.readRecorder
|
|
78791
79088
|
});
|
|
78792
79089
|
const graph = resolveVirtualInstanceGraph({
|
|
78793
79090
|
document: resolverDocument,
|
|
@@ -78795,7 +79092,8 @@ function createHeadlessVirtualInstanceResolver(args) {
|
|
|
78795
79092
|
rootMember: member,
|
|
78796
79093
|
expandedRoot: expanded.root,
|
|
78797
79094
|
expandedRows: expanded.rows,
|
|
78798
|
-
materializedIndex
|
|
79095
|
+
materializedIndex,
|
|
79096
|
+
readRecorder: args.readRecorder
|
|
78799
79097
|
});
|
|
78800
79098
|
graphRowsByRootId.set(rootId, graph.rowsById);
|
|
78801
79099
|
for (const [id2, row] of graph.rowsById) {
|
|
@@ -78816,8 +79114,11 @@ function createHeadlessVirtualInstanceResolver(args) {
|
|
|
78816
79114
|
}
|
|
78817
79115
|
};
|
|
78818
79116
|
const virtualInstanceRowsForValue = (receiverValueId) => {
|
|
79117
|
+
args.readRecorder?.recordValuePlacementRead();
|
|
79118
|
+
args.readRecorder?.recordValueRead(receiverValueId);
|
|
78819
79119
|
let placement = placements().get(receiverValueId) ?? null;
|
|
78820
79120
|
while (placement !== null) {
|
|
79121
|
+
args.readRecorder?.recordValueRead(placement.valueId);
|
|
78821
79122
|
const raw = rawById.get(placement.valueId);
|
|
78822
79123
|
if (raw !== void 0 && isLiteralValueContent(raw) && isVirtualInstanceRootShape(raw)) {
|
|
78823
79124
|
return [...expandRoot(placement.valueId, placement.memberId).values()];
|
|
@@ -78838,7 +79139,7 @@ function createHeadlessVirtualInstanceResolver(args) {
|
|
|
78838
79139
|
}
|
|
78839
79140
|
};
|
|
78840
79141
|
}
|
|
78841
|
-
var KEPT_ROW_SAMPLE_LIMIT, CORPUS_SCANNING_MEMBER_KINDS,
|
|
79142
|
+
var KEPT_ROW_SAMPLE_LIMIT, CORPUS_SCANNING_MEMBER_KINDS, VirtualExpansionUnsupportedError, ROOT_PATH, SYNTHETIC_LINEAGE_PREFIXES, resolverDocumentsByDocument;
|
|
78842
79143
|
var init_virtual_instance_values = __esm({
|
|
78843
79144
|
"../src/database/virtual-instance-values.ts"() {
|
|
78844
79145
|
"use strict";
|
|
@@ -78852,6 +79153,7 @@ var init_virtual_instance_values = __esm({
|
|
|
78852
79153
|
init_instance_provenance();
|
|
78853
79154
|
init_unordered_list_membership();
|
|
78854
79155
|
init_neoscript();
|
|
79156
|
+
init_evaluateInitializer();
|
|
78855
79157
|
init_init_backed_value_materialization();
|
|
78856
79158
|
init_constructor_argument_ownership();
|
|
78857
79159
|
init_constructors2();
|
|
@@ -78859,15 +79161,8 @@ var init_virtual_instance_values = __esm({
|
|
|
78859
79161
|
KEPT_ROW_SAMPLE_LIMIT = 12;
|
|
78860
79162
|
CORPUS_SCANNING_MEMBER_KINDS = /* @__PURE__ */ new Set([
|
|
78861
79163
|
9 /* Lookup */,
|
|
78862
|
-
18 /* DialogueLookup
|
|
78863
|
-
10 /* NSProperty */,
|
|
78864
|
-
23 /* NSFunction */,
|
|
78865
|
-
13 /* Function */,
|
|
78866
|
-
24 /* FunctionRef */,
|
|
78867
|
-
25 /* NSDelegate */,
|
|
78868
|
-
26 /* NSAction */
|
|
79164
|
+
18 /* DialogueLookup */
|
|
78869
79165
|
]);
|
|
78870
|
-
CONSTRUCTOR_TYPE_WALK_DEPTH_LIMIT = 8;
|
|
78871
79166
|
VirtualExpansionUnsupportedError = class extends Error {
|
|
78872
79167
|
constructor(message) {
|
|
78873
79168
|
super(message);
|
|
@@ -78881,24 +79176,74 @@ var init_virtual_instance_values = __esm({
|
|
|
78881
79176
|
});
|
|
78882
79177
|
|
|
78883
79178
|
// ../src/view-models/neoscript-evaluator/evaluateInitializer.ts
|
|
78884
|
-
function
|
|
78885
|
-
|
|
78886
|
-
|
|
78887
|
-
|
|
78888
|
-
|
|
79179
|
+
function initializerEvaluatorCacheKey(document) {
|
|
79180
|
+
return document.evaluatorCache?.key ?? document;
|
|
79181
|
+
}
|
|
79182
|
+
function initializerEvaluatorCacheRevision(document) {
|
|
79183
|
+
return document.evaluatorCache?.revision;
|
|
79184
|
+
}
|
|
79185
|
+
function initializerEvaluatorLookups(document, readTracking) {
|
|
79186
|
+
const trackedHeadless = readTracking !== void 0 && document.databaseVM === void 0;
|
|
79187
|
+
const indexKey = initializerEvaluatorCacheKey(document);
|
|
79188
|
+
const lookupKey = document.databaseVM ?? indexKey;
|
|
79189
|
+
const revision = initializerEvaluatorCacheRevision(document);
|
|
79190
|
+
const cached = evaluatorLookupsByDocument.get(lookupKey);
|
|
79191
|
+
if (!trackedHeadless && cached !== void 0 && (revision === void 0 ? cached.members === document.members && cached.values === document.values : cached.revision === revision)) {
|
|
78889
79192
|
return cached.lookups;
|
|
78890
79193
|
}
|
|
78891
|
-
|
|
78892
|
-
document.
|
|
78893
|
-
|
|
78894
|
-
|
|
78895
|
-
|
|
78896
|
-
|
|
78897
|
-
|
|
79194
|
+
if (document.databaseVM !== void 0) {
|
|
79195
|
+
const databaseVM = document.databaseVM;
|
|
79196
|
+
const lookups2 = {
|
|
79197
|
+
memberById: (id2) => databaseVM.memberById(id2),
|
|
79198
|
+
valueById: (id2) => databaseVM.valueById(id2),
|
|
79199
|
+
localizedTextById: (id2) => databaseVM.localizedTextById?.(id2) ?? null,
|
|
79200
|
+
...databaseVM.hasStoredValueId === void 0 ? {} : {
|
|
79201
|
+
hasStoredValueId: (id2) => databaseVM.hasStoredValueId?.(id2) ?? false
|
|
79202
|
+
},
|
|
79203
|
+
variantById: (id2) => databaseVM.variantById?.(id2) ?? null,
|
|
79204
|
+
storedValuePlacementForValueId: (id2) => databaseVM.storedValuePlacementForValueId?.(id2) ?? null,
|
|
79205
|
+
unorderedListEntryIds: (containerValueId) => {
|
|
79206
|
+
const resolved = databaseVM.unorderedListEntryIds?.(containerValueId);
|
|
79207
|
+
if (resolved === void 0) {
|
|
79208
|
+
throw new Error(
|
|
79209
|
+
`Evaluator database resolves no unordered-list membership for container "${containerValueId}".`
|
|
79210
|
+
);
|
|
79211
|
+
}
|
|
79212
|
+
return resolved;
|
|
79213
|
+
},
|
|
79214
|
+
virtualInstanceRowsForValue: (receiverValueId) => databaseVM.virtualInstanceRowsForValue(receiverValueId),
|
|
79215
|
+
rowForValueReference: (value) => databaseVM.rowForValueReference?.(value) ?? null,
|
|
79216
|
+
resolveVariantInstanceGraph: (args) => {
|
|
79217
|
+
const resolver = databaseVM.resolveVariantInstanceGraph;
|
|
79218
|
+
if (resolver === void 0) {
|
|
79219
|
+
throw new Error(
|
|
79220
|
+
"Evaluator database has no virtual variant resolver."
|
|
79221
|
+
);
|
|
79222
|
+
}
|
|
79223
|
+
return resolver.call(databaseVM, args);
|
|
79224
|
+
},
|
|
79225
|
+
...databaseVM.evaluatorIndexes === void 0 ? {} : { evaluatorIndexes: databaseVM.evaluatorIndexes },
|
|
79226
|
+
...databaseVM.constructorInitializerIndexes === void 0 ? {} : {
|
|
79227
|
+
constructorInitializerIndexes: databaseVM.constructorInitializerIndexes
|
|
79228
|
+
}
|
|
79229
|
+
};
|
|
79230
|
+
evaluatorLookupsByDocument.set(lookupKey, {
|
|
79231
|
+
members: document.members,
|
|
79232
|
+
values: document.values,
|
|
79233
|
+
revision,
|
|
79234
|
+
lookups: lookups2
|
|
79235
|
+
});
|
|
79236
|
+
return lookups2;
|
|
79237
|
+
}
|
|
79238
|
+
const indexedLookups = indexedInitializerEvaluatorLookups(
|
|
79239
|
+
document,
|
|
79240
|
+
indexKey,
|
|
79241
|
+
revision
|
|
78898
79242
|
);
|
|
78899
79243
|
const headlessVirtualResolver = document.databaseVM === void 0 ? createHeadlessVirtualInstanceResolver({
|
|
78900
79244
|
document,
|
|
78901
|
-
resolverLookups: () => lookups
|
|
79245
|
+
resolverLookups: () => lookups,
|
|
79246
|
+
...readTracking === void 0 ? {} : { readRecorder: virtualReadRecorder(readTracking) }
|
|
78902
79247
|
}) : null;
|
|
78903
79248
|
const lookups = {
|
|
78904
79249
|
...indexedLookups,
|
|
@@ -78916,11 +79261,13 @@ function initializerEvaluatorLookups(document) {
|
|
|
78916
79261
|
resolveVariantInstanceGraph: (args) => resolveVariantInstanceGraphForDocument({
|
|
78917
79262
|
document,
|
|
78918
79263
|
resolverLookups: lookups,
|
|
79264
|
+
...readTracking === void 0 ? {} : { readRecorder: virtualReadRecorder(readTracking) },
|
|
78919
79265
|
...args
|
|
78920
79266
|
})
|
|
78921
79267
|
} : {
|
|
78922
79268
|
memberById: (id2) => document.databaseVM?.memberById(id2) ?? null,
|
|
78923
79269
|
valueById: (id2) => document.databaseVM?.valueById(id2) ?? null,
|
|
79270
|
+
variantById: (id2) => document.databaseVM?.variantById?.(id2) ?? null,
|
|
78924
79271
|
// The VM's `valueById` answers EXPANDED-first: a collapse-stamped
|
|
78925
79272
|
// root resolves to a record the VM minted, an object the raw value
|
|
78926
79273
|
// index has never seen. Reference-identity dispatch (`.Id`, `is`,
|
|
@@ -78954,7 +79301,26 @@ function initializerEvaluatorLookups(document) {
|
|
|
78954
79301
|
}
|
|
78955
79302
|
}
|
|
78956
79303
|
};
|
|
78957
|
-
|
|
79304
|
+
if (!trackedHeadless) {
|
|
79305
|
+
evaluatorLookupsByDocument.set(lookupKey, {
|
|
79306
|
+
members: document.members,
|
|
79307
|
+
values: document.values,
|
|
79308
|
+
revision,
|
|
79309
|
+
lookups
|
|
79310
|
+
});
|
|
79311
|
+
}
|
|
79312
|
+
return lookups;
|
|
79313
|
+
}
|
|
79314
|
+
function indexedInitializerEvaluatorLookups(document, key, revision) {
|
|
79315
|
+
const cached = indexedEvaluatorLookupsByDocument.get(key);
|
|
79316
|
+
if (cached !== void 0 && (revision === void 0 ? cached.members === document.members && cached.values === document.values : cached.revision === revision)) {
|
|
79317
|
+
return cached.lookups;
|
|
79318
|
+
}
|
|
79319
|
+
const lookups = makeEvaluatorLookups(document.members, document.values, {
|
|
79320
|
+
includeValueGraphIndexes: true,
|
|
79321
|
+
constructorInitializerDocument: document
|
|
79322
|
+
});
|
|
79323
|
+
indexedEvaluatorLookupsByDocument.set(key, {
|
|
78958
79324
|
members: document.members,
|
|
78959
79325
|
values: document.values,
|
|
78960
79326
|
revision,
|
|
@@ -78962,22 +79328,61 @@ function initializerEvaluatorLookups(document) {
|
|
|
78962
79328
|
});
|
|
78963
79329
|
return lookups;
|
|
78964
79330
|
}
|
|
78965
|
-
function buildInitializerRootValueWithLookups(document, lookups) {
|
|
79331
|
+
function buildInitializerRootValueWithLookups(document, lookups, tracking) {
|
|
78966
79332
|
const rootValue = {};
|
|
78967
79333
|
for (const { root, memberId } of projectRootMembersInDisplayOrder(
|
|
78968
79334
|
document.project
|
|
78969
79335
|
)) {
|
|
78970
79336
|
const member = lookups.memberById(memberId);
|
|
78971
|
-
if (member === null
|
|
79337
|
+
if (member === null) {
|
|
79338
|
+
rootValue[root.key] = null;
|
|
79339
|
+
continue;
|
|
79340
|
+
}
|
|
79341
|
+
tracking?.staticMemberDependencies?.add(member.id);
|
|
79342
|
+
const bindings = root.storage === "save" /* Save */ ? tracking?.saveStaticBindings : root.storage === "session" /* Session */ ? tracking?.sessionStaticBindings : void 0;
|
|
79343
|
+
const boundTarget = staticBindingEntry(bindings, member.id);
|
|
79344
|
+
const targetId = boundTarget.present ? boundTarget.value : member.valueId;
|
|
79345
|
+
if (typeof targetId !== "string") {
|
|
78972
79346
|
rootValue[root.key] = null;
|
|
78973
79347
|
continue;
|
|
78974
79348
|
}
|
|
78975
|
-
|
|
79349
|
+
tracking?.valueDependencies?.add(targetId);
|
|
79350
|
+
rootValue[root.key] = lookups.valueById(targetId)?.value ?? null;
|
|
78976
79351
|
}
|
|
78977
79352
|
return rootValue;
|
|
78978
79353
|
}
|
|
79354
|
+
function staticBindingEntry(bindings, memberId) {
|
|
79355
|
+
if (bindings === void 0) return { present: false, value: null };
|
|
79356
|
+
if (isStaticBindingMap(bindings)) {
|
|
79357
|
+
return {
|
|
79358
|
+
present: bindings.has(memberId),
|
|
79359
|
+
value: bindings.get(memberId) ?? null
|
|
79360
|
+
};
|
|
79361
|
+
}
|
|
79362
|
+
return {
|
|
79363
|
+
present: Object.hasOwn(bindings, memberId),
|
|
79364
|
+
value: bindings[memberId] ?? null
|
|
79365
|
+
};
|
|
79366
|
+
}
|
|
79367
|
+
function isStaticBindingMap(bindings) {
|
|
79368
|
+
return "get" in bindings && typeof bindings.get === "function" && "has" in bindings && typeof bindings.has === "function";
|
|
79369
|
+
}
|
|
79370
|
+
function virtualReadRecorder(reads) {
|
|
79371
|
+
return {
|
|
79372
|
+
recordValueRead: (id2) => reads.valueIds.add(id2),
|
|
79373
|
+
recordLocalizedTextRead: (id2) => reads.localizedTextIds.add(id2),
|
|
79374
|
+
recordVariantRead: (id2) => reads.variantIds.add(id2),
|
|
79375
|
+
recordStaticMemberRead: (id2) => reads.staticMemberIds.add(id2),
|
|
79376
|
+
recordContainerMembershipRead: (id2) => reads.containerIds.add(id2),
|
|
79377
|
+
recordValuePlacementRead: reads.recordValuePlacementRead,
|
|
79378
|
+
recordGlobalRead: reads.recordUnattributableValueRead
|
|
79379
|
+
};
|
|
79380
|
+
}
|
|
78979
79381
|
function evaluateMemberInitializer(args) {
|
|
78980
|
-
const databaseVM = initializerEvaluatorLookups(
|
|
79382
|
+
const databaseVM = initializerEvaluatorLookups(
|
|
79383
|
+
args.document,
|
|
79384
|
+
args.readTracking
|
|
79385
|
+
);
|
|
78981
79386
|
const initializerIndexes = databaseVM.constructorInitializerIndexes;
|
|
78982
79387
|
const compileMemberId = initializerIndexes?.initializerScopeMemberIds.get(args.init) ?? (args.sourceValueId === null || args.sourceValueId === void 0 ? void 0 : initializerIndexes?.initializerScopeMemberIdsByValueId.get(
|
|
78983
79388
|
args.sourceValueId
|
|
@@ -79013,7 +79418,18 @@ function evaluateMemberInitializer(args) {
|
|
|
79013
79418
|
initializerCompiler: args.document.initializerCompiler
|
|
79014
79419
|
},
|
|
79015
79420
|
thisValue: null,
|
|
79016
|
-
rootValue: buildInitializerRootValueWithLookups(args.document, databaseVM
|
|
79421
|
+
rootValue: buildInitializerRootValueWithLookups(args.document, databaseVM, {
|
|
79422
|
+
valueDependencies: args.readTracking?.valueIds,
|
|
79423
|
+
staticMemberDependencies: args.readTracking?.staticMemberIds,
|
|
79424
|
+
saveStaticBindings: args.saveStaticBindings,
|
|
79425
|
+
sessionStaticBindings: args.sessionStaticBindings
|
|
79426
|
+
}),
|
|
79427
|
+
valueDependencies: args.readTracking?.valueIds,
|
|
79428
|
+
localizedTextDependencies: args.readTracking?.localizedTextIds,
|
|
79429
|
+
variantDependencies: args.readTracking?.variantIds,
|
|
79430
|
+
containerDependencies: args.readTracking?.containerIds,
|
|
79431
|
+
staticMemberDependencies: args.readTracking?.staticMemberIds,
|
|
79432
|
+
onUnattributableValueRead: args.readTracking?.recordUnattributableValueRead,
|
|
79017
79433
|
saveStaticBindings: args.saveStaticBindings,
|
|
79018
79434
|
sessionStaticBindings: args.sessionStaticBindings,
|
|
79019
79435
|
...args.storedConstructionReplay === true ? {
|
|
@@ -79076,7 +79492,7 @@ function evaluateMemberInitializer(args) {
|
|
|
79076
79492
|
}
|
|
79077
79493
|
};
|
|
79078
79494
|
}
|
|
79079
|
-
var evaluatorLookupsByDocument;
|
|
79495
|
+
var evaluatorLookupsByDocument, indexedEvaluatorLookupsByDocument, InitializerReadSet;
|
|
79080
79496
|
var init_evaluateInitializer = __esm({
|
|
79081
79497
|
"../src/view-models/neoscript-evaluator/evaluateInitializer.ts"() {
|
|
79082
79498
|
"use strict";
|
|
@@ -79087,6 +79503,23 @@ var init_evaluateInitializer = __esm({
|
|
|
79087
79503
|
init_evaluateNSGetter();
|
|
79088
79504
|
init_virtual_instance_values();
|
|
79089
79505
|
evaluatorLookupsByDocument = /* @__PURE__ */ new WeakMap();
|
|
79506
|
+
indexedEvaluatorLookupsByDocument = /* @__PURE__ */ new WeakMap();
|
|
79507
|
+
InitializerReadSet = class {
|
|
79508
|
+
valueIds = /* @__PURE__ */ new Set();
|
|
79509
|
+
localizedTextIds = /* @__PURE__ */ new Set();
|
|
79510
|
+
variantIds = /* @__PURE__ */ new Set();
|
|
79511
|
+
containerIds = /* @__PURE__ */ new Set();
|
|
79512
|
+
staticMemberIds = /* @__PURE__ */ new Set();
|
|
79513
|
+
hasValuePlacementRead = false;
|
|
79514
|
+
hasUnattributableValueRead = false;
|
|
79515
|
+
recordUnattributableValueRead = (_reason) => {
|
|
79516
|
+
void _reason;
|
|
79517
|
+
this.hasUnattributableValueRead = true;
|
|
79518
|
+
};
|
|
79519
|
+
recordValuePlacementRead = () => {
|
|
79520
|
+
this.hasValuePlacementRead = true;
|
|
79521
|
+
};
|
|
79522
|
+
};
|
|
79090
79523
|
}
|
|
79091
79524
|
});
|
|
79092
79525
|
|
|
@@ -79102,8 +79535,12 @@ var init_neoscript_evaluator = __esm({
|
|
|
79102
79535
|
|
|
79103
79536
|
// ../src/database/init-backed-value-materialization.ts
|
|
79104
79537
|
function declarationInitializerContext(document) {
|
|
79105
|
-
const
|
|
79106
|
-
|
|
79538
|
+
const key = initializerEvaluatorCacheKey(document);
|
|
79539
|
+
const revision = initializerEvaluatorCacheRevision(document);
|
|
79540
|
+
const cached = declarationInitializerContextByDocument.get(key);
|
|
79541
|
+
if (cached !== void 0 && (revision === void 0 ? cached.members === document.members && cached.values === document.values : cached.revision === revision)) {
|
|
79542
|
+
return cached.context;
|
|
79543
|
+
}
|
|
79107
79544
|
const initializerValueIds = new Set(
|
|
79108
79545
|
document.values.filter(isInitValueContent).map((value) => value.id)
|
|
79109
79546
|
);
|
|
@@ -79118,7 +79555,12 @@ function declarationInitializerContext(document) {
|
|
|
79118
79555
|
rootOwners
|
|
79119
79556
|
);
|
|
79120
79557
|
const created = { valuesById, rootOwners };
|
|
79121
|
-
declarationInitializerContextByDocument.set(
|
|
79558
|
+
declarationInitializerContextByDocument.set(key, {
|
|
79559
|
+
members: document.members,
|
|
79560
|
+
values: document.values,
|
|
79561
|
+
revision,
|
|
79562
|
+
context: created
|
|
79563
|
+
});
|
|
79122
79564
|
return created;
|
|
79123
79565
|
}
|
|
79124
79566
|
function evaluateInitializerMaterialization(args) {
|
|
@@ -79133,7 +79575,10 @@ function evaluateInitializerMaterialization(args) {
|
|
|
79133
79575
|
...args.storedConstructionReplay === true ? { storedConstructionReplay: true } : {},
|
|
79134
79576
|
...args.constructionBaselineReplay === true ? { constructionBaselineReplay: true } : {},
|
|
79135
79577
|
...args.argumentValues === void 0 ? {} : { argumentValues: args.argumentValues },
|
|
79136
|
-
sourceValueId: args.sourceValueId ?? null
|
|
79578
|
+
sourceValueId: args.sourceValueId ?? null,
|
|
79579
|
+
readTracking: args.readTracking,
|
|
79580
|
+
saveStaticBindings: args.saveStaticBindings,
|
|
79581
|
+
sessionStaticBindings: args.sessionStaticBindings
|
|
79137
79582
|
});
|
|
79138
79583
|
return { evaluated, createdValues, storageKeyDeclarations };
|
|
79139
79584
|
}
|
|
@@ -79169,7 +79614,10 @@ function materializeInitializerValue(args) {
|
|
|
79169
79614
|
...args.storedConstructionReplay === true ? { storedConstructionReplay: true } : {},
|
|
79170
79615
|
...args.constructionBaselineReplay === true ? { constructionBaselineReplay: true } : {},
|
|
79171
79616
|
...args.argumentValues === void 0 ? {} : { argumentValues: args.argumentValues },
|
|
79172
|
-
sourceValueId: args.row.id
|
|
79617
|
+
sourceValueId: args.row.id,
|
|
79618
|
+
readTracking: args.readTracking,
|
|
79619
|
+
saveStaticBindings: args.saveStaticBindings,
|
|
79620
|
+
sessionStaticBindings: args.sessionStaticBindings
|
|
79173
79621
|
});
|
|
79174
79622
|
const {
|
|
79175
79623
|
init: _init,
|
|
@@ -79177,6 +79625,9 @@ function materializeInitializerValue(args) {
|
|
|
79177
79625
|
classId: _classId,
|
|
79178
79626
|
...envelope
|
|
79179
79627
|
} = args.row;
|
|
79628
|
+
void _init;
|
|
79629
|
+
void _value;
|
|
79630
|
+
void _classId;
|
|
79180
79631
|
const root = {
|
|
79181
79632
|
...envelope,
|
|
79182
79633
|
value: evaluated.value,
|
|
@@ -79212,6 +79663,9 @@ function materializeInitializerValue(args) {
|
|
|
79212
79663
|
function materializeMemberDefaultValue(args) {
|
|
79213
79664
|
const createdValues = [];
|
|
79214
79665
|
const storageKeyDeclarations = /* @__PURE__ */ new Map();
|
|
79666
|
+
args.readTracking?.recordUnattributableValueRead(
|
|
79667
|
+
`declaration-owner-resolution:${args.envelope.id}`
|
|
79668
|
+
);
|
|
79215
79669
|
const { valuesById, rootOwners } = declarationInitializerContext(
|
|
79216
79670
|
args.document
|
|
79217
79671
|
);
|
|
@@ -79232,15 +79686,14 @@ function materializeMemberDefaultValue(args) {
|
|
|
79232
79686
|
(candidate) => candidate.id === constructorId
|
|
79233
79687
|
);
|
|
79234
79688
|
if (constructor2 === void 0) return [];
|
|
79235
|
-
const defaults = parameterDefaultsAsFullArguments(
|
|
79236
|
-
constructor2.argumentTypes,
|
|
79237
|
-
`Declaration template on '${ownerClass.name}'`
|
|
79238
|
-
);
|
|
79239
|
-
if (defaults !== null) return defaults;
|
|
79240
79689
|
const parameterNames = new Set(
|
|
79241
79690
|
constructor2.argumentTypes.map((argument2) => argument2.name)
|
|
79242
79691
|
);
|
|
79243
|
-
return
|
|
79692
|
+
return declarationInitializerArgumentValues(
|
|
79693
|
+
constructor2.argumentTypes,
|
|
79694
|
+
`Declaration template on '${ownerClass.name}'`,
|
|
79695
|
+
initializerReferencesAnyIdentifier(init.code, parameterNames)
|
|
79696
|
+
);
|
|
79244
79697
|
};
|
|
79245
79698
|
const built = buildDefaultMemberValue({
|
|
79246
79699
|
document: args.document,
|
|
@@ -79262,7 +79715,10 @@ function materializeMemberDefaultValue(args) {
|
|
|
79262
79715
|
init,
|
|
79263
79716
|
sourceValueId ?? null
|
|
79264
79717
|
),
|
|
79265
|
-
sourceValueId: sourceValueId ?? null
|
|
79718
|
+
sourceValueId: sourceValueId ?? null,
|
|
79719
|
+
readTracking: args.readTracking,
|
|
79720
|
+
saveStaticBindings: args.saveStaticBindings,
|
|
79721
|
+
sessionStaticBindings: args.sessionStaticBindings
|
|
79266
79722
|
})
|
|
79267
79723
|
});
|
|
79268
79724
|
const interior = createdValues.filter((created) => created.id !== built.id);
|
|
@@ -79292,6 +79748,7 @@ var init_init_backed_value_materialization = __esm({
|
|
|
79292
79748
|
init_inheritance();
|
|
79293
79749
|
init_neoscript_evaluator();
|
|
79294
79750
|
init_evaluateNSGetter();
|
|
79751
|
+
init_evaluateInitializer();
|
|
79295
79752
|
init_value_row_owner_members();
|
|
79296
79753
|
init_compile_ns_property();
|
|
79297
79754
|
declarationInitializerContextByDocument = /* @__PURE__ */ new WeakMap();
|
|
@@ -87811,7 +88268,11 @@ function validateWorldLayerLinkClassTargets(args) {
|
|
|
87811
88268
|
}
|
|
87812
88269
|
}
|
|
87813
88270
|
function worldLayerLinkTargetDescriptorForClass(classId, classes) {
|
|
87814
|
-
|
|
88271
|
+
return worldLayerLinkTargetDescriptor(
|
|
88272
|
+
resolveWorldSystemClassKind(classId, classes)
|
|
88273
|
+
);
|
|
88274
|
+
}
|
|
88275
|
+
function worldLayerLinkTargetDescriptor(worldKind) {
|
|
87815
88276
|
if (worldKind === NeoWorldSystemClassKind.TileLayerLink) {
|
|
87816
88277
|
return {
|
|
87817
88278
|
relationKind: InternalRecordRelationKind.WorldTileLayerLinkTarget,
|
|
@@ -87833,9 +88294,11 @@ function worldLayerLinkTargetRelations(classId, descriptor, relations) {
|
|
|
87833
88294
|
}
|
|
87834
88295
|
function resolveWorldLayerLinkTarget(args) {
|
|
87835
88296
|
const label = args.linkLabel ?? `Layer-link class "${args.sourceClassId}"`;
|
|
87836
|
-
const
|
|
87837
|
-
|
|
87838
|
-
|
|
88297
|
+
const relationResolver = args.relationResolver ?? createEffectiveClassRelationResolver({
|
|
88298
|
+
classes: args.classes,
|
|
88299
|
+
relations: args.relations
|
|
88300
|
+
});
|
|
88301
|
+
const sourceClass = relationResolver.classesById.get(args.sourceClassId);
|
|
87839
88302
|
if (sourceClass === void 0) {
|
|
87840
88303
|
throw new Error(
|
|
87841
88304
|
`${label} references missing class "${args.sourceClassId}".`
|
|
@@ -87846,21 +88309,18 @@ function resolveWorldLayerLinkTarget(args) {
|
|
|
87846
88309
|
`${label} cannot instantiate abstract class "${args.sourceClassId}".`
|
|
87847
88310
|
);
|
|
87848
88311
|
}
|
|
87849
|
-
const descriptor = worldLayerLinkTargetDescriptorForClass(
|
|
87850
|
-
args.sourceClassId
|
|
87851
|
-
args.classes
|
|
88312
|
+
const descriptor = args.worldKindsByClassId === void 0 ? worldLayerLinkTargetDescriptorForClass(args.sourceClassId, args.classes) : worldLayerLinkTargetDescriptor(
|
|
88313
|
+
args.worldKindsByClassId.get(args.sourceClassId) ?? null
|
|
87852
88314
|
);
|
|
87853
88315
|
if (descriptor === null) {
|
|
87854
88316
|
throw new Error(
|
|
87855
88317
|
`${label} class "${args.sourceClassId}" is not a tile/object layer-link class.`
|
|
87856
88318
|
);
|
|
87857
88319
|
}
|
|
87858
|
-
const effective =
|
|
87859
|
-
|
|
87860
|
-
|
|
87861
|
-
|
|
87862
|
-
classes: args.classes
|
|
87863
|
-
});
|
|
88320
|
+
const effective = relationResolver.resolve(
|
|
88321
|
+
descriptor.relationKind,
|
|
88322
|
+
args.sourceClassId
|
|
88323
|
+
);
|
|
87864
88324
|
if (effective.length > 1) {
|
|
87865
88325
|
throw new Error(
|
|
87866
88326
|
`${label} class "${args.sourceClassId}" resolves more than one effective target for relation kind "${descriptor.relationKind}".`
|
|
@@ -87868,8 +88328,8 @@ function resolveWorldLayerLinkTarget(args) {
|
|
|
87868
88328
|
}
|
|
87869
88329
|
const relationTarget = effective[0] ?? null;
|
|
87870
88330
|
if (relationTarget !== null) {
|
|
87871
|
-
const declarationClass =
|
|
87872
|
-
|
|
88331
|
+
const declarationClass = relationResolver.classesById.get(
|
|
88332
|
+
relationTarget.declaredSourceRecordId
|
|
87873
88333
|
);
|
|
87874
88334
|
if (declarationClass?.system?.worldKind === NeoWorldSystemClassKind.TileLayerLink || declarationClass?.system?.worldKind === NeoWorldSystemClassKind.ObjectLayerLink) {
|
|
87875
88335
|
throw new Error(
|
|
@@ -87883,9 +88343,7 @@ function resolveWorldLayerLinkTarget(args) {
|
|
|
87883
88343
|
);
|
|
87884
88344
|
}
|
|
87885
88345
|
const targetClassId = relationTarget.targetRecordId;
|
|
87886
|
-
const targetClass =
|
|
87887
|
-
(candidate) => candidate.id === targetClassId
|
|
87888
|
-
);
|
|
88346
|
+
const targetClass = relationResolver.classesById.get(targetClassId);
|
|
87889
88347
|
if (targetClass === void 0) {
|
|
87890
88348
|
throw new Error(`${label} targets missing layer class "${targetClassId}".`);
|
|
87891
88349
|
}
|
|
@@ -87894,10 +88352,7 @@ function resolveWorldLayerLinkTarget(args) {
|
|
|
87894
88352
|
`${label} targets abstract layer class "${targetClassId}".`
|
|
87895
88353
|
);
|
|
87896
88354
|
}
|
|
87897
|
-
const targetWorldKind = resolveWorldSystemClassKind(
|
|
87898
|
-
targetClass.id,
|
|
87899
|
-
args.classes
|
|
87900
|
-
);
|
|
88355
|
+
const targetWorldKind = args.worldKindsByClassId?.get(targetClass.id) ?? resolveWorldSystemClassKind(targetClass.id, args.classes);
|
|
87901
88356
|
if (targetWorldKind !== descriptor.targetWorldKind) {
|
|
87902
88357
|
throw new Error(
|
|
87903
88358
|
`${label} targets class "${targetClassId}" of world kind "${String(targetWorldKind)}"; expected "${descriptor.targetWorldKind}".`
|
|
@@ -98277,7 +98732,7 @@ function reconcileVariantConstructorArgs(args) {
|
|
|
98277
98732
|
const valueById = indexRecordsById(postDocument.values);
|
|
98278
98733
|
const classById = indexRecordsById(postDocument.classes);
|
|
98279
98734
|
const memberById2 = indexRecordsById(postDocument.members);
|
|
98280
|
-
const
|
|
98735
|
+
const constructorById2 = indexRecordsById(postDocument.constructors ?? []);
|
|
98281
98736
|
let baseHashByValueId = null;
|
|
98282
98737
|
for (const variant of variants) {
|
|
98283
98738
|
const root = valueById.get(variant.valueId);
|
|
@@ -98290,7 +98745,7 @@ function reconcileVariantConstructorArgs(args) {
|
|
|
98290
98745
|
if (schemaClass2 === void 0) continue;
|
|
98291
98746
|
const constructorId = schemaClass2.requiredConstructorId;
|
|
98292
98747
|
if (typeof constructorId !== "string") continue;
|
|
98293
|
-
const constructorRecord =
|
|
98748
|
+
const constructorRecord = constructorById2.get(constructorId);
|
|
98294
98749
|
if (constructorRecord === void 0) continue;
|
|
98295
98750
|
if (typeof root.value !== "object" || root.value === null) continue;
|
|
98296
98751
|
if (Array.isArray(root.value)) continue;
|
|
@@ -99463,7 +99918,7 @@ function animationFamilyClasses(document) {
|
|
|
99463
99918
|
const classes = new Map(document.classes.map((entry) => [entry.id, entry]));
|
|
99464
99919
|
const animationKinds = new Set(WORLD_SYSTEM_ANIMATION_KINDS);
|
|
99465
99920
|
const result = /* @__PURE__ */ new Map();
|
|
99466
|
-
const
|
|
99921
|
+
const resolve5 = (classId, visiting) => {
|
|
99467
99922
|
const cached = result.get(classId);
|
|
99468
99923
|
if (cached !== void 0) return cached;
|
|
99469
99924
|
if (visiting.has(classId)) return false;
|
|
@@ -99475,11 +99930,11 @@ function animationFamilyClasses(document) {
|
|
|
99475
99930
|
return true;
|
|
99476
99931
|
}
|
|
99477
99932
|
const nextVisiting = new Set(visiting).add(classId);
|
|
99478
|
-
const belongs = typeof schemaClass2.extendsClassId === "string" &&
|
|
99933
|
+
const belongs = typeof schemaClass2.extendsClassId === "string" && resolve5(schemaClass2.extendsClassId, nextVisiting);
|
|
99479
99934
|
result.set(classId, belongs);
|
|
99480
99935
|
return belongs;
|
|
99481
99936
|
};
|
|
99482
|
-
for (const classId of classes.keys())
|
|
99937
|
+
for (const classId of classes.keys()) resolve5(classId, /* @__PURE__ */ new Set());
|
|
99483
99938
|
return new Set(
|
|
99484
99939
|
[...result].flatMap(([classId, belongs]) => belongs ? [classId] : [])
|
|
99485
99940
|
);
|
|
@@ -110306,8 +110761,157 @@ var init_value_sources = __esm({
|
|
|
110306
110761
|
}
|
|
110307
110762
|
});
|
|
110308
110763
|
|
|
110764
|
+
// src/project-source/workspace-source-path.ts
|
|
110765
|
+
import { existsSync as existsSync3, lstatSync, realpathSync } from "node:fs";
|
|
110766
|
+
import { dirname as dirname4, isAbsolute as isAbsolute2, relative, resolve as resolve2, sep } from "node:path";
|
|
110767
|
+
function normalizeWorkspaceSourcePath(path) {
|
|
110768
|
+
const normalized = path.replaceAll("\\", "/");
|
|
110769
|
+
if (normalized.length === 0) {
|
|
110770
|
+
throw new Error("Project source path is empty.");
|
|
110771
|
+
}
|
|
110772
|
+
if (normalized.includes("\0")) {
|
|
110773
|
+
throw new Error(
|
|
110774
|
+
`Project source path ${JSON.stringify(path)} contains a null byte.`
|
|
110775
|
+
);
|
|
110776
|
+
}
|
|
110777
|
+
if (isAbsolute2(normalized)) {
|
|
110778
|
+
throw new Error(`Project source path ${JSON.stringify(path)} is absolute.`);
|
|
110779
|
+
}
|
|
110780
|
+
if (/^[A-Za-z]:\//u.test(normalized)) {
|
|
110781
|
+
throw new Error(
|
|
110782
|
+
`Project source path ${JSON.stringify(path)} is a Windows absolute path.`
|
|
110783
|
+
);
|
|
110784
|
+
}
|
|
110785
|
+
const parts = normalized.split("/");
|
|
110786
|
+
for (const part of parts) {
|
|
110787
|
+
if (part === "") {
|
|
110788
|
+
throw new Error(
|
|
110789
|
+
`Project source path ${JSON.stringify(path)} contains an empty segment.`
|
|
110790
|
+
);
|
|
110791
|
+
}
|
|
110792
|
+
if (part === ".") {
|
|
110793
|
+
throw new Error(
|
|
110794
|
+
`Project source path ${JSON.stringify(path)} contains a current-directory segment.`
|
|
110795
|
+
);
|
|
110796
|
+
}
|
|
110797
|
+
if (part === "..") {
|
|
110798
|
+
throw new Error(
|
|
110799
|
+
`Project source path ${JSON.stringify(path)} contains a parent-directory segment.`
|
|
110800
|
+
);
|
|
110801
|
+
}
|
|
110802
|
+
}
|
|
110803
|
+
return normalized;
|
|
110804
|
+
}
|
|
110805
|
+
function createWorkspaceSourcePathResolver(root) {
|
|
110806
|
+
const rootAbsolute = resolve2(root);
|
|
110807
|
+
const rootReal = realpathSync(rootAbsolute);
|
|
110808
|
+
return (path) => {
|
|
110809
|
+
const normalized = normalizeWorkspaceSourcePath(path);
|
|
110810
|
+
const absolute = resolve2(rootAbsolute, normalized);
|
|
110811
|
+
if (!containsPath(rootAbsolute, absolute)) {
|
|
110812
|
+
throw new Error(
|
|
110813
|
+
`Project source path ${JSON.stringify(path)} escapes the workspace.`
|
|
110814
|
+
);
|
|
110815
|
+
}
|
|
110816
|
+
const target = lstatSync(absolute, { throwIfNoEntry: false });
|
|
110817
|
+
if (target?.isSymbolicLink()) {
|
|
110818
|
+
throw new Error(
|
|
110819
|
+
`Project source path ${JSON.stringify(path)} targets a symbolic link.`
|
|
110820
|
+
);
|
|
110821
|
+
}
|
|
110822
|
+
let existing = target === void 0 ? dirname4(absolute) : absolute;
|
|
110823
|
+
while (!existsSync3(existing)) existing = dirname4(existing);
|
|
110824
|
+
if (!containsPath(rootReal, realpathSync(existing))) {
|
|
110825
|
+
throw new Error(
|
|
110826
|
+
`Project source path ${JSON.stringify(path)} traverses outside the workspace.`
|
|
110827
|
+
);
|
|
110828
|
+
}
|
|
110829
|
+
return absolute;
|
|
110830
|
+
};
|
|
110831
|
+
}
|
|
110832
|
+
function containsPath(parent, candidate) {
|
|
110833
|
+
const fromParent = relative(parent, candidate);
|
|
110834
|
+
return fromParent === "" || !isAbsolute2(fromParent) && fromParent !== ".." && !fromParent.startsWith(`..${sep}`);
|
|
110835
|
+
}
|
|
110836
|
+
var init_workspace_source_path = __esm({
|
|
110837
|
+
"src/project-source/workspace-source-path.ts"() {
|
|
110838
|
+
"use strict";
|
|
110839
|
+
}
|
|
110840
|
+
});
|
|
110841
|
+
|
|
110309
110842
|
// src/project-source/project-documents.ts
|
|
110310
|
-
function
|
|
110843
|
+
function projectRecordFilesV4(...collections) {
|
|
110844
|
+
const files = /* @__PURE__ */ new Map();
|
|
110845
|
+
for (const records2 of collections) {
|
|
110846
|
+
for (const record3 of records2) {
|
|
110847
|
+
if (record3.file === void 0 || record3.file === null) continue;
|
|
110848
|
+
files.set(`${record3.recordKind}:${record3.recordId}`, record3.file);
|
|
110849
|
+
}
|
|
110850
|
+
}
|
|
110851
|
+
return files;
|
|
110852
|
+
}
|
|
110853
|
+
function authoredDefinitionPathV4(file, recordFiles) {
|
|
110854
|
+
let path = null;
|
|
110855
|
+
for (const key of file.recordKeys) {
|
|
110856
|
+
const candidate = recordFiles.get(key);
|
|
110857
|
+
if (candidate === void 0) continue;
|
|
110858
|
+
const normalizedCandidate = normalizeWorkspaceSourcePath(candidate);
|
|
110859
|
+
if (neoProjectSourceKind(normalizedCandidate) !== "definition") continue;
|
|
110860
|
+
if (path !== null && path !== normalizedCandidate) return null;
|
|
110861
|
+
path = normalizedCandidate;
|
|
110862
|
+
}
|
|
110863
|
+
return path;
|
|
110864
|
+
}
|
|
110865
|
+
function retainAuthoredDefinitionGroupingV4(files, recordFiles) {
|
|
110866
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
110867
|
+
const paths = /* @__PURE__ */ new Map();
|
|
110868
|
+
for (const file of files) {
|
|
110869
|
+
const authoredPath = authoredDefinitionPathV4(file, recordFiles);
|
|
110870
|
+
const path = authoredPath ?? file.path;
|
|
110871
|
+
const folded = invariantCaseKey(path);
|
|
110872
|
+
const prior = grouped.get(folded);
|
|
110873
|
+
paths.set(file.path, path);
|
|
110874
|
+
if (prior === void 0) {
|
|
110875
|
+
grouped.set(folded, {
|
|
110876
|
+
path,
|
|
110877
|
+
content: [file.content],
|
|
110878
|
+
recordKeys: file.recordKeys.slice(),
|
|
110879
|
+
authored: authoredPath !== null
|
|
110880
|
+
});
|
|
110881
|
+
continue;
|
|
110882
|
+
}
|
|
110883
|
+
if (prior.path !== path) {
|
|
110884
|
+
if (prior.authored && authoredPath !== null) {
|
|
110885
|
+
throw new Error(
|
|
110886
|
+
`Authored record placements have a case-insensitive project source path collision between ${JSON.stringify(prior.path)} and ${JSON.stringify(path)}.`
|
|
110887
|
+
);
|
|
110888
|
+
}
|
|
110889
|
+
if (authoredPath !== null) prior.path = path;
|
|
110890
|
+
else if (!prior.authored) {
|
|
110891
|
+
throw new Error(
|
|
110892
|
+
`Canonical emission has a case-insensitive project source path collision between ${JSON.stringify(prior.path)} and ${JSON.stringify(path)}.`
|
|
110893
|
+
);
|
|
110894
|
+
}
|
|
110895
|
+
}
|
|
110896
|
+
prior.content.push(file.content);
|
|
110897
|
+
for (const key of file.recordKeys) prior.recordKeys.push(key);
|
|
110898
|
+
prior.authored ||= authoredPath !== null;
|
|
110899
|
+
paths.set(file.path, prior.path);
|
|
110900
|
+
}
|
|
110901
|
+
for (const [canonicalPath2, targetPath] of paths) {
|
|
110902
|
+
const finalPath = grouped.get(invariantCaseKey(targetPath))?.path;
|
|
110903
|
+
if (finalPath !== void 0) paths.set(canonicalPath2, finalPath);
|
|
110904
|
+
}
|
|
110905
|
+
return {
|
|
110906
|
+
files: grouped.values().map((file) => ({
|
|
110907
|
+
path: file.path,
|
|
110908
|
+
content: file.content.join("\n"),
|
|
110909
|
+
recordKeys: file.recordKeys
|
|
110910
|
+
})).toArray().sort((left, right) => compareCodePoints(left.path, right.path)),
|
|
110911
|
+
paths
|
|
110912
|
+
};
|
|
110913
|
+
}
|
|
110914
|
+
function emitProjectDocumentFilesV4(records2, options = {}) {
|
|
110311
110915
|
const schemaRecords = [];
|
|
110312
110916
|
for (const record3 of records2.values()) {
|
|
110313
110917
|
if (record3.deleted || !isSchemaRecordKindV4(record3.recordKind)) continue;
|
|
@@ -110337,69 +110941,79 @@ function emitProjectDocumentFilesV4(records2) {
|
|
|
110337
110941
|
collectionValuePaths: rootValuePathsByValueId(records2.values()),
|
|
110338
110942
|
variantInitializers: variantValues.initializers
|
|
110339
110943
|
});
|
|
110944
|
+
const sourceFiles = baseSource.files.map((file) => {
|
|
110945
|
+
const ownedKeys = [];
|
|
110946
|
+
for (const key of file.recordKeys) {
|
|
110947
|
+
if (key.startsWith("variant:")) {
|
|
110948
|
+
for (const ownedKey of variantValues.recordKeysByVariant.get(
|
|
110949
|
+
key.slice(8)
|
|
110950
|
+
) ?? []) {
|
|
110951
|
+
ownedKeys.push(ownedKey);
|
|
110952
|
+
}
|
|
110953
|
+
continue;
|
|
110954
|
+
}
|
|
110955
|
+
if (!key.startsWith("member:")) continue;
|
|
110956
|
+
const memberId = key.slice(7);
|
|
110957
|
+
for (const ownedKey of staticValues.recordKeysByMember.get(memberId) ?? []) {
|
|
110958
|
+
ownedKeys.push(ownedKey);
|
|
110959
|
+
}
|
|
110960
|
+
for (const ownedKey of memberDefaults.recordKeysByMember.get(memberId) ?? []) {
|
|
110961
|
+
ownedKeys.push(ownedKey);
|
|
110962
|
+
}
|
|
110963
|
+
}
|
|
110964
|
+
return ownedKeys.length === 0 ? file : { ...file, recordKeys: file.recordKeys.concat(ownedKeys) };
|
|
110965
|
+
});
|
|
110340
110966
|
const source = {
|
|
110341
110967
|
...baseSource,
|
|
110342
|
-
files:
|
|
110343
|
-
const ownedKeys = file.recordKeys.flatMap((key) => {
|
|
110344
|
-
if (key.startsWith("variant:")) {
|
|
110345
|
-
return [
|
|
110346
|
-
...variantValues.recordKeysByVariant.get(key.slice(8)) ?? []
|
|
110347
|
-
];
|
|
110348
|
-
}
|
|
110349
|
-
if (!key.startsWith("member:")) return [];
|
|
110350
|
-
const memberId = key.slice(7);
|
|
110351
|
-
return [
|
|
110352
|
-
...staticValues.recordKeysByMember.get(memberId) ?? [],
|
|
110353
|
-
...memberDefaults.recordKeysByMember.get(memberId) ?? []
|
|
110354
|
-
];
|
|
110355
|
-
});
|
|
110356
|
-
return ownedKeys.length === 0 ? file : { ...file, recordKeys: [...file.recordKeys, ...ownedKeys] };
|
|
110357
|
-
})
|
|
110968
|
+
files: sourceFiles
|
|
110358
110969
|
};
|
|
110359
110970
|
const classNames = new IdentifierTable();
|
|
110360
110971
|
for (const schemaClass2 of manifest.classes) {
|
|
110361
110972
|
classNames.assign(schemaClass2.id, schemaClass2.name);
|
|
110362
110973
|
}
|
|
110363
|
-
const migrationFiles =
|
|
110974
|
+
const migrationFiles = records2.values().filter((record3) => !record3.deleted && record3.recordKind === "migration").map((record3) => {
|
|
110364
110975
|
const emitted = emitMigrationFile(record3, classNames);
|
|
110365
110976
|
return {
|
|
110366
110977
|
path: emitted.path,
|
|
110367
110978
|
content: emitted.content,
|
|
110368
110979
|
recordKeys: emitted.recordKeys
|
|
110369
110980
|
};
|
|
110370
|
-
});
|
|
110981
|
+
}).toArray();
|
|
110371
110982
|
const supplementalFiles = emitSupplementalProjectSourcesV4(records2);
|
|
110372
|
-
const materializedConstructors = new Map(
|
|
110373
|
-
|
|
110374
|
-
|
|
110375
|
-
])
|
|
110376
|
-
|
|
110377
|
-
|
|
110378
|
-
|
|
110379
|
-
|
|
110983
|
+
const materializedConstructors = new Map(
|
|
110984
|
+
staticValues.materializedConstructors
|
|
110985
|
+
);
|
|
110986
|
+
for (const [key, value] of memberDefaults.materializedConstructors) {
|
|
110987
|
+
materializedConstructors.set(key, value);
|
|
110988
|
+
}
|
|
110989
|
+
const materializedConstructorOverrideKeys = new Map(
|
|
110990
|
+
staticValues.materializedConstructorOverrideKeys
|
|
110991
|
+
);
|
|
110992
|
+
for (const [
|
|
110993
|
+
key,
|
|
110994
|
+
value
|
|
110995
|
+
] of memberDefaults.materializedConstructorOverrideKeys) {
|
|
110996
|
+
materializedConstructorOverrideKeys.set(key, value);
|
|
110997
|
+
}
|
|
110380
110998
|
const rootFile = emitProjectRootSourceV4(
|
|
110381
110999
|
records2,
|
|
110382
111000
|
manifest,
|
|
110383
111001
|
materializedConstructors
|
|
110384
111002
|
);
|
|
110385
111003
|
const dialogueFiles = emitDialogueProjectSourcesV4(records2);
|
|
110386
|
-
const
|
|
110387
|
-
|
|
110388
|
-
|
|
110389
|
-
|
|
110390
|
-
|
|
110391
|
-
|
|
110392
|
-
|
|
110393
|
-
|
|
110394
|
-
|
|
110395
|
-
|
|
110396
|
-
|
|
110397
|
-
|
|
110398
|
-
|
|
110399
|
-
...supplementalFiles,
|
|
110400
|
-
...dialogueFiles,
|
|
110401
|
-
...migrationFiles
|
|
110402
|
-
]) {
|
|
111004
|
+
const grouped = retainAuthoredDefinitionGroupingV4(
|
|
111005
|
+
[
|
|
111006
|
+
source.files,
|
|
111007
|
+
rootFile === null ? [] : [rootFile],
|
|
111008
|
+
supplementalFiles,
|
|
111009
|
+
dialogueFiles,
|
|
111010
|
+
migrationFiles
|
|
111011
|
+
].values().flatMap((files2) => files2.values()),
|
|
111012
|
+
options.recordFiles ?? /* @__PURE__ */ new Map()
|
|
111013
|
+
);
|
|
111014
|
+
const files = grouped.files;
|
|
111015
|
+
const recordFiles = /* @__PURE__ */ new Map();
|
|
111016
|
+
for (const file of files) {
|
|
110403
111017
|
for (const key of file.recordKeys) recordFiles.set(key, file.path);
|
|
110404
111018
|
}
|
|
110405
111019
|
for (const recovery of staticMemberOwnershipRecoveries) {
|
|
@@ -110437,7 +111051,10 @@ ${errors.map(
|
|
|
110437
111051
|
analysis,
|
|
110438
111052
|
materializedConstructors,
|
|
110439
111053
|
materializedConstructorOverrideKeys,
|
|
110440
|
-
formAlternates: source.formAlternates
|
|
111054
|
+
formAlternates: source.formAlternates.map((alternate) => ({
|
|
111055
|
+
...alternate,
|
|
111056
|
+
path: grouped.paths.get(alternate.path) ?? alternate.path
|
|
111057
|
+
})),
|
|
110441
111058
|
staticMemberOwnershipRecoveries
|
|
110442
111059
|
};
|
|
110443
111060
|
}
|
|
@@ -110492,6 +111109,7 @@ var init_project_documents = __esm({
|
|
|
110492
111109
|
init_source_diagnostics();
|
|
110493
111110
|
init_source_format();
|
|
110494
111111
|
init_static_member_ownership_recovery();
|
|
111112
|
+
init_workspace_source_path();
|
|
110495
111113
|
PROJECT_SOURCE_ANALYSIS_V4_CACHE_PATH = ".neo/project-source-analysis-v4.json";
|
|
110496
111114
|
SCHEMA_RECORD_KINDS2 = /* @__PURE__ */ new Set([
|
|
110497
111115
|
"class",
|
|
@@ -110513,7 +111131,7 @@ var init_project_documents = __esm({
|
|
|
110513
111131
|
// src/project-source/project-document-cache.ts
|
|
110514
111132
|
import { mkdirSync as mkdirSync5, readFileSync as readFileSync5, renameSync as renameSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
110515
111133
|
import { createHash as createHash6 } from "node:crypto";
|
|
110516
|
-
import { dirname as
|
|
111134
|
+
import { dirname as dirname5, join as join5 } from "node:path";
|
|
110517
111135
|
function readProjectSourceAnalysisBuildCacheV4(root, sources) {
|
|
110518
111136
|
try {
|
|
110519
111137
|
const parsed = JSON.parse(
|
|
@@ -110532,12 +111150,12 @@ function readProjectSourceAnalysisBuildCacheV4(root, sources) {
|
|
|
110532
111150
|
}
|
|
110533
111151
|
function writeProjectSourceAnalysisCacheV4(root, analysis, sources) {
|
|
110534
111152
|
const file = join5(root, PROJECT_SOURCE_ANALYSIS_V4_CACHE_PATH);
|
|
110535
|
-
mkdirSync5(
|
|
111153
|
+
mkdirSync5(dirname5(file), { recursive: true });
|
|
110536
111154
|
writeFileSync5(file, `${JSON.stringify(analysis, null, 2)}
|
|
110537
111155
|
`, "utf8");
|
|
110538
111156
|
if (sources === void 0) return;
|
|
110539
111157
|
const buildFile = join5(root, PROJECT_SOURCE_BUILD_CACHE_PATH);
|
|
110540
|
-
mkdirSync5(
|
|
111158
|
+
mkdirSync5(dirname5(buildFile), { recursive: true });
|
|
110541
111159
|
const temporary = `${buildFile}.${process.pid}.tmp`;
|
|
110542
111160
|
writeFileSync5(
|
|
110543
111161
|
temporary,
|
|
@@ -110608,7 +111226,7 @@ function readProjectSourceDocumentBuildCacheV1(root, sources) {
|
|
|
110608
111226
|
}
|
|
110609
111227
|
function writeProjectSourceDocumentBuildCacheV1(root, sources, documents) {
|
|
110610
111228
|
const file = join5(root, PROJECT_SOURCE_DOCUMENT_BUILD_CACHE_PATH);
|
|
110611
|
-
mkdirSync5(
|
|
111229
|
+
mkdirSync5(dirname5(file), { recursive: true });
|
|
110612
111230
|
const temporary = `${file}.${process.pid}.tmp`;
|
|
110613
111231
|
writeFileSync5(
|
|
110614
111232
|
temporary,
|
|
@@ -110674,7 +111292,7 @@ var init_project_document_cache = __esm({
|
|
|
110674
111292
|
// src/project-source/project-files.ts
|
|
110675
111293
|
import { createHash as createHash7 } from "node:crypto";
|
|
110676
111294
|
import {
|
|
110677
|
-
existsSync as
|
|
111295
|
+
existsSync as existsSync4,
|
|
110678
111296
|
mkdirSync as mkdirSync6,
|
|
110679
111297
|
readFileSync as readFileSync6,
|
|
110680
111298
|
readdirSync,
|
|
@@ -110682,7 +111300,7 @@ import {
|
|
|
110682
111300
|
rmSync as rmSync2,
|
|
110683
111301
|
writeFileSync as writeFileSync6
|
|
110684
111302
|
} from "node:fs";
|
|
110685
|
-
import { basename, dirname as
|
|
111303
|
+
import { basename, dirname as dirname6, extname, join as join6, relative as relative2, sep as sep2 } from "node:path";
|
|
110686
111304
|
function lowerProjectFileRegistrySourcesV4(root, state, analysis, options = {}) {
|
|
110687
111305
|
const templateIds = fileTemplateIdsByName2(analysis);
|
|
110688
111306
|
const declarations = analysis.files.registries.flatMap(
|
|
@@ -110717,12 +111335,12 @@ function lowerProjectFileRegistrySourcesV4(root, state, analysis, options = {})
|
|
|
110717
111335
|
const trustedPending = options.trustedPendingFiles?.get(
|
|
110718
111336
|
declaration.recordId
|
|
110719
111337
|
);
|
|
110720
|
-
if (base === null && !
|
|
111338
|
+
if (base === null && !existsSync4(absolute) && trustedPending === void 0) {
|
|
110721
111339
|
throw new Error(
|
|
110722
111340
|
`Pending project file ${declaration.symbol} is missing bytes at ${normalizedPath}.`
|
|
110723
111341
|
);
|
|
110724
111342
|
}
|
|
110725
|
-
const binary =
|
|
111343
|
+
const binary = existsSync4(absolute) ? inspectBinaryFile(absolute, normalizedPath) : trustedPending === void 0 ? null : {
|
|
110726
111344
|
path: normalizedPath,
|
|
110727
111345
|
kind: declaration.kind,
|
|
110728
111346
|
mimeType: trustedPending.mimeType,
|
|
@@ -110824,7 +111442,7 @@ function inspectProjectBinaryStatusV4(root, state, analysis) {
|
|
|
110824
111442
|
const baseState = state[`project-file:${declaration.recordId}`];
|
|
110825
111443
|
const data = isObjectRecord2(baseState?.data) ? baseState.data : {};
|
|
110826
111444
|
const absolute = join6(root, declaration.path);
|
|
110827
|
-
const local =
|
|
111445
|
+
const local = existsSync4(absolute) ? inspectBinaryFile(absolute, declaration.path) : null;
|
|
110828
111446
|
const baseSha256 = baseState?.projectBinary?.sha256 ?? normalizeSha256V4(
|
|
110829
111447
|
data.contentSha256,
|
|
110830
111448
|
`project-file:${declaration.recordId} metadata`
|
|
@@ -110896,9 +111514,9 @@ function discoverProjectBinariesV4(root, explicit, ignoredPaths = []) {
|
|
|
110896
111514
|
const candidates = [];
|
|
110897
111515
|
for (const directory of ["Files/Images", "Files/AudioClips"]) {
|
|
110898
111516
|
const absoluteDirectory = join6(root, directory);
|
|
110899
|
-
if (!
|
|
111517
|
+
if (!existsSync4(absoluteDirectory)) continue;
|
|
110900
111518
|
visitBinaryFiles(absoluteDirectory, (absolute) => {
|
|
110901
|
-
const path = normalizeSlash2(
|
|
111519
|
+
const path = normalizeSlash2(relative2(root, absolute));
|
|
110902
111520
|
if (!explicitPaths.has(path.toLowerCase())) {
|
|
110903
111521
|
candidates.push({ stableId: path, path, absolute });
|
|
110904
111522
|
}
|
|
@@ -110946,7 +111564,7 @@ function writeVerifiedBinaryDownloadV4(destination, bytes, expectedSha256) {
|
|
|
110946
111564
|
`Downloaded project file checksum ${actual} did not match expected SHA-256 ${expectedSha256}.`
|
|
110947
111565
|
);
|
|
110948
111566
|
}
|
|
110949
|
-
mkdirSync6(
|
|
111567
|
+
mkdirSync6(dirname6(destination), { recursive: true });
|
|
110950
111568
|
const temporary = `${destination}.neo-download-${process.pid}`;
|
|
110951
111569
|
try {
|
|
110952
111570
|
writeFileSync6(temporary, bytes);
|
|
@@ -110965,7 +111583,7 @@ function writeBinaryConflictArtifactV4(root, fileId, fileName2, bytes, expectedS
|
|
|
110965
111583
|
safeFileName2(fileName2)
|
|
110966
111584
|
);
|
|
110967
111585
|
writeVerifiedBinaryDownloadV4(destination, bytes, expectedSha256);
|
|
110968
|
-
return normalizeSlash2(
|
|
111586
|
+
return normalizeSlash2(relative2(root, destination));
|
|
110969
111587
|
}
|
|
110970
111588
|
function fileTemplateIdsByName2(analysis) {
|
|
110971
111589
|
const templateIds = /* @__PURE__ */ new Map();
|
|
@@ -111154,7 +111772,7 @@ function safePathSegment2(value) {
|
|
|
111154
111772
|
return value.replace(/[^A-Za-z0-9._-]/g, "_") || "file";
|
|
111155
111773
|
}
|
|
111156
111774
|
function normalizeSlash2(value) {
|
|
111157
|
-
return value.split(
|
|
111775
|
+
return value.split(sep2).join("/").replaceAll("\\", "/");
|
|
111158
111776
|
}
|
|
111159
111777
|
var SUPPORTED_BINARY_TYPES, REGISTRY_ENTRY2, assignDeterministicFileSymbols2;
|
|
111160
111778
|
var init_project_files = __esm({
|
|
@@ -111197,12 +111815,12 @@ var init_supplemental_records_file_system = __esm({
|
|
|
111197
111815
|
});
|
|
111198
111816
|
|
|
111199
111817
|
// src/project-source/workspace-status.ts
|
|
111200
|
-
import { existsSync as
|
|
111201
|
-
import { join as join7, relative as
|
|
111818
|
+
import { existsSync as existsSync5, readFileSync as readFileSync7, readdirSync as readdirSync2 } from "node:fs";
|
|
111819
|
+
import { join as join7, relative as relative3, sep as sep3 } from "node:path";
|
|
111202
111820
|
function isGitIgnored(scopes, absolutePath, directory) {
|
|
111203
111821
|
return isNeoGitIgnored(
|
|
111204
111822
|
scopes.map((scope) => ({
|
|
111205
|
-
relativePath:
|
|
111823
|
+
relativePath: relative3(scope.root, absolutePath),
|
|
111206
111824
|
matcher: scope.matcher
|
|
111207
111825
|
})),
|
|
111208
111826
|
directory
|
|
@@ -111210,7 +111828,7 @@ function isGitIgnored(scopes, absolutePath, directory) {
|
|
|
111210
111828
|
}
|
|
111211
111829
|
function addGitIgnoreScope(directory, inherited) {
|
|
111212
111830
|
const path = join7(directory, ".gitignore");
|
|
111213
|
-
if (!
|
|
111831
|
+
if (!existsSync5(path)) return inherited;
|
|
111214
111832
|
return [
|
|
111215
111833
|
...inherited,
|
|
111216
111834
|
{ root: directory, matcher: (0, import_ignore.default)().add(readFileSync7(path, "utf8")) }
|
|
@@ -111220,7 +111838,7 @@ function listNeoWorkspaceFilesV1(root) {
|
|
|
111220
111838
|
const production = [];
|
|
111221
111839
|
const specs = [];
|
|
111222
111840
|
const visit = (directory, inheritedScopes) => {
|
|
111223
|
-
if (!
|
|
111841
|
+
if (!existsSync5(directory)) return;
|
|
111224
111842
|
const scopes = addGitIgnoreScope(directory, inheritedScopes);
|
|
111225
111843
|
for (const entry of readdirSync2(directory, { withFileTypes: true })) {
|
|
111226
111844
|
if (entry.isSymbolicLink()) continue;
|
|
@@ -111232,7 +111850,7 @@ function listNeoWorkspaceFilesV1(root) {
|
|
|
111232
111850
|
continue;
|
|
111233
111851
|
}
|
|
111234
111852
|
if (!entry.isFile() || isGitIgnored(scopes, path, false)) continue;
|
|
111235
|
-
const relativePath =
|
|
111853
|
+
const relativePath = relative3(root, path).split(sep3).join("/");
|
|
111236
111854
|
const kind = neoProjectSourceKind(relativePath);
|
|
111237
111855
|
if (kind === null) continue;
|
|
111238
111856
|
if (kind === "spec") specs.push(path);
|
|
@@ -111252,7 +111870,7 @@ function listProjectTestFilesV1(root) {
|
|
|
111252
111870
|
}
|
|
111253
111871
|
function computeWorkspaceStatus2(workspace, options = {}) {
|
|
111254
111872
|
const virtualSourceFiles = options.virtualSourceFiles ?? listProjectSourceFilesV4(workspace.root).map((path) => ({
|
|
111255
|
-
path:
|
|
111873
|
+
path: relative3(workspace.root, path).split(sep3).join("/"),
|
|
111256
111874
|
content: readFileSync7(path, "utf8")
|
|
111257
111875
|
}));
|
|
111258
111876
|
return computeWorkspaceStatus(workspace, {
|
|
@@ -112264,7 +112882,7 @@ var init_source_record_comparison = __esm({
|
|
|
112264
112882
|
|
|
112265
112883
|
// src/project-source/reset.ts
|
|
112266
112884
|
import {
|
|
112267
|
-
existsSync as
|
|
112885
|
+
existsSync as existsSync6,
|
|
112268
112886
|
mkdirSync as mkdirSync7,
|
|
112269
112887
|
readFileSync as readFileSync8,
|
|
112270
112888
|
readdirSync as readdirSync3,
|
|
@@ -112272,12 +112890,20 @@ import {
|
|
|
112272
112890
|
writeFileSync as writeFileSync7,
|
|
112273
112891
|
statSync
|
|
112274
112892
|
} from "node:fs";
|
|
112275
|
-
import { dirname as
|
|
112893
|
+
import { dirname as dirname7, join as join8 } from "node:path";
|
|
112276
112894
|
function resetWorkspaceToProjectSourcesV4(workspace, document, options = {}) {
|
|
112277
112895
|
const emissionRecords = options.regenerateSourceNames ? regenerateDialogueSourceNamesV4(document.records) : document.records;
|
|
112278
|
-
const emitted = emitProjectDocumentFilesV4(emissionRecords
|
|
112896
|
+
const emitted = emitProjectDocumentFilesV4(emissionRecords, {
|
|
112897
|
+
recordFiles: projectRecordFilesV4(Object.values(workspace.state.records))
|
|
112898
|
+
});
|
|
112279
112899
|
assertUniqueEmittedPaths2(emitted.files);
|
|
112280
|
-
const
|
|
112900
|
+
const resolveSourcePath = createWorkspaceSourcePathResolver(workspace.root);
|
|
112901
|
+
const trackedSources = trackedProductionSourcesBeforeReset(
|
|
112902
|
+
workspace,
|
|
112903
|
+
resolveSourcePath
|
|
112904
|
+
);
|
|
112905
|
+
const previous = new Set(managedFilesBeforeReset(workspace.root));
|
|
112906
|
+
for (const path of trackedSources) previous.add(path);
|
|
112281
112907
|
const preservedSpecs = preserveManagedSpecs(workspace.root);
|
|
112282
112908
|
for (const directory of FORMAT_4_MANAGED_DIRECTORIES) {
|
|
112283
112909
|
rmSync3(join8(workspace.root, directory), { recursive: true, force: true });
|
|
@@ -112289,15 +112915,18 @@ function resetWorkspaceToProjectSourcesV4(workspace, document, options = {}) {
|
|
|
112289
112915
|
for (const privatePath of LEGACY_PRIVATE_PATHS) {
|
|
112290
112916
|
rmSync3(join8(workspace.root, privatePath), { recursive: true, force: true });
|
|
112291
112917
|
}
|
|
112918
|
+
for (const path of trackedSources) {
|
|
112919
|
+
rmSync3(resolveSourcePath(path), { force: true });
|
|
112920
|
+
}
|
|
112292
112921
|
for (const [path, bytes] of preservedSpecs) {
|
|
112293
112922
|
const absolute = join8(workspace.root, path);
|
|
112294
|
-
mkdirSync7(
|
|
112923
|
+
mkdirSync7(dirname7(absolute), { recursive: true });
|
|
112295
112924
|
writeFileSync7(absolute, bytes);
|
|
112296
112925
|
}
|
|
112297
112926
|
for (const file of emitted.files) {
|
|
112298
|
-
const absolute =
|
|
112299
|
-
mkdirSync7(
|
|
112300
|
-
if (
|
|
112927
|
+
const absolute = resolveSourcePath(file.path);
|
|
112928
|
+
mkdirSync7(dirname7(absolute), { recursive: true });
|
|
112929
|
+
if (existsSync6(absolute) && readFileSync8(absolute, "utf8") === file.content) {
|
|
112301
112930
|
continue;
|
|
112302
112931
|
}
|
|
112303
112932
|
writeFileSync7(absolute, file.content, "utf8");
|
|
@@ -112324,7 +112953,7 @@ function resetWorkspaceToProjectSourcesV4(workspace, document, options = {}) {
|
|
|
112324
112953
|
workspace.config = { ...workspace.config, formatVersion: 4 };
|
|
112325
112954
|
writeWorkspaceConfig(workspace.root, workspace.config);
|
|
112326
112955
|
const removed = [...previous].filter(
|
|
112327
|
-
(file) => !
|
|
112956
|
+
(file) => !existsSync6(join8(workspace.root, file))
|
|
112328
112957
|
).length;
|
|
112329
112958
|
return {
|
|
112330
112959
|
written: emitted.files.length,
|
|
@@ -112337,7 +112966,7 @@ function preserveManagedSpecs(root) {
|
|
|
112337
112966
|
const specs = /* @__PURE__ */ new Map();
|
|
112338
112967
|
const visit = (path) => {
|
|
112339
112968
|
const absolute = join8(root, path);
|
|
112340
|
-
if (!
|
|
112969
|
+
if (!existsSync6(absolute)) return;
|
|
112341
112970
|
const entries = readdirSync3(absolute, { withFileTypes: true });
|
|
112342
112971
|
for (const entry of entries) {
|
|
112343
112972
|
if (entry.isSymbolicLink()) continue;
|
|
@@ -112352,6 +112981,20 @@ function preserveManagedSpecs(root) {
|
|
|
112352
112981
|
for (const directory of FORMAT_4_MANAGED_DIRECTORIES) visit(directory);
|
|
112353
112982
|
return specs;
|
|
112354
112983
|
}
|
|
112984
|
+
function trackedProductionSourcesBeforeReset(workspace, resolveSourcePath) {
|
|
112985
|
+
const paths = /* @__PURE__ */ new Set();
|
|
112986
|
+
for (const record3 of Object.values(workspace.state.records)) {
|
|
112987
|
+
if (record3.file === void 0) continue;
|
|
112988
|
+
const path = normalizeWorkspaceSourcePath(record3.file);
|
|
112989
|
+
const kind = neoProjectSourceKind(path);
|
|
112990
|
+
if (kind === null || !isNeoProjectProductionSourceKind(kind)) {
|
|
112991
|
+
continue;
|
|
112992
|
+
}
|
|
112993
|
+
const absolute = resolveSourcePath(path);
|
|
112994
|
+
if (existsSync6(absolute)) paths.add(path);
|
|
112995
|
+
}
|
|
112996
|
+
return paths;
|
|
112997
|
+
}
|
|
112355
112998
|
function assertUniqueEmittedPaths2(files) {
|
|
112356
112999
|
const seen = /* @__PURE__ */ new Map();
|
|
112357
113000
|
for (const file of files) {
|
|
@@ -112371,7 +113014,7 @@ function managedFilesBeforeReset(root) {
|
|
|
112371
113014
|
collectFiles(root, directory, files);
|
|
112372
113015
|
}
|
|
112373
113016
|
for (const file of LEGACY_ROOT_FILES) {
|
|
112374
|
-
if (
|
|
113017
|
+
if (existsSync6(join8(root, file))) files.add(file);
|
|
112375
113018
|
}
|
|
112376
113019
|
for (const privatePath of LEGACY_PRIVATE_PATHS) {
|
|
112377
113020
|
collectFiles(root, privatePath, files);
|
|
@@ -112380,7 +113023,7 @@ function managedFilesBeforeReset(root) {
|
|
|
112380
113023
|
}
|
|
112381
113024
|
function collectFiles(root, path, files) {
|
|
112382
113025
|
const absolute = join8(root, path);
|
|
112383
|
-
if (!
|
|
113026
|
+
if (!existsSync6(absolute)) return;
|
|
112384
113027
|
if (statSync(absolute).isFile()) {
|
|
112385
113028
|
files.add(path);
|
|
112386
113029
|
return;
|
|
@@ -112399,11 +113042,13 @@ var FORMAT_4_MANAGED_DIRECTORIES, LEGACY_ROOT_FILES, LEGACY_PRIVATE_PATHS;
|
|
|
112399
113042
|
var init_reset = __esm({
|
|
112400
113043
|
"src/project-source/reset.ts"() {
|
|
112401
113044
|
"use strict";
|
|
113045
|
+
init_src();
|
|
112402
113046
|
init_workspace();
|
|
112403
113047
|
init_project_documents();
|
|
112404
113048
|
init_project_document_cache();
|
|
112405
113049
|
init_materialized_construction_cache();
|
|
112406
113050
|
init_dialogue_sources();
|
|
113051
|
+
init_workspace_source_path();
|
|
112407
113052
|
FORMAT_4_MANAGED_DIRECTORIES = [
|
|
112408
113053
|
"Classes",
|
|
112409
113054
|
"Interfaces",
|
|
@@ -112544,7 +113189,7 @@ var init_http = __esm({
|
|
|
112544
113189
|
});
|
|
112545
113190
|
|
|
112546
113191
|
// src/project-source/project-file-pull.ts
|
|
112547
|
-
import { existsSync as
|
|
113192
|
+
import { existsSync as existsSync7, rmSync as rmSync4 } from "node:fs";
|
|
112548
113193
|
import { join as join9 } from "node:path";
|
|
112549
113194
|
async function pullProjectBinariesV4(args) {
|
|
112550
113195
|
let client = args.client ?? null;
|
|
@@ -112568,7 +113213,7 @@ async function pullProjectBinariesV4(args) {
|
|
|
112568
113213
|
const declarationPresent = args.destructive === true || args.localBinaries === void 0 || previous === void 0 || localStatus !== void 0;
|
|
112569
113214
|
const path = localStatus?.path ?? previous?.projectBinary?.path ?? canonicalProjectBinaryPathV42(record3.data);
|
|
112570
113215
|
const absolute = join9(args.workspace.root, path);
|
|
112571
|
-
const localDigest =
|
|
113216
|
+
const localDigest = existsSync7(absolute) ? sha256File(absolute) : null;
|
|
112572
113217
|
const baseDigest = previous?.projectBinary?.sha256 ?? readSha256(previous?.data) ?? null;
|
|
112573
113218
|
const remoteDigest = requiredSha256(
|
|
112574
113219
|
record3.data,
|
|
@@ -112651,7 +113296,7 @@ async function pullProjectBinariesV4(args) {
|
|
|
112651
113296
|
const localStatus = localById.get(previous.recordId);
|
|
112652
113297
|
const path = localStatus?.path ?? previous.projectBinary?.path ?? canonicalProjectBinaryPathV42(previous.data);
|
|
112653
113298
|
const absolute = join9(args.workspace.root, path);
|
|
112654
|
-
const localDigest =
|
|
113299
|
+
const localDigest = existsSync7(absolute) ? sha256File(absolute) : null;
|
|
112655
113300
|
const baseDigest = previous.projectBinary?.sha256 ?? readSha256(previous.data) ?? null;
|
|
112656
113301
|
const action = planBinaryMergeV4({
|
|
112657
113302
|
baseDigest,
|
|
@@ -112836,10 +113481,10 @@ import {
|
|
|
112836
113481
|
mkdirSync as mkdirSync8,
|
|
112837
113482
|
writeFileSync as writeFileSync8,
|
|
112838
113483
|
rmSync as rmSync5,
|
|
112839
|
-
existsSync as
|
|
113484
|
+
existsSync as existsSync8,
|
|
112840
113485
|
readFileSync as readFileSync9
|
|
112841
113486
|
} from "node:fs";
|
|
112842
|
-
import { dirname as
|
|
113487
|
+
import { dirname as dirname8 } from "node:path";
|
|
112843
113488
|
async function runPull(workspace, options) {
|
|
112844
113489
|
if (options.reset) {
|
|
112845
113490
|
await runResetPull(workspace);
|
|
@@ -113161,12 +113806,19 @@ async function finishFormat4Pull(args) {
|
|
|
113161
113806
|
([key, record3]) => localRecords.get(key) === record3 ? [] : [key]
|
|
113162
113807
|
)
|
|
113163
113808
|
);
|
|
113164
|
-
const
|
|
113809
|
+
const recordFiles = projectRecordFilesV4(
|
|
113810
|
+
Object.values(workspace.state.records),
|
|
113811
|
+
localStatus?.reconstructed.values() ?? []
|
|
113812
|
+
);
|
|
113813
|
+
const localResult = emitProjectDocumentFilesV4(localRecords, {
|
|
113814
|
+
recordFiles
|
|
113815
|
+
});
|
|
113165
113816
|
for (const recovery of localResult.staticMemberOwnershipRecoveries ?? []) {
|
|
113166
113817
|
warn(staticMemberOwnershipRecoveryMessage(recovery));
|
|
113167
113818
|
}
|
|
113168
113819
|
const serverResult = conflictCount === 0 ? null : emitProjectDocumentFilesV4(
|
|
113169
|
-
buildEmitRecordSet(document, plans, "server")
|
|
113820
|
+
buildEmitRecordSet(document, plans, "server"),
|
|
113821
|
+
{ recordFiles }
|
|
113170
113822
|
);
|
|
113171
113823
|
const binaries = await pullProjectBinariesV4({
|
|
113172
113824
|
workspace,
|
|
@@ -113205,6 +113857,7 @@ async function finishFormat4Pull(args) {
|
|
|
113205
113857
|
const path = localResult.recordFiles.get(key);
|
|
113206
113858
|
if (path !== void 0) rewritePaths.add(path);
|
|
113207
113859
|
}
|
|
113860
|
+
const resolveSourcePath = createWorkspaceSourcePathResolver(workspace.root);
|
|
113208
113861
|
let written = 0;
|
|
113209
113862
|
for (const path of emittedPaths) {
|
|
113210
113863
|
const local = localByPath.get(path)?.content;
|
|
@@ -113215,9 +113868,9 @@ async function finishFormat4Pull(args) {
|
|
|
113215
113868
|
versionId: workspace.config.versionId
|
|
113216
113869
|
}) : local;
|
|
113217
113870
|
if (content === void 0) continue;
|
|
113218
|
-
const absolute =
|
|
113219
|
-
mkdirSync8(
|
|
113220
|
-
const existing =
|
|
113871
|
+
const absolute = resolveSourcePath(path);
|
|
113872
|
+
mkdirSync8(dirname8(absolute), { recursive: true });
|
|
113873
|
+
const existing = existsSync8(absolute) ? readFileSync9(absolute, "utf8") : null;
|
|
113221
113874
|
if (existing !== null && !rewritePaths.has(path)) continue;
|
|
113222
113875
|
if (existing !== content) {
|
|
113223
113876
|
writeFileSync8(absolute, content, "utf8");
|
|
@@ -113227,9 +113880,13 @@ async function finishFormat4Pull(args) {
|
|
|
113227
113880
|
let removed = 0;
|
|
113228
113881
|
for (const recordState of Object.values(workspace.state.records)) {
|
|
113229
113882
|
const previousPath = recordState.file;
|
|
113230
|
-
if (previousPath === void 0
|
|
113231
|
-
const
|
|
113232
|
-
if (
|
|
113883
|
+
if (previousPath === void 0) continue;
|
|
113884
|
+
const normalizedPreviousPath = normalizeWorkspaceSourcePath(previousPath);
|
|
113885
|
+
if (emittedPaths.has(normalizedPreviousPath)) {
|
|
113886
|
+
continue;
|
|
113887
|
+
}
|
|
113888
|
+
const absolute = resolveSourcePath(previousPath);
|
|
113889
|
+
if (existsSync8(absolute)) {
|
|
113233
113890
|
rmSync5(absolute);
|
|
113234
113891
|
removed += 1;
|
|
113235
113892
|
}
|
|
@@ -113521,6 +114178,7 @@ var init_pull = __esm({
|
|
|
113521
114178
|
init_project_documents();
|
|
113522
114179
|
init_project_document_cache();
|
|
113523
114180
|
init_materialized_construction_cache();
|
|
114181
|
+
init_workspace_source_path();
|
|
113524
114182
|
init_project_manifest();
|
|
113525
114183
|
init_project_documents();
|
|
113526
114184
|
init_project_file_pull();
|
|
@@ -113535,8 +114193,8 @@ var init_exports = {};
|
|
|
113535
114193
|
__export(init_exports, {
|
|
113536
114194
|
runInit: () => runInit
|
|
113537
114195
|
});
|
|
113538
|
-
import { existsSync as
|
|
113539
|
-
import { join as join11, resolve as
|
|
114196
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as readFileSync10, writeFileSync as writeFileSync9 } from "node:fs";
|
|
114197
|
+
import { join as join11, resolve as resolve3 } from "node:path";
|
|
113540
114198
|
async function runInit(options) {
|
|
113541
114199
|
let projectId = options.projectId;
|
|
113542
114200
|
let projects = [];
|
|
@@ -113632,8 +114290,8 @@ async function runInit(options) {
|
|
|
113632
114290
|
validate: (value) => value.trim().length > 0 ? true : "Directory must not be empty."
|
|
113633
114291
|
}) : "neo";
|
|
113634
114292
|
}
|
|
113635
|
-
const root =
|
|
113636
|
-
if (
|
|
114293
|
+
const root = resolve3(directory);
|
|
114294
|
+
if (existsSync9(join11(root, NEO_CONFIG_FILE))) {
|
|
113637
114295
|
throw new Error(`"${join11(root, NEO_CONFIG_FILE)}" already exists.`);
|
|
113638
114296
|
}
|
|
113639
114297
|
mkdirSync9(root, { recursive: true });
|
|
@@ -113660,7 +114318,7 @@ async function runInit(options) {
|
|
|
113660
114318
|
}
|
|
113661
114319
|
function ensurePrivateStateIgnored(root) {
|
|
113662
114320
|
const path = join11(root, ".gitignore");
|
|
113663
|
-
const existing =
|
|
114321
|
+
const existing = existsSync9(path) ? readFileSync10(path, "utf8") : "";
|
|
113664
114322
|
if (existing.split(/\r?\n/u).some((line) => line.trim() === ".neo/" || line.trim() === ".neo")) {
|
|
113665
114323
|
return;
|
|
113666
114324
|
}
|
|
@@ -114066,7 +114724,7 @@ async function waitForPlan(convex, planId) {
|
|
|
114066
114724
|
`History plan "${plan.id}" failed: ${plan.error ?? "unknown error"}`
|
|
114067
114725
|
);
|
|
114068
114726
|
}
|
|
114069
|
-
await new Promise((
|
|
114727
|
+
await new Promise((resolve5) => setTimeout(resolve5, 500));
|
|
114070
114728
|
}
|
|
114071
114729
|
}
|
|
114072
114730
|
async function printVersionLog(convex, scope) {
|
|
@@ -115065,7 +115723,7 @@ var init_save_overlay_resolution = __esm({
|
|
|
115065
115723
|
});
|
|
115066
115724
|
|
|
115067
115725
|
// src/commands/push-body-diagnostics.ts
|
|
115068
|
-
import { existsSync as
|
|
115726
|
+
import { existsSync as existsSync10, readFileSync as readFileSync11 } from "node:fs";
|
|
115069
115727
|
import { join as join12 } from "node:path";
|
|
115070
115728
|
function createNeoScriptBodySourceLocator(workspace, status) {
|
|
115071
115729
|
const textByFile = /* @__PURE__ */ new Map();
|
|
@@ -115089,7 +115747,7 @@ function createNeoScriptBodySourceLocator(workspace, status) {
|
|
|
115089
115747
|
const cached = textByFile.get(file);
|
|
115090
115748
|
if (cached !== void 0) return cached;
|
|
115091
115749
|
const path = join12(workspace.root, file);
|
|
115092
|
-
const text =
|
|
115750
|
+
const text = existsSync10(path) ? readFileSync11(path, "utf8") : null;
|
|
115093
115751
|
textByFile.set(file, text);
|
|
115094
115752
|
return text;
|
|
115095
115753
|
}
|
|
@@ -116891,8 +117549,8 @@ var init_project_source_identity = __esm({
|
|
|
116891
117549
|
// src/push-hook.ts
|
|
116892
117550
|
import { spawn } from "node:child_process";
|
|
116893
117551
|
import { createHash as createHash9 } from "node:crypto";
|
|
116894
|
-
import { existsSync as
|
|
116895
|
-
import { join as join13, relative as
|
|
117552
|
+
import { existsSync as existsSync11, readFileSync as readFileSync13, readdirSync as readdirSync4 } from "node:fs";
|
|
117553
|
+
import { join as join13, relative as relative4, sep as sep4 } from "node:path";
|
|
116896
117554
|
function fingerprintPushInputs(workspace, options = {}) {
|
|
116897
117555
|
const paths = /* @__PURE__ */ new Set([
|
|
116898
117556
|
join13(workspace.root, "neo.json"),
|
|
@@ -116901,7 +117559,7 @@ function fingerprintPushInputs(workspace, options = {}) {
|
|
|
116901
117559
|
...workspace.config.unityConfigPath === void 0 ? [] : [join13(workspace.root, workspace.config.unityConfigPath)]
|
|
116902
117560
|
]);
|
|
116903
117561
|
const visitManaged = (directory) => {
|
|
116904
|
-
if (!
|
|
117562
|
+
if (!existsSync11(directory)) return;
|
|
116905
117563
|
for (const entry of readdirSync4(directory, { withFileTypes: true })) {
|
|
116906
117564
|
if (entry.isSymbolicLink()) continue;
|
|
116907
117565
|
const path = join13(directory, entry.name);
|
|
@@ -116913,7 +117571,7 @@ function fingerprintPushInputs(workspace, options = {}) {
|
|
|
116913
117571
|
visitManaged(join13(workspace.root, "Files", "AudioClips"));
|
|
116914
117572
|
const hash = createHash9("sha256");
|
|
116915
117573
|
for (const path of [...paths].sort()) {
|
|
116916
|
-
const name =
|
|
117574
|
+
const name = relative4(workspace.root, path).split(sep4).join("/");
|
|
116917
117575
|
hash.update(name);
|
|
116918
117576
|
hash.update("\0");
|
|
116919
117577
|
try {
|
|
@@ -117340,7 +117998,7 @@ function isRetryableRequestError(error) {
|
|
|
117340
117998
|
return RETRYABLE_NETWORK_ERROR_CODES.has(error.cause.code);
|
|
117341
117999
|
}
|
|
117342
118000
|
async function waitForRetry(attempt, signal) {
|
|
117343
|
-
await new Promise((
|
|
118001
|
+
await new Promise((resolve5, reject) => {
|
|
117344
118002
|
const abort = () => {
|
|
117345
118003
|
clearTimeout(timeout);
|
|
117346
118004
|
reject(signal.reason);
|
|
@@ -117348,7 +118006,7 @@ async function waitForRetry(attempt, signal) {
|
|
|
117348
118006
|
const timeout = setTimeout(
|
|
117349
118007
|
() => {
|
|
117350
118008
|
signal.removeEventListener("abort", abort);
|
|
117351
|
-
|
|
118009
|
+
resolve5();
|
|
117352
118010
|
},
|
|
117353
118011
|
200 * 2 ** (attempt - 1)
|
|
117354
118012
|
);
|
|
@@ -117581,11 +118239,11 @@ import {
|
|
|
117581
118239
|
mkdirSync as mkdirSync10,
|
|
117582
118240
|
writeFileSync as writeFileSync10,
|
|
117583
118241
|
rmSync as rmSync6,
|
|
117584
|
-
existsSync as
|
|
118242
|
+
existsSync as existsSync12,
|
|
117585
118243
|
readFileSync as readFileSync15,
|
|
117586
118244
|
statSync as statSync2
|
|
117587
118245
|
} from "node:fs";
|
|
117588
|
-
import { dirname as
|
|
118246
|
+
import { dirname as dirname9, join as join15, relative as relative5, sep as sep5 } from "node:path";
|
|
117589
118247
|
function assignPendingIds(changes, authoredValueSeeds, reconstructed3, localInitializerMaterialization) {
|
|
117590
118248
|
const assigned = /* @__PURE__ */ new Map();
|
|
117591
118249
|
const assign = (pendingId2) => {
|
|
@@ -118126,14 +118784,14 @@ async function waitForPollDelay(delayMs, signal) {
|
|
|
118126
118784
|
if (signal.aborted) {
|
|
118127
118785
|
throw new Error("Project transaction polling was interrupted.");
|
|
118128
118786
|
}
|
|
118129
|
-
await new Promise((
|
|
118787
|
+
await new Promise((resolve5, reject) => {
|
|
118130
118788
|
const aborted = () => {
|
|
118131
118789
|
clearTimeout(timer);
|
|
118132
118790
|
reject(new Error("Project transaction polling was interrupted."));
|
|
118133
118791
|
};
|
|
118134
118792
|
const timer = setTimeout(() => {
|
|
118135
118793
|
signal.removeEventListener("abort", aborted);
|
|
118136
|
-
|
|
118794
|
+
resolve5();
|
|
118137
118795
|
}, delayMs);
|
|
118138
118796
|
signal.addEventListener("abort", aborted, { once: true });
|
|
118139
118797
|
});
|
|
@@ -118885,7 +119543,7 @@ async function prepareLocalCandidateV4(workspace, options = {}) {
|
|
|
118885
119543
|
} else {
|
|
118886
119544
|
const files = listProjectSourceFilesV4(workspace.root).map(
|
|
118887
119545
|
(absolutePath) => {
|
|
118888
|
-
const path =
|
|
119546
|
+
const path = relative5(workspace.root, absolutePath).split(sep5).join("/");
|
|
118889
119547
|
const kind = neoProjectSourceKind(path);
|
|
118890
119548
|
if (kind === null || !isNeoProjectProductionSourceKind(kind)) {
|
|
118891
119549
|
throw new Error(
|
|
@@ -119204,7 +119862,12 @@ function createPendingProjectSourceIdentityV4(workspace, status, authoredValueSe
|
|
|
119204
119862
|
});
|
|
119205
119863
|
}
|
|
119206
119864
|
}
|
|
119207
|
-
const emission = emitProjectDocumentFilesV4(records2
|
|
119865
|
+
const emission = emitProjectDocumentFilesV4(records2, {
|
|
119866
|
+
recordFiles: projectRecordFilesV4(
|
|
119867
|
+
Object.values(workspace.state.records),
|
|
119868
|
+
status.reconstructed.values()
|
|
119869
|
+
)
|
|
119870
|
+
});
|
|
119208
119871
|
const files = emission.files.map((file) => {
|
|
119209
119872
|
const kind = neoProjectSourceKind(file.path);
|
|
119210
119873
|
if (kind === null || !isNeoProjectProductionSourceKind(kind)) {
|
|
@@ -119410,7 +120073,12 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
|
|
|
119410
120073
|
const previousState = workspace.state;
|
|
119411
120074
|
workspace.state = { ...previousState, records: nextRecords };
|
|
119412
120075
|
try {
|
|
119413
|
-
rewriteFilesFromState(
|
|
120076
|
+
rewriteFilesFromState(
|
|
120077
|
+
workspace,
|
|
120078
|
+
emitRecords,
|
|
120079
|
+
preservedSourceFiles,
|
|
120080
|
+
projectRecordFilesV4(localRecords.values())
|
|
120081
|
+
);
|
|
119414
120082
|
writeWorkspaceState(workspace.root, workspace.state);
|
|
119415
120083
|
} catch (error) {
|
|
119416
120084
|
workspace.state = previousState;
|
|
@@ -119596,16 +120264,30 @@ function applyPushResult(workspace, result, pendingIdAssignments = /* @__PURE__
|
|
|
119596
120264
|
if (!isObjectRecord2(result) || !Array.isArray(result.changedRecords)) {
|
|
119597
120265
|
throw new Error("Transaction response is missing changedRecords.");
|
|
119598
120266
|
}
|
|
120267
|
+
const localStatus = computeWorkspaceStatus2(workspace);
|
|
119599
120268
|
const preservedSourceFiles = materializeAssignedSchemaIdsInAuthoredSource(
|
|
119600
120269
|
workspace,
|
|
119601
120270
|
pendingIdAssignments,
|
|
119602
|
-
|
|
120271
|
+
localStatus.pendingValueIdentitySites
|
|
120272
|
+
);
|
|
120273
|
+
const replacements = {
|
|
120274
|
+
exact: pendingIdAssignments,
|
|
120275
|
+
embedded: pendingIdAssignments.entries().toArray().sort(([left], [right]) => right.length - left.length)
|
|
120276
|
+
};
|
|
120277
|
+
const localRecords = rewriteReconstructedRecords(
|
|
120278
|
+
localStatus.reconstructed,
|
|
120279
|
+
replacements
|
|
119603
120280
|
);
|
|
119604
120281
|
workspace.state.records = foldChangedRecords(
|
|
119605
120282
|
workspace.state.records,
|
|
119606
120283
|
result.changedRecords
|
|
119607
120284
|
);
|
|
119608
|
-
rewriteFilesFromState(
|
|
120285
|
+
rewriteFilesFromState(
|
|
120286
|
+
workspace,
|
|
120287
|
+
void 0,
|
|
120288
|
+
preservedSourceFiles,
|
|
120289
|
+
projectRecordFilesV4(localRecords.values())
|
|
120290
|
+
);
|
|
119609
120291
|
writeWorkspaceState(workspace.root, workspace.state);
|
|
119610
120292
|
}
|
|
119611
120293
|
function authoredMemberFormsByFile(root, alternates) {
|
|
@@ -119615,7 +120297,7 @@ function authoredMemberFormsByFile(root, alternates) {
|
|
|
119615
120297
|
let existing = contents.get(alternate.path);
|
|
119616
120298
|
if (existing === void 0) {
|
|
119617
120299
|
const absolute = join15(root, alternate.path);
|
|
119618
|
-
existing =
|
|
120300
|
+
existing = existsSync12(absolute) ? readFileSync15(absolute, "utf8") : null;
|
|
119619
120301
|
contents.set(alternate.path, existing);
|
|
119620
120302
|
}
|
|
119621
120303
|
if (existing === null || !existing.includes(alternate.block)) continue;
|
|
@@ -119653,14 +120335,14 @@ function fileSystemEntryKey(absolute) {
|
|
|
119653
120335
|
if (!hasInode) return `path:${absolute.toLowerCase()}`;
|
|
119654
120336
|
return `inode:${stats.dev}:${stats.ino}`;
|
|
119655
120337
|
}
|
|
119656
|
-
function deleteSupersededAuthoredFiles(
|
|
120338
|
+
function deleteSupersededAuthoredFiles(resolveSourcePath, authoredPaths, emitted) {
|
|
119657
120339
|
const emittedEntries = /* @__PURE__ */ new Set();
|
|
119658
120340
|
for (const file of emitted) {
|
|
119659
|
-
emittedEntries.add(fileSystemEntryKey(
|
|
120341
|
+
emittedEntries.add(fileSystemEntryKey(resolveSourcePath(file.path)));
|
|
119660
120342
|
}
|
|
119661
120343
|
for (const authoredPath of authoredPaths) {
|
|
119662
|
-
const absolute =
|
|
119663
|
-
if (!
|
|
120344
|
+
const absolute = resolveSourcePath(authoredPath);
|
|
120345
|
+
if (!existsSync12(absolute)) continue;
|
|
119664
120346
|
if (emittedEntries.has(fileSystemEntryKey(absolute))) continue;
|
|
119665
120347
|
rmSync6(absolute);
|
|
119666
120348
|
}
|
|
@@ -119676,8 +120358,8 @@ function rewriteFilesFromState(workspace, records2 = new Map(
|
|
|
119676
120358
|
data: recordState.data
|
|
119677
120359
|
}
|
|
119678
120360
|
])
|
|
119679
|
-
), preservedSourceFiles = /* @__PURE__ */ new Map()) {
|
|
119680
|
-
const result = emitProjectDocumentFilesV4(records2);
|
|
120361
|
+
), preservedSourceFiles = /* @__PURE__ */ new Map(), recordFiles = /* @__PURE__ */ new Map()) {
|
|
120362
|
+
const result = emitProjectDocumentFilesV4(records2, { recordFiles });
|
|
119681
120363
|
const authoredForms = authoredMemberFormsByFile(
|
|
119682
120364
|
workspace.root,
|
|
119683
120365
|
result.formAlternates
|
|
@@ -119708,22 +120390,27 @@ function rewriteFilesFromState(workspace, records2 = new Map(
|
|
|
119708
120390
|
);
|
|
119709
120391
|
assertAssignedIdSourceRewriteValid(finalAnalysis);
|
|
119710
120392
|
writeProjectSourceAnalysisCacheV4(workspace.root, finalAnalysis);
|
|
120393
|
+
const resolveSourcePath = createWorkspaceSourcePathResolver(workspace.root);
|
|
119711
120394
|
const emittedPaths = new Set(files.map((file) => file.path));
|
|
119712
120395
|
for (const recordState of Object.values(workspace.state.records)) {
|
|
119713
120396
|
const previousPath = recordState.file;
|
|
119714
|
-
if (previousPath === void 0
|
|
119715
|
-
const
|
|
119716
|
-
if (
|
|
120397
|
+
if (previousPath === void 0) continue;
|
|
120398
|
+
const normalizedPreviousPath = normalizeWorkspaceSourcePath(previousPath);
|
|
120399
|
+
if (emittedPaths.has(normalizedPreviousPath)) {
|
|
120400
|
+
continue;
|
|
120401
|
+
}
|
|
120402
|
+
const absolute = resolveSourcePath(previousPath);
|
|
120403
|
+
if (existsSync12(absolute)) rmSync6(absolute);
|
|
119717
120404
|
}
|
|
119718
120405
|
for (const file of files) {
|
|
119719
|
-
const absolute =
|
|
119720
|
-
mkdirSync10(
|
|
119721
|
-
const existing =
|
|
120406
|
+
const absolute = resolveSourcePath(file.path);
|
|
120407
|
+
mkdirSync10(dirname9(absolute), { recursive: true });
|
|
120408
|
+
const existing = existsSync12(absolute) ? readFileSync15(absolute, "utf8") : null;
|
|
119722
120409
|
if (existing !== file.content)
|
|
119723
120410
|
writeFileSync10(absolute, file.content, "utf8");
|
|
119724
120411
|
}
|
|
119725
120412
|
deleteSupersededAuthoredFiles(
|
|
119726
|
-
|
|
120413
|
+
resolveSourcePath,
|
|
119727
120414
|
preservedSourceFiles.keys(),
|
|
119728
120415
|
files
|
|
119729
120416
|
);
|
|
@@ -119763,7 +120450,7 @@ function materializeAssignedSchemaIdsInAuthoredSource(workspace, replacements, p
|
|
|
119763
120450
|
if (pendingIdsByUri.size === 0) return /* @__PURE__ */ new Map();
|
|
119764
120451
|
const inputs = listProjectSourceFilesV4(workspace.root).map(
|
|
119765
120452
|
(absolutePath) => {
|
|
119766
|
-
const uri =
|
|
120453
|
+
const uri = relative5(workspace.root, absolutePath).split(sep5).join("/");
|
|
119767
120454
|
const kind = neoProjectSourceKind(uri);
|
|
119768
120455
|
if (kind === null || !isNeoProjectProductionSourceKind(kind)) {
|
|
119769
120456
|
throw new Error(
|
|
@@ -120467,6 +121154,7 @@ var init_push = __esm({
|
|
|
120467
121154
|
init_src();
|
|
120468
121155
|
init_compiler_adapter();
|
|
120469
121156
|
init_project_source_identity();
|
|
121157
|
+
init_workspace_source_path();
|
|
120470
121158
|
init_convex();
|
|
120471
121159
|
init_http();
|
|
120472
121160
|
init_ui();
|
|
@@ -120553,7 +121241,7 @@ var init_registry2 = __esm({
|
|
|
120553
121241
|
PROJECT_SCHEMA_CONTRACT = Object.freeze({
|
|
120554
121242
|
formatVersion: 3,
|
|
120555
121243
|
contractVersion: "3.15",
|
|
120556
|
-
cliVersion: "0.38.
|
|
121244
|
+
cliVersion: "0.38.5",
|
|
120557
121245
|
projectFileUploadBatchSize: 32,
|
|
120558
121246
|
documentRecords: {
|
|
120559
121247
|
member: {
|
|
@@ -121876,11 +122564,11 @@ __export(test_exports, {
|
|
|
121876
122564
|
});
|
|
121877
122565
|
import { createHash as createHash11, randomUUID as randomUUID3 } from "node:crypto";
|
|
121878
122566
|
import {
|
|
121879
|
-
existsSync as
|
|
122567
|
+
existsSync as existsSync13,
|
|
121880
122568
|
mkdirSync as mkdirSync11,
|
|
121881
122569
|
readdirSync as readdirSync5,
|
|
121882
122570
|
readFileSync as readFileSync16,
|
|
121883
|
-
realpathSync,
|
|
122571
|
+
realpathSync as realpathSync2,
|
|
121884
122572
|
renameSync as renameSync5,
|
|
121885
122573
|
rmSync as rmSync7,
|
|
121886
122574
|
statSync as statSync3,
|
|
@@ -121888,12 +122576,12 @@ import {
|
|
|
121888
122576
|
} from "node:fs";
|
|
121889
122577
|
import {
|
|
121890
122578
|
basename as basename3,
|
|
121891
|
-
dirname as
|
|
121892
|
-
isAbsolute as
|
|
122579
|
+
dirname as dirname10,
|
|
122580
|
+
isAbsolute as isAbsolute3,
|
|
121893
122581
|
join as join16,
|
|
121894
|
-
relative as
|
|
121895
|
-
resolve as
|
|
121896
|
-
sep as
|
|
122582
|
+
relative as relative6,
|
|
122583
|
+
resolve as resolve4,
|
|
122584
|
+
sep as sep6
|
|
121897
122585
|
} from "node:path";
|
|
121898
122586
|
import { isDeepStrictEqual } from "node:util";
|
|
121899
122587
|
function isRecord10(value) {
|
|
@@ -122079,19 +122767,19 @@ function preparedHookCandidate(workspace) {
|
|
|
122079
122767
|
return null;
|
|
122080
122768
|
}
|
|
122081
122769
|
try {
|
|
122082
|
-
const directory =
|
|
122083
|
-
const cacheRoot =
|
|
122084
|
-
|
|
122770
|
+
const directory = realpathSync2(configuredDirectory);
|
|
122771
|
+
const cacheRoot = resolve4(
|
|
122772
|
+
realpathSync2(workspace.root),
|
|
122085
122773
|
".neo",
|
|
122086
122774
|
"test-build"
|
|
122087
122775
|
);
|
|
122088
|
-
const pathFromRoot =
|
|
122089
|
-
if (
|
|
122776
|
+
const pathFromRoot = relative6(cacheRoot, directory);
|
|
122777
|
+
if (isAbsolute3(pathFromRoot)) {
|
|
122090
122778
|
throw new NeoTestPreparedCandidateError(
|
|
122091
122779
|
"NEO_PREPARED_BUILD_DIR must not resolve to an absolute path outside this workspace's .neo/test-build directory."
|
|
122092
122780
|
);
|
|
122093
122781
|
}
|
|
122094
|
-
if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${
|
|
122782
|
+
if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${sep6}`)) {
|
|
122095
122783
|
throw new NeoTestPreparedCandidateError(
|
|
122096
122784
|
"NEO_PREPARED_BUILD_DIR must resolve inside this workspace's .neo/test-build directory."
|
|
122097
122785
|
);
|
|
@@ -122179,7 +122867,7 @@ function cachedTestCandidate(workspace, inputFingerprint) {
|
|
|
122179
122867
|
}
|
|
122180
122868
|
if (typeof parsed.documentSha256 !== "string") return null;
|
|
122181
122869
|
const documentJson = readFileSync16(
|
|
122182
|
-
join16(
|
|
122870
|
+
join16(dirname10(candidatePath), "document.json"),
|
|
122183
122871
|
"utf8"
|
|
122184
122872
|
);
|
|
122185
122873
|
if (createHash11("sha256").update(documentJson).digest("hex") !== parsed.documentSha256) {
|
|
@@ -122200,7 +122888,7 @@ function cacheTestCandidate(workspace, inputFingerprint, candidate) {
|
|
|
122200
122888
|
const documentJson = JSON.stringify(candidate.document);
|
|
122201
122889
|
const documentSha256 = createHash11("sha256").update(documentJson).digest("hex");
|
|
122202
122890
|
const candidatePath = testCandidateCachePath(workspace, inputFingerprint);
|
|
122203
|
-
atomicWrite(join16(
|
|
122891
|
+
atomicWrite(join16(dirname10(candidatePath), "document.json"), documentJson);
|
|
122204
122892
|
atomicWrite(
|
|
122205
122893
|
candidatePath,
|
|
122206
122894
|
JSON.stringify({
|
|
@@ -122217,7 +122905,7 @@ function cacheTestCandidate(workspace, inputFingerprint, candidate) {
|
|
|
122217
122905
|
}
|
|
122218
122906
|
function compileSpec(workspace, document, absolutePath, projectCompilationHash2) {
|
|
122219
122907
|
const scriptDocument = readDocumentArrays(document);
|
|
122220
|
-
const path =
|
|
122908
|
+
const path = relative6(workspace.root, absolutePath).split(sep6).join("/");
|
|
122221
122909
|
const source = readFileSync16(absolutePath, "utf8");
|
|
122222
122910
|
const sourceHash = createHash11("sha256").update(source).digest("hex");
|
|
122223
122911
|
const artifactPath = join16(
|
|
@@ -122278,7 +122966,7 @@ function selectedSpecPaths(workspace, selectors) {
|
|
|
122278
122966
|
const relativePaths = new Map(
|
|
122279
122967
|
all.map((absolutePath) => [
|
|
122280
122968
|
absolutePath,
|
|
122281
|
-
|
|
122969
|
+
relative6(workspace.root, absolutePath).split(sep6).join("/")
|
|
122282
122970
|
])
|
|
122283
122971
|
);
|
|
122284
122972
|
const normalizedSelectors = selectors.map(
|
|
@@ -122286,22 +122974,22 @@ function selectedSpecPaths(workspace, selectors) {
|
|
|
122286
122974
|
);
|
|
122287
122975
|
for (const selector of normalizedSelectors) {
|
|
122288
122976
|
if (/[*?]/u.test(selector)) continue;
|
|
122289
|
-
if (
|
|
122977
|
+
if (isAbsolute3(selector)) {
|
|
122290
122978
|
throw new Error(
|
|
122291
122979
|
`Spec selector ${JSON.stringify(selector)} must be workspace-relative.`
|
|
122292
122980
|
);
|
|
122293
122981
|
}
|
|
122294
|
-
const absolute =
|
|
122295
|
-
const workspaceRelative =
|
|
122296
|
-
if (workspaceRelative === ".." || workspaceRelative.startsWith(`..${
|
|
122982
|
+
const absolute = resolve4(workspace.root, selector);
|
|
122983
|
+
const workspaceRelative = relative6(workspace.root, absolute);
|
|
122984
|
+
if (workspaceRelative === ".." || workspaceRelative.startsWith(`..${sep6}`)) {
|
|
122297
122985
|
throw new Error(
|
|
122298
122986
|
`Spec selector ${JSON.stringify(selector)} is outside the workspace.`
|
|
122299
122987
|
);
|
|
122300
122988
|
}
|
|
122301
|
-
if (!
|
|
122302
|
-
const real =
|
|
122303
|
-
const realRelative =
|
|
122304
|
-
if (realRelative === ".." || realRelative.startsWith(`..${
|
|
122989
|
+
if (!existsSync13(absolute)) continue;
|
|
122990
|
+
const real = realpathSync2(absolute);
|
|
122991
|
+
const realRelative = relative6(workspace.root, real);
|
|
122992
|
+
if (realRelative === ".." || realRelative.startsWith(`..${sep6}`)) {
|
|
122305
122993
|
throw new Error(
|
|
122306
122994
|
`Spec selector ${JSON.stringify(selector)} resolves outside the workspace through a symlink.`
|
|
122307
122995
|
);
|
|
@@ -122311,7 +122999,7 @@ function selectedSpecPaths(workspace, selectors) {
|
|
|
122311
122999
|
`Spec selector ${JSON.stringify(selector)} is ignored, private, symlinked, or is not a .spec.neo file.`
|
|
122312
123000
|
);
|
|
122313
123001
|
}
|
|
122314
|
-
if (statSync3(absolute).isDirectory() && !all.some((path) => path.startsWith(`${absolute}${
|
|
123002
|
+
if (statSync3(absolute).isDirectory() && !all.some((path) => path.startsWith(`${absolute}${sep6}`))) {
|
|
122315
123003
|
throw new Error(
|
|
122316
123004
|
`Spec selector ${JSON.stringify(selector)} is ignored, private, or contains no eligible .spec.neo files.`
|
|
122317
123005
|
);
|
|
@@ -123044,13 +123732,13 @@ async function executeRegisteredSpec(registered, document, selected, timeoutMs,
|
|
|
123044
123732
|
return { tests: results, failures: fileFailures, testDurationMs };
|
|
123045
123733
|
}
|
|
123046
123734
|
function atomicWrite(path, content) {
|
|
123047
|
-
mkdirSync11(
|
|
123735
|
+
mkdirSync11(dirname10(path), { recursive: true });
|
|
123048
123736
|
const temporary = `${path}.tmp-${String(process.pid)}-${randomUUID3()}`;
|
|
123049
123737
|
writeFileSync11(temporary, content, "utf8");
|
|
123050
123738
|
renameSync5(temporary, path);
|
|
123051
123739
|
}
|
|
123052
123740
|
function testBuildFiles(root) {
|
|
123053
|
-
if (!
|
|
123741
|
+
if (!existsSync13(root)) return [];
|
|
123054
123742
|
const files = [];
|
|
123055
123743
|
const visit = (directory) => {
|
|
123056
123744
|
for (const entry of readdirSync5(directory, { withFileTypes: true })) {
|
|
@@ -123067,16 +123755,16 @@ function testBuildFiles(root) {
|
|
|
123067
123755
|
return files;
|
|
123068
123756
|
}
|
|
123069
123757
|
function maintainNeoTestBuildCache(root, maxBytes = TEST_BUILD_CACHE_LIMIT_BYTES, now = Date.now(), protectedDirectory = process.env.NEO_PREPARED_BUILD_DIR) {
|
|
123070
|
-
const resolvedRoot =
|
|
123071
|
-
const resolvedProtected = protectedDirectory === void 0 ? null :
|
|
123758
|
+
const resolvedRoot = resolve4(root);
|
|
123759
|
+
const resolvedProtected = protectedDirectory === void 0 ? null : resolve4(protectedDirectory);
|
|
123072
123760
|
const protectedInsideRoot = resolvedProtected !== null && (() => {
|
|
123073
|
-
const fromRoot =
|
|
123074
|
-
return fromRoot === "" || !fromRoot.startsWith(`..${
|
|
123761
|
+
const fromRoot = relative6(resolvedRoot, resolvedProtected);
|
|
123762
|
+
return fromRoot === "" || !fromRoot.startsWith(`..${sep6}`) && fromRoot !== ".." && !isAbsolute3(fromRoot);
|
|
123075
123763
|
})();
|
|
123076
123764
|
const isProtected = (path) => {
|
|
123077
123765
|
if (!protectedInsideRoot || resolvedProtected === null) return false;
|
|
123078
|
-
const fromProtected =
|
|
123079
|
-
return fromProtected === "" || !fromProtected.startsWith(`..${
|
|
123766
|
+
const fromProtected = relative6(resolvedProtected, resolve4(path));
|
|
123767
|
+
return fromProtected === "" || !fromProtected.startsWith(`..${sep6}`) && fromProtected !== ".." && !isAbsolute3(fromProtected);
|
|
123080
123768
|
};
|
|
123081
123769
|
for (const file of testBuildFiles(root)) {
|
|
123082
123770
|
if (!isProtected(file.path) && basename3(file.path).includes(".tmp-") && now - file.modifiedMs >= ABANDONED_TEMP_MAX_AGE_MS) {
|
|
@@ -123220,7 +123908,7 @@ async function runTest(workspace, options, dependencies = {}) {
|
|
|
123220
123908
|
throw new NeoTestUsageError(errorMessage2(error));
|
|
123221
123909
|
}
|
|
123222
123910
|
selectedFiles = selectedPaths.map(
|
|
123223
|
-
(path) =>
|
|
123911
|
+
(path) => relative6(workspace.root, path).split(sep6).join("/")
|
|
123224
123912
|
);
|
|
123225
123913
|
if (selectedPaths.length === 0 && options.passWithNoTests !== true) {
|
|
123226
123914
|
throw new NeoTestNoTestsError(
|
|
@@ -123384,7 +124072,7 @@ async function runTest(workspace, options, dependencies = {}) {
|
|
|
123384
124072
|
if (options.outputFile !== null) {
|
|
123385
124073
|
try {
|
|
123386
124074
|
atomicWrite(
|
|
123387
|
-
|
|
124075
|
+
isAbsolute3(options.outputFile) ? options.outputFile : join16(workspace.root, options.outputFile),
|
|
123388
124076
|
serialized
|
|
123389
124077
|
);
|
|
123390
124078
|
} catch (error) {
|
|
@@ -123468,7 +124156,7 @@ async function inspectNeoTestCompilation(workspace, dependencies = {}) {
|
|
|
123468
124156
|
if (candidate.document === null) {
|
|
123469
124157
|
return {
|
|
123470
124158
|
files: selectedPaths.map(
|
|
123471
|
-
(path) =>
|
|
124159
|
+
(path) => relative6(workspace.root, path).split(sep6).join("/")
|
|
123472
124160
|
),
|
|
123473
124161
|
errors: [
|
|
123474
124162
|
{
|
|
@@ -123489,14 +124177,14 @@ async function inspectNeoTestCompilation(workspace, dependencies = {}) {
|
|
|
123489
124177
|
compileSpec(workspace, document, path, compilationHash);
|
|
123490
124178
|
} catch (error) {
|
|
123491
124179
|
errors.push({
|
|
123492
|
-
file:
|
|
124180
|
+
file: relative6(workspace.root, path).split(sep6).join("/"),
|
|
123493
124181
|
message: errorMessage2(error)
|
|
123494
124182
|
});
|
|
123495
124183
|
}
|
|
123496
124184
|
}
|
|
123497
124185
|
return {
|
|
123498
124186
|
files: selectedPaths.map(
|
|
123499
|
-
(path) =>
|
|
124187
|
+
(path) => relative6(workspace.root, path).split(sep6).join("/")
|
|
123500
124188
|
),
|
|
123501
124189
|
errors
|
|
123502
124190
|
};
|
|
@@ -123595,10 +124283,10 @@ __export(doctor_exports, {
|
|
|
123595
124283
|
import {
|
|
123596
124284
|
constants as fsConstants,
|
|
123597
124285
|
accessSync,
|
|
123598
|
-
existsSync as
|
|
124286
|
+
existsSync as existsSync14,
|
|
123599
124287
|
readFileSync as readFileSync17
|
|
123600
124288
|
} from "node:fs";
|
|
123601
|
-
import { extname as extname2, isAbsolute as
|
|
124289
|
+
import { extname as extname2, isAbsolute as isAbsolute4, join as join17, relative as relative7, sep as sep7 } from "node:path";
|
|
123602
124290
|
function inspectNeoDoctor(workspace) {
|
|
123603
124291
|
const formatCompatible = workspace.config.formatVersion === CURRENT_FORMAT_VERSION;
|
|
123604
124292
|
const compiler = inspectCompilerContract();
|
|
@@ -123715,7 +124403,7 @@ function inspectSourceContract(workspace) {
|
|
|
123715
124403
|
}
|
|
123716
124404
|
function inspectExtensionContract(root) {
|
|
123717
124405
|
const cachePath = join17(root, PROJECT_SOURCE_ANALYSIS_V4_CACHE_PATH);
|
|
123718
|
-
if (!
|
|
124406
|
+
if (!existsSync14(cachePath)) {
|
|
123719
124407
|
return {
|
|
123720
124408
|
id: NEO_VSCODE_EXTENSION_ID,
|
|
123721
124409
|
contractVersion: NEO_VSCODE_EXTENSION_CONTRACT_VERSION,
|
|
@@ -123778,7 +124466,7 @@ function inspectTrackedBinary(root, record3, errors) {
|
|
|
123778
124466
|
const binary = record3.projectBinary;
|
|
123779
124467
|
if (!binary) return;
|
|
123780
124468
|
const path = binary.path.replaceAll("\\", "/");
|
|
123781
|
-
if (
|
|
124469
|
+
if (isAbsolute4(path) || path.split("/").includes("..")) {
|
|
123782
124470
|
errors.push(
|
|
123783
124471
|
`Project file ${record3.recordId} has unsafe tracked path ${JSON.stringify(binary.path)}.`
|
|
123784
124472
|
);
|
|
@@ -123799,7 +124487,7 @@ function inspectTrackedBinary(root, record3, errors) {
|
|
|
123799
124487
|
);
|
|
123800
124488
|
}
|
|
123801
124489
|
const absolute = join17(root, path);
|
|
123802
|
-
if (
|
|
124490
|
+
if (existsSync14(absolute) && !canAccess(absolute, fsConstants.R_OK)) {
|
|
123803
124491
|
errors.push(`Tracked project file ${path} is not readable.`);
|
|
123804
124492
|
}
|
|
123805
124493
|
}
|
|
@@ -123824,7 +124512,7 @@ function canAccess(path, mode) {
|
|
|
123824
124512
|
}
|
|
123825
124513
|
}
|
|
123826
124514
|
function workspacePath(root, path) {
|
|
123827
|
-
return
|
|
124515
|
+
return relative7(root, path).split(sep7).join("/");
|
|
123828
124516
|
}
|
|
123829
124517
|
function errorMessage3(error) {
|
|
123830
124518
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -123940,7 +124628,7 @@ __export(migrate_exports, {
|
|
|
123940
124628
|
runMigrate: () => runMigrate
|
|
123941
124629
|
});
|
|
123942
124630
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
123943
|
-
import { existsSync as
|
|
124631
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync12, readdirSync as readdirSync6, writeFileSync as writeFileSync12 } from "node:fs";
|
|
123944
124632
|
import { join as join18 } from "node:path";
|
|
123945
124633
|
async function runMigrate(workspace, subcommand, positional, targetRef, json, dependencies = {}) {
|
|
123946
124634
|
if (subcommand === "new") {
|
|
@@ -123953,7 +124641,7 @@ async function runMigrate(workspace, subcommand, positional, targetRef, json, de
|
|
|
123953
124641
|
const migrationsDir = join18(workspace.root, "Migrations");
|
|
123954
124642
|
mkdirSync12(migrationsDir, { recursive: true });
|
|
123955
124643
|
let nextOrder = 1;
|
|
123956
|
-
if (
|
|
124644
|
+
if (existsSync15(migrationsDir)) {
|
|
123957
124645
|
for (const entry of readdirSync6(migrationsDir)) {
|
|
123958
124646
|
const match = /^(\d+)-/.exec(entry);
|
|
123959
124647
|
if (match !== null) {
|
|
@@ -123963,7 +124651,7 @@ async function runMigrate(workspace, subcommand, positional, targetRef, json, de
|
|
|
123963
124651
|
}
|
|
123964
124652
|
const relPath = migrationFileName(nextOrder, name);
|
|
123965
124653
|
const absolute = join18(workspace.root, relPath);
|
|
123966
|
-
if (
|
|
124654
|
+
if (existsSync15(absolute)) {
|
|
123967
124655
|
throw new Error(`"${relPath}" already exists.`);
|
|
123968
124656
|
}
|
|
123969
124657
|
const target = targetRef ?? "project";
|
|
@@ -125534,7 +126222,7 @@ async function waitForMergeTransaction(args) {
|
|
|
125534
126222
|
status = readMergeTransactionStatus(response, status.transactionId);
|
|
125535
126223
|
if (status.commitStatus === "committed") continue;
|
|
125536
126224
|
if (status.commitStatus === "failed") continue;
|
|
125537
|
-
await new Promise((
|
|
126225
|
+
await new Promise((resolve5) => setTimeout(resolve5, delayMs));
|
|
125538
126226
|
delayMs = Math.min(delayMs * 2, 5e3);
|
|
125539
126227
|
}
|
|
125540
126228
|
}
|
|
@@ -127278,7 +127966,7 @@ There is no --keep-current: preserving current semantic state defines flatten.
|
|
|
127278
127966
|
async function main() {
|
|
127279
127967
|
const args = parseArgs(process.argv.slice(2));
|
|
127280
127968
|
if (args.command === "--version") {
|
|
127281
|
-
console.log("0.38.
|
|
127969
|
+
console.log("0.38.5");
|
|
127282
127970
|
return;
|
|
127283
127971
|
}
|
|
127284
127972
|
if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {
|