@neocompose/cli 0.52.0 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/neo.mjs CHANGED
@@ -27744,14 +27744,14 @@ function validateSystemAnnotationAuthoring(documents, diagnostics) {
27744
27744
  for (const [uri, document] of documents) {
27745
27745
  for (const declaration of document.declarations) {
27746
27746
  const declarationAnnotation = systemAnnotation(declaration.annotations);
27747
- const declarationId2 = declaredIdValue(declaration.annotations);
27748
- if (declarationAnnotation !== void 0 && !isSystemReservedRecordId(declarationId2)) {
27747
+ const declarationId = declaredIdValue(declaration.annotations);
27748
+ if (declarationAnnotation !== void 0 && !isSystemReservedRecordId(declarationId)) {
27749
27749
  diagnostics.push(
27750
27750
  authoredSystemDiagnostic(
27751
27751
  uri,
27752
27752
  declarationAnnotation,
27753
27753
  declaration.name,
27754
- declarationId2
27754
+ declarationId
27755
27755
  )
27756
27756
  );
27757
27757
  }
@@ -45427,7 +45427,7 @@ var init_neoscript_compiler_revision = __esm({
45427
45427
  "use strict";
45428
45428
  init_src();
45429
45429
  ACTIVE_NEOSCRIPT_COMPILER_REVISION_ROLLOUT = // <neoscript-compiler-revision-rollout>
45430
- { migrationId: "neoscript-compiler-revision-15", revision: 15 };
45430
+ null;
45431
45431
  }
45432
45432
  });
45433
45433
 
@@ -48895,7 +48895,7 @@ var init_dist_node = __esm({
48895
48895
  });
48896
48896
 
48897
48897
  // ../src/models/classes/world-system-classes.generated.ts
48898
- var WORLD_LAYER_SORTING_LAYER_MEMBER_ID, WORLD_GRID_CHILDREN_MEMBER_ID, WORLD_GRID_CHILDREN_ENTRY_MEMBER_ID, WORLD_OBJECT_CHILDREN_MEMBER_ID, WORLD_OBJECT_CHILDREN_ENTRY_MEMBER_ID, WORLD_OBJECT_PLACEMENT_TILES_MEMBER_ID, WORLD_OBJECT_PLACEMENT_TILES_ENTRY_MEMBER_ID, WORLD_PLACEMENT_TILE_CELL_MEMBER_ID, WORLD_TILE_CELL_MEMBER_ID, WORLD_TILE_LAYER_LINK_TILES_MEMBER_ID, WORLD_TILE_LAYER_LINK_TILE_ENTRY_MEMBER_ID, WORLD_OBJECT_LAYER_LINK_OBJECTS_MEMBER_ID, WORLD_OBJECT_LAYER_LINK_OBJECT_ENTRY_MEMBER_ID, WORLD_ANIMATION_CLIP_TARGET_PARAM_ID, WORLD_ANIMATION_CHILD_OVERRIDE_ENTRY_PARAM_ID, WORLD_ANIMATION_CLIP_FPS_MEMBER_ID, WORLD_ANIMATION_CLIP_DURATION_MEMBER_ID, WORLD_ANIMATION_CLIP_FRAMES_MEMBER_ID, WORLD_ANIMATION_CLIP_TRACKS_MEMBER_ID, WORLD_ANIMATION_FRAME_BASE_INDEX_MEMBER_ID, WORLD_ANIMATION_FRAME_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_FRAME_CHILD_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_FRAME_CHILD_OVERRIDES_ENTRY_MEMBER_ID, WORLD_ANIMATION_FRAME_ACTIONS_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_SELECTOR_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_REFRESH_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_TRACK_SELECTOR_MEMBER_ID, WORLD_ANIMATION_TRACK_REFRESH_MEMBER_ID, WORLD_ANIMATION_TRACK_START_FRAME_MEMBER_ID, WORLD_ANIMATION_TRACK_DIRECTION_MEMBER_ID, WORLD_ANIMATION_TRACK_OFFSET_START_INDEX_MEMBER_ID, WORLD_ANIMATION_TRACK_OFFSET_END_INDEX_MEMBER_ID, WORLD_ANIMATION_CHILD_TRACK_CLIP_KEY_MEMBER_ID, WORLD_ANIMATION_SEGMENT_DURATION_MEMBER_ID, WORLD_ANIMATION_SEGMENT_FRAMES_MEMBER_ID, WORLD_ANIMATION_SEGMENT_TRACK_CHILD_PARAM_ID, WORLD_ANIMATION_SEGMENT_TRACK_VALUE_PARAM_ID, WORLD_SELECTOR_REFRESH_ON_LOAD_OPTION_ID, WORLD_SELECTOR_REFRESH_PER_FRAME_OPTION_ID, WORLD_PLAY_DIRECTION_FORWARD_OPTION_ID, WORLD_PLAY_DIRECTION_REVERSE_OPTION_ID, WORLD_SYSTEM_CLASS_DEFINITIONS;
48898
+ var WORLD_GRID_CHILDREN_MEMBER_ID, WORLD_GRID_CHILDREN_ENTRY_MEMBER_ID, WORLD_OBJECT_CHILDREN_MEMBER_ID, WORLD_OBJECT_CHILDREN_ENTRY_MEMBER_ID, WORLD_OBJECT_PLACEMENT_TILES_MEMBER_ID, WORLD_OBJECT_PLACEMENT_TILES_ENTRY_MEMBER_ID, WORLD_PLACEMENT_TILE_CELL_MEMBER_ID, WORLD_TILE_CELL_MEMBER_ID, WORLD_TILE_LAYER_LINK_TILES_MEMBER_ID, WORLD_TILE_LAYER_LINK_TILE_ENTRY_MEMBER_ID, WORLD_OBJECT_LAYER_LINK_OBJECTS_MEMBER_ID, WORLD_OBJECT_LAYER_LINK_OBJECT_ENTRY_MEMBER_ID, WORLD_ANIMATION_CLIP_TARGET_PARAM_ID, WORLD_ANIMATION_CHILD_OVERRIDE_ENTRY_PARAM_ID, WORLD_ANIMATION_CLIP_FPS_MEMBER_ID, WORLD_ANIMATION_CLIP_DURATION_MEMBER_ID, WORLD_ANIMATION_CLIP_FRAMES_MEMBER_ID, WORLD_ANIMATION_CLIP_TRACKS_MEMBER_ID, WORLD_ANIMATION_FRAME_BASE_INDEX_MEMBER_ID, WORLD_ANIMATION_FRAME_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_FRAME_CHILD_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_FRAME_CHILD_OVERRIDES_ENTRY_MEMBER_ID, WORLD_ANIMATION_FRAME_ACTIONS_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_SELECTOR_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_REFRESH_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_TRACK_SELECTOR_MEMBER_ID, WORLD_ANIMATION_TRACK_REFRESH_MEMBER_ID, WORLD_ANIMATION_TRACK_START_FRAME_MEMBER_ID, WORLD_ANIMATION_TRACK_DIRECTION_MEMBER_ID, WORLD_ANIMATION_TRACK_OFFSET_START_INDEX_MEMBER_ID, WORLD_ANIMATION_TRACK_OFFSET_END_INDEX_MEMBER_ID, WORLD_ANIMATION_CHILD_TRACK_CLIP_KEY_MEMBER_ID, WORLD_ANIMATION_SEGMENT_DURATION_MEMBER_ID, WORLD_ANIMATION_SEGMENT_FRAMES_MEMBER_ID, WORLD_ANIMATION_SEGMENT_TRACK_CHILD_PARAM_ID, WORLD_ANIMATION_SEGMENT_TRACK_VALUE_PARAM_ID, WORLD_SELECTOR_REFRESH_ON_LOAD_OPTION_ID, WORLD_SELECTOR_REFRESH_PER_FRAME_OPTION_ID, WORLD_PLAY_DIRECTION_FORWARD_OPTION_ID, WORLD_PLAY_DIRECTION_REVERSE_OPTION_ID, WORLD_SYSTEM_CLASS_DEFINITIONS;
48899
48899
  var init_world_system_classes_generated = __esm({
48900
48900
  "../src/models/classes/world-system-classes.generated.ts"() {
48901
48901
  "use strict";
@@ -48903,7 +48903,6 @@ var init_world_system_classes_generated = __esm({
48903
48903
  init_member_subtree_distribution();
48904
48904
  init_classes();
48905
48905
  init_member_kinds();
48906
- WORLD_LAYER_SORTING_LAYER_MEMBER_ID = "system_89dbb12e-1d7c-42ad-b872-63fc7fe8bd5b";
48907
48906
  WORLD_GRID_CHILDREN_MEMBER_ID = "system_98578ba3-a70e-4397-9283-996a898d44c8";
48908
48907
  WORLD_GRID_CHILDREN_ENTRY_MEMBER_ID = "system_c86da069-7ef9-5693-a54b-5c331755fde9";
48909
48908
  WORLD_OBJECT_CHILDREN_MEMBER_ID = "system_bb5d2cf1-a0dd-4eba-a62e-0e1bf0177071";
@@ -50950,62 +50949,6 @@ function worldAnimationChildOverrideBindingMember(projectId, classId) {
50950
50949
  updatedAt: 0
50951
50950
  };
50952
50951
  }
50953
- function buildWorldSystemMetadata(worldKind) {
50954
- return {
50955
- kind: SystemProtectionKind.WorldAuthoring,
50956
- worldKind
50957
- };
50958
- }
50959
- function buildWorldSystemFieldMetadata() {
50960
- return {
50961
- kind: SystemProtectionKind.WorldAuthoring
50962
- };
50963
- }
50964
- function buildWorldSystemNeoSchemaClassBase(definition2, classIdsByWorldKind) {
50965
- const schemaFields = definition2.schemaFields ?? [];
50966
- const genericParams = definition2.genericParams?.map((param) => {
50967
- const constraintWorldKind = param.constraintClassWorldKind;
50968
- if (constraintWorldKind === void 0) {
50969
- return { id: param.id, name: param.name };
50970
- }
50971
- const constraintClassId = classIdsByWorldKind?.get(constraintWorldKind);
50972
- if (classIdsByWorldKind !== void 0 && constraintClassId === void 0) {
50973
- throw new Error(
50974
- `Cannot create world system class "${definition2.worldKind}" before generic constraint class "${constraintWorldKind}".`
50975
- );
50976
- }
50977
- return {
50978
- id: param.id,
50979
- name: param.name,
50980
- ...constraintClassId === void 0 ? {} : {
50981
- constraint: {
50982
- kind: 0 /* Class */,
50983
- classId: constraintClassId
50984
- }
50985
- }
50986
- };
50987
- });
50988
- return {
50989
- name: definition2.name,
50990
- ...definition2.docsText === void 0 ? {} : { docsText: definition2.docsText },
50991
- schema: Object.fromEntries(
50992
- schemaFields.map((field) => [field.schemaKey, field.memberId])
50993
- ),
50994
- ...definition2.uiVisibility === void 0 ? {} : { uiVisibility: definition2.uiVisibility },
50995
- ...definition2.modifier === void 0 ? {} : { modifier: definition2.modifier },
50996
- system: buildWorldSystemMetadata(definition2.worldKind),
50997
- ...definition2.allowedStorage === void 0 ? {} : { allowedStorage: definition2.allowedStorage },
50998
- ...genericParams === void 0 ? {} : { genericParams },
50999
- ...definition2.extendsGenericBindings === void 0 ? {} : {
51000
- extendsGenericBindings: deepClonePlainData(
51001
- definition2.extendsGenericBindings
51002
- )
51003
- },
51004
- ...definition2.targetMemberId === void 0 ? {} : { targetMemberId: definition2.targetMemberId },
51005
- ...definition2.constructorIds === void 0 || definition2.constructorIds.length === 0 ? {} : { constructorIds: [...definition2.constructorIds] },
51006
- ...definition2.requiredConstructorId === void 0 ? {} : { requiredConstructorId: definition2.requiredConstructorId }
51007
- };
51008
- }
51009
50952
  function animationFamilyClassKinds(classes) {
51010
50953
  const classesById = new Map(classes.map((entry) => [entry.id, entry]));
51011
50954
  const resolved = /* @__PURE__ */ new Map();
@@ -51031,331 +50974,6 @@ function animationFamilyClassKinds(classes) {
51031
50974
  }
51032
50975
  return family;
51033
50976
  }
51034
- function requireWorldSystemClassDefinition(worldKind) {
51035
- const definition2 = WORLD_SYSTEM_CLASS_DEFINITION_BY_KIND.get(worldKind);
51036
- if (definition2 === void 0) {
51037
- throw new Error(
51038
- `World system kind "${worldKind}" has no class definition in the generated table.`
51039
- );
51040
- }
51041
- return definition2;
51042
- }
51043
- function buildWorldSystemSeedRecords(args) {
51044
- const definitions = WORLD_SYSTEM_CLASS_DEFINITIONS.filter(
51045
- (definition2) => args.worldKinds.has(definition2.worldKind)
51046
- );
51047
- assertCanonicalWorldSystemClassIds(args.classIdsByWorldKind);
51048
- const classes = definitions.map((definition2) => {
51049
- const id2 = args.classIdsByWorldKind.get(definition2.worldKind);
51050
- if (id2 === void 0) {
51051
- throw new Error(
51052
- `World system seed is missing a class id for "${definition2.worldKind}".`
51053
- );
51054
- }
51055
- return {
51056
- id: id2,
51057
- projectId: args.projectId,
51058
- ...buildWorldSystemNeoSchemaClassBase(
51059
- definition2,
51060
- args.classIdsByWorldKind
51061
- ),
51062
- ...worldSystemSeedExtendsClassId(definition2, args.classIdsByWorldKind),
51063
- createdAt: args.now,
51064
- updatedAt: args.now
51065
- };
51066
- });
51067
- const fields = definitions.flatMap((definition2) => [
51068
- ...definition2.schemaFields ?? [],
51069
- ...definition2.supportingFields ?? []
51070
- ]).filter(
51071
- (field) => args.memberIds === void 0 || args.memberIds.has(field.memberId)
51072
- );
51073
- const uniqueFields = new Map(fields.map((field) => [field.memberId, field]));
51074
- const members = [...uniqueFields.values()].map(
51075
- (field) => buildWorldSystemSeedMember({ ...args, field })
51076
- );
51077
- const constructors = definitions.flatMap((definition2) => {
51078
- const classId = args.classIdsByWorldKind.get(definition2.worldKind);
51079
- if (classId === void 0) {
51080
- throw new Error(
51081
- `World system seed is missing a constructor owner id for "${definition2.worldKind}".`
51082
- );
51083
- }
51084
- return (definition2.constructors ?? []).map((constructor2) => ({
51085
- id: constructor2.constructorId,
51086
- projectId: args.projectId,
51087
- classId,
51088
- ...constructor2.docsText === void 0 ? {} : { docsText: constructor2.docsText },
51089
- argumentTypes: constructor2.argumentTypes.map(
51090
- (argument2) => deepClonePlainData(argument2)
51091
- ),
51092
- code: constructor2.code,
51093
- ...constructor2.baseArguments === void 0 ? {} : {
51094
- baseArguments: constructor2.baseArguments?.map((argument2) => ({ ...argument2 })) ?? null
51095
- },
51096
- ...constructor2.baseInitializerFields === void 0 ? {} : {
51097
- baseInitializerFields: constructor2.baseInitializerFields?.map((field) => ({
51098
- ...field
51099
- })) ?? null
51100
- },
51101
- createdAt: args.now,
51102
- updatedAt: args.now
51103
- }));
51104
- });
51105
- return { classes, constructors, members };
51106
- }
51107
- function assertCanonicalWorldSystemClassIds(classIdsByWorldKind) {
51108
- for (const [worldKind, classId] of classIdsByWorldKind) {
51109
- const canonicalClassId = requireWorldSystemClassDefinition(worldKind).classId;
51110
- if (classId === canonicalClassId) continue;
51111
- throw new Error(
51112
- `World system class "${worldKind}" must use canonical id "${canonicalClassId}", received "${classId}".`
51113
- );
51114
- }
51115
- }
51116
- function buildWorldSystemSeedMember(args) {
51117
- const { field } = args;
51118
- return {
51119
- id: field.memberId,
51120
- projectId: args.projectId,
51121
- name: field.schemaKey,
51122
- kind: worldSystemSeedMemberKind(field),
51123
- ...field.requirement === void 0 ? {} : { requirement: field.requirement },
51124
- ...field.access === void 0 ? {} : { access: field.access },
51125
- ...field.modifier === void 0 ? {} : { modifier: field.modifier },
51126
- ...field.mutability === void 0 ? {} : { mutability: field.mutability },
51127
- ...field.storage === void 0 ? {} : { storage: field.storage },
51128
- ...field.extendsMemberId === void 0 ? {} : { extendsMemberId: field.extendsMemberId },
51129
- ...worldSystemSeedDefaultValue(field, args.sortingLayerSeed),
51130
- ...field.docsText === void 0 ? {} : { docsText: field.docsText },
51131
- ...field.storageKey === void 0 ? {} : { storageKey: field.storageKey },
51132
- ...field.distribution === void 0 ? {} : { distribution: field.distribution },
51133
- system: buildWorldSystemFieldMetadata(),
51134
- createdAt: args.now,
51135
- updatedAt: args.now,
51136
- ...worldSystemSeedMemberSpecificFields(
51137
- field,
51138
- args.classIdsByWorldKind,
51139
- args.sortingLayerSeed
51140
- )
51141
- };
51142
- }
51143
- function worldSystemSeedExtendsClassId(definition2, classIdsByWorldKind) {
51144
- const parentKind = definition2.extendsWorldKind;
51145
- if (parentKind === void 0) return {};
51146
- const parentClassId = classIdsByWorldKind.get(parentKind);
51147
- if (parentClassId === void 0) {
51148
- throw new Error(
51149
- `Cannot create world system class "${definition2.worldKind}" before parent "${parentKind}".`
51150
- );
51151
- }
51152
- return { extendsClassId: parentClassId };
51153
- }
51154
- function worldSystemSeedDefaultValue(field, sortingLayerSeed) {
51155
- if (field.memberId === WORLD_LAYER_SORTING_LAYER_MEMBER_ID) {
51156
- return {
51157
- defaultValue: {
51158
- value: [
51159
- requireSortingLayerSeed(
51160
- sortingLayerSeed,
51161
- "Cannot seed the layer SortingLayer default before sorting layers are seeded."
51162
- ).defaultSortingLayerValueId
51163
- ]
51164
- }
51165
- };
51166
- }
51167
- if (field.defaultInitializerCode !== void 0) {
51168
- return {
51169
- defaultValue: { init: { code: field.defaultInitializerCode } }
51170
- };
51171
- }
51172
- if (field.defaultValue === void 0) return {};
51173
- return {
51174
- defaultValue: { value: deepClonePlainData(field.defaultValue) }
51175
- };
51176
- }
51177
- function requireSortingLayerSeed(seed, message) {
51178
- if (seed === void 0) {
51179
- throw new Error(message);
51180
- }
51181
- return seed;
51182
- }
51183
- function worldSystemSeedMemberKind(field) {
51184
- switch (field.memberKind) {
51185
- case "bool":
51186
- return 1 /* Bool */;
51187
- case "class":
51188
- return 7 /* Class */;
51189
- case "computed":
51190
- return 10 /* NSProperty */;
51191
- // No `"action"` tag: no platform system class declares an NSAction member
51192
- // yet, and a seed tag with no seed behind it is dead code. Add the tag —
51193
- // with the first seed that needs one; the field tag is a string union, so
51194
- // nothing here fails to compile in the meantime.
51195
- case "delegate":
51196
- return 25 /* NSDelegate */;
51197
- case "enum":
51198
- return 8 /* Enum */;
51199
- case "float":
51200
- return 4 /* Float */;
51201
- case "function":
51202
- return 13 /* Function */;
51203
- case "functionRef":
51204
- return 24 /* FunctionRef */;
51205
- case "generic":
51206
- return 21 /* Generic */;
51207
- case "int":
51208
- return 2 /* Int */;
51209
- case "list":
51210
- return 6 /* List */;
51211
- case "lookup":
51212
- return 9 /* Lookup */;
51213
- case "sprite":
51214
- return 11 /* Sprite */;
51215
- case "string":
51216
- return 3 /* String */;
51217
- case "vector2":
51218
- return 14 /* Vector2 */;
51219
- case "vector2Int":
51220
- return 15 /* Vector2Int */;
51221
- case "vector3":
51222
- return 16 /* Vector3 */;
51223
- }
51224
- }
51225
- function worldSystemSeedMemberSpecificFields(field, classIdsByWorldKind, sortingLayerSeed) {
51226
- switch (field.memberKind) {
51227
- case "class": {
51228
- const worldKind = field.schemaClassWorldKind;
51229
- if (worldKind === void 0) {
51230
- throw new Error(
51231
- `World system seed field "${field.schemaKey}" is missing schemaClassWorldKind.`
51232
- );
51233
- }
51234
- const classId = classIdsByWorldKind.get(worldKind);
51235
- if (classId === void 0) {
51236
- throw new Error(
51237
- `World system seed field "${field.schemaKey}" cannot find the class for "${worldKind}".`
51238
- );
51239
- }
51240
- return {
51241
- classId,
51242
- ...field.classArguments === void 0 ? {} : {
51243
- classArguments: deepClonePlainData(field.classArguments)
51244
- },
51245
- ...field.payload === void 0 ? {} : { payload: field.payload }
51246
- };
51247
- }
51248
- case "computed": {
51249
- if (field.returnTypeInfo === void 0) {
51250
- throw new Error(
51251
- `World system seed field "${field.schemaKey}" is missing returnTypeInfo.`
51252
- );
51253
- }
51254
- if (field.returnTypeInfo.type === NS_TYPE_VOID) {
51255
- throw new Error(
51256
- `World system seed field "${field.schemaKey}" is a computed member returning void, which has no value to read.`
51257
- );
51258
- }
51259
- return {
51260
- returnTypeInfo: deepClonePlainData(field.returnTypeInfo),
51261
- ...field.code === void 0 ? {} : { code: field.code }
51262
- };
51263
- }
51264
- case "function":
51265
- case "delegate": {
51266
- const returnTypeInfo = field.returnTypeInfo;
51267
- if (returnTypeInfo === void 0) {
51268
- throw new Error(
51269
- `World system seed field "${field.schemaKey}" is missing ${field.memberKind} returnTypeInfo.`
51270
- );
51271
- }
51272
- if (field.argumentTypes === void 0) {
51273
- throw new Error(
51274
- `World system seed field "${field.schemaKey}" is missing ${field.memberKind} argumentTypes.`
51275
- );
51276
- }
51277
- return {
51278
- ...field.memberKind === "function" ? { dispatch: field.dispatch ?? 0 /* Synchronous */ } : {},
51279
- returnTypeInfo: deepClonePlainData(returnTypeInfo),
51280
- argumentTypes: field.argumentTypes.map(
51281
- (argument2) => deepClonePlainData(argument2)
51282
- )
51283
- };
51284
- }
51285
- case "generic":
51286
- if (field.genericParamId === void 0) {
51287
- throw new Error(
51288
- `World system seed field "${field.schemaKey}" is missing genericParamId.`
51289
- );
51290
- }
51291
- return {
51292
- genericParamId: field.genericParamId,
51293
- ...field.payload === void 0 ? {} : { payload: field.payload }
51294
- };
51295
- case "int":
51296
- case "float":
51297
- return {
51298
- ...field.minValue === void 0 ? {} : { minValue: field.minValue },
51299
- ...field.maxValue === void 0 ? {} : { maxValue: field.maxValue }
51300
- };
51301
- case "list":
51302
- if (field.entryMemberId === void 0) {
51303
- throw new Error(
51304
- `World system seed field "${field.schemaKey}" is missing entryMemberId.`
51305
- );
51306
- }
51307
- return {
51308
- entryMemberId: field.entryMemberId,
51309
- ...field.listKind === void 0 ? {} : { listKind: field.listKind }
51310
- };
51311
- case "lookup":
51312
- if (field.collectionMemberId === void 0) {
51313
- throw new Error(
51314
- `World system seed field "${field.schemaKey}" is missing collectionMemberId.`
51315
- );
51316
- }
51317
- return {
51318
- collectionMemberId: field.collectionMemberId,
51319
- collectionValueId: worldSystemSeedCollectionValueId(
51320
- field,
51321
- sortingLayerSeed
51322
- ),
51323
- ...field.selection === void 0 ? {} : { selection: field.selection },
51324
- ...field.declaredTypeInfo === void 0 ? {} : {
51325
- declaredTypeInfo: deepClonePlainData(field.declaredTypeInfo)
51326
- }
51327
- };
51328
- case "string":
51329
- return field.format === void 0 ? {} : { format: field.format };
51330
- case "enum":
51331
- if (field.enumId === void 0) {
51332
- throw new Error(
51333
- `World system seed field "${field.schemaKey}" is missing enumId.`
51334
- );
51335
- }
51336
- return {
51337
- enumId: field.enumId,
51338
- ...field.selection === void 0 ? {} : { selection: field.selection }
51339
- };
51340
- case "sprite":
51341
- return {};
51342
- case "bool":
51343
- case "functionRef":
51344
- case "vector2":
51345
- case "vector2Int":
51346
- case "vector3":
51347
- return {};
51348
- }
51349
- }
51350
- function worldSystemSeedCollectionValueId(field, sortingLayerSeed) {
51351
- if (field.memberId === WORLD_LAYER_SORTING_LAYER_MEMBER_ID) {
51352
- return requireSortingLayerSeed(
51353
- sortingLayerSeed,
51354
- "Cannot seed the layer SortingLayer lookup before sorting layers are seeded."
51355
- ).sortingLayersValueId;
51356
- }
51357
- return field.collectionValueId;
51358
- }
51359
50977
  var WORLD_ANIMATION_CHILD_OVERRIDE_BINDING_MEMBER_NAME, WORLD_ANIMATION_CHILD_OVERRIDE_BINDING_MEMBER_NAMESPACE, WORLD_SYSTEM_CLASS_DEFINITION_BY_KIND, WORLD_SYSTEM_ANIMATION_KIND_MARKER, WORLD_SYSTEM_ANIMATION_KINDS, GENERIC_WORLD_SYSTEM_CLASS_KINDS, WORLD_SYSTEM_ALL_KINDS, WORLD_SYSTEM_SCHEMA_FIELD_SITES_BY_MEMBER_ID;
51360
50978
  var init_world_system_classes = __esm({
51361
50979
  "../src/models/classes/world-system-classes.ts"() {
@@ -87793,35 +87411,35 @@ function memberLocalizedTextId(args) {
87793
87411
  );
87794
87412
  }
87795
87413
  function memberLocalizationDeclarationId(memberId, memberRows) {
87796
- let declarationId2 = memberId;
87414
+ let declarationId = memberId;
87797
87415
  const members = projectSchemaIndexFor({
87798
87416
  classes: NO_CLASSES2,
87799
87417
  members: memberRows
87800
87418
  }).membersById;
87801
87419
  const visited = /* @__PURE__ */ new Set();
87802
87420
  while (true) {
87803
- if (visited.has(declarationId2))
87421
+ if (visited.has(declarationId))
87804
87422
  throw new Error(
87805
- `Localized member inheritance cycles at "${declarationId2}".`
87423
+ `Localized member inheritance cycles at "${declarationId}".`
87806
87424
  );
87807
- visited.add(declarationId2);
87808
- const member = members.get(declarationId2);
87425
+ visited.add(declarationId);
87426
+ const member = members.get(declarationId);
87809
87427
  if (member === void 0)
87810
87428
  throw new Error(
87811
- `Localized member declaration "${declarationId2}" was not found.`
87429
+ `Localized member declaration "${declarationId}" was not found.`
87812
87430
  );
87813
87431
  const parent = getOptionalString(member, "extendsMemberId");
87814
87432
  if (parent === void 0) break;
87815
- declarationId2 = parent;
87433
+ declarationId = parent;
87816
87434
  }
87817
- return declarationId2;
87435
+ return declarationId;
87818
87436
  }
87819
- function declaredMemberLocalizedTextId(declarationId2, mainLocale, value) {
87437
+ function declaredMemberLocalizedTextId(declarationId, mainLocale, value) {
87820
87438
  return value === "" ? "" : inSystemRecordNamespaceOf(
87821
- declarationId2,
87439
+ declarationId,
87822
87440
  v5_default(
87823
87441
  JSON.stringify([
87824
- withoutSystemRecordIdPrefix(declarationId2),
87442
+ withoutSystemRecordIdPrefix(declarationId),
87825
87443
  mainLocale,
87826
87444
  value
87827
87445
  ]),
@@ -87932,11 +87550,11 @@ function retargetPrimaryLocalizedTextWrites(before, post, changes) {
87932
87550
  throw new Error(
87933
87551
  `Selected source for localized text "${old.id}" has no member declaration.`
87934
87552
  );
87935
- const declarationId2 = memberLocalizationDeclarationId(
87553
+ const declarationId = memberLocalizationDeclarationId(
87936
87554
  memberId,
87937
87555
  post.members
87938
87556
  );
87939
- if (old.memberSource !== void 0 && old.memberSource.memberId !== declarationId2)
87557
+ if (old.memberSource !== void 0 && old.memberSource.memberId !== declarationId)
87940
87558
  throw new Error(
87941
87559
  `Selected assignment for localized text "${old.id}" belongs to a different member declaration.`
87942
87560
  );
@@ -87957,7 +87575,7 @@ function retargetPrimaryLocalizedTextWrites(before, post, changes) {
87957
87575
  config: post.localizationConfig,
87958
87576
  now: next.updatedAt,
87959
87577
  memberSource: {
87960
- memberId: declarationId2,
87578
+ memberId: declarationId,
87961
87579
  locale: primary
87962
87580
  }
87963
87581
  });
@@ -109998,19 +109616,19 @@ function lowerExtendsBindings(context, declaration, baseClassId, argumentsValue)
109998
109616
  ...context.genericParametersByClass.get(baseClassId)?.entries() ?? []
109999
109617
  ];
110000
109618
  const result = {};
110001
- const declarationId2 = materializedId(declaration, "class", declaration.name);
110002
- const baseBindings = context.baseClasses.get(declarationId2)?.extendsGenericBindings ?? {};
109619
+ const declarationId = materializedId(declaration, "class", declaration.name);
109620
+ const baseBindings = context.baseClasses.get(declarationId)?.extendsGenericBindings ?? {};
110003
109621
  for (const [[parameterName, parameterId], argumentType] of zip(
110004
109622
  parameters,
110005
109623
  argumentsValue
110006
109624
  )) {
110007
- const local = context.genericParametersByClass.get(declarationId2)?.get(argumentType.name);
109625
+ const local = context.genericParametersByClass.get(declarationId)?.get(argumentType.name);
110008
109626
  if (local) {
110009
109627
  result[parameterId] = { kind: "generic", genericParamId: local };
110010
109628
  continue;
110011
109629
  }
110012
109630
  const baseBinding = baseBindings[parameterId];
110013
- const memberId = baseBinding?.kind === "member" ? baseBinding.memberId : derivedGenericArgumentMemberId(declarationId2, parameterId);
109631
+ const memberId = baseBinding?.kind === "member" ? baseBinding.memberId : derivedGenericArgumentMemberId(declarationId, parameterId);
110014
109632
  result[parameterId] = { kind: "member", memberId };
110015
109633
  lowerGenericArgument(
110016
109634
  context,
@@ -129097,978 +128715,6 @@ var init_compiler_metadata = __esm({
129097
128715
  }
129098
128716
  });
129099
128717
 
129100
- // ../src/database/raw-tile-migration-class-reader.ts
129101
- function rawTileMigrationReadableClass(value) {
129102
- if (typeof value !== "object" || value === null) return value;
129103
- if (!("id" in value)) return value;
129104
- if (!("system" in value)) return value;
129105
- const system = value.system;
129106
- if (typeof system !== "object" || system === null) return value;
129107
- if (!("kind" in system) || system.kind !== "worldAuthoring") return value;
129108
- if (!("worldKind" in system)) return value;
129109
- const retiredTile = value.id === RETIRED_TILE_INSTANCE_CLASS_ID && system.worldKind === "tileInstance";
129110
- const renamedFootprint = value.id === PLACEMENT_TILE_CLASS_ID && system.worldKind === "objectPlacementTile";
129111
- if (!retiredTile && !renamedFootprint) return value;
129112
- const projectedSystem = { ...system };
129113
- Reflect.deleteProperty(projectedSystem, "worldKind");
129114
- return { ...value, system: projectedSystem };
129115
- }
129116
- var RETIRED_TILE_INSTANCE_CLASS_ID, PLACEMENT_TILE_CLASS_ID;
129117
- var init_raw_tile_migration_class_reader = __esm({
129118
- "../src/database/raw-tile-migration-class-reader.ts"() {
129119
- "use strict";
129120
- RETIRED_TILE_INSTANCE_CLASS_ID = "system_4689bc94-de98-46cd-b220-efe118f4106c";
129121
- PLACEMENT_TILE_CLASS_ID = "system_ccc3330c-2db5-44dc-9c8e-5ebfe430dec9";
129122
- }
129123
- });
129124
-
129125
- // ../src/database/raw-tile-render-members.ts
129126
- function rawTileRenderMemberIds(members) {
129127
- const byId = new Map(members.map((member) => [member.id, member]));
129128
- const cache = /* @__PURE__ */ new Map();
129129
- function resolve5(id2, visiting) {
129130
- if (RAW_TILE_RENDER_MEMBER_IDS.has(id2)) return true;
129131
- const cached = cache.get(id2);
129132
- if (cached !== void 0) return cached;
129133
- const member = byId.get(id2);
129134
- if (member === void 0 || visiting.has(id2))
129135
- throw new Error(
129136
- `Raw tile render member ancestry is unresolved at "${id2}".`
129137
- );
129138
- visiting.add(id2);
129139
- try {
129140
- const result2 = typeof member.extendsMemberId === "string" ? resolve5(member.extendsMemberId, visiting) : false;
129141
- cache.set(id2, result2);
129142
- return result2;
129143
- } finally {
129144
- visiting.delete(id2);
129145
- }
129146
- }
129147
- const result = /* @__PURE__ */ new Set();
129148
- for (const member of members) {
129149
- if (resolve5(member.id, /* @__PURE__ */ new Set())) result.add(member.id);
129150
- }
129151
- return result;
129152
- }
129153
- var RAW_TILE_RENDER_MEMBER_IDS;
129154
- var init_raw_tile_render_members = __esm({
129155
- "../src/database/raw-tile-render-members.ts"() {
129156
- "use strict";
129157
- RAW_TILE_RENDER_MEMBER_IDS = /* @__PURE__ */ new Set([
129158
- "system_3b02422f-1ef2-4a50-8386-155d5001082b",
129159
- "system_cbd6db9a-f473-44b5-b913-7cdc06452f35",
129160
- "system_96cda8f5-3100-45b5-adcb-0552d21504dd"
129161
- ]);
129162
- }
129163
- });
129164
-
129165
- // ../src/database/raw-tile-source-rewrite.ts
129166
- function rewriteRawTileSource(code) {
129167
- if (!code.includes("NeoTileInstance") && !code.includes("NeoObjectPlacementTile"))
129168
- return code;
129169
- let ast;
129170
- try {
129171
- ast = parseExpression(code);
129172
- } catch {
129173
- ast = parseFunctionBody(code);
129174
- }
129175
- const lexical = lex(code);
129176
- const tokens = lexical.tokens.filter((token) => token.kind !== "comment");
129177
- const indexByStart = new Map(
129178
- tokens.map((token, index) => [token.start, index])
129179
- );
129180
- const replacements = /* @__PURE__ */ new Map();
129181
- const visit = (value) => {
129182
- if (Array.isArray(value)) {
129183
- for (const child of value) visit(child);
129184
- return;
129185
- }
129186
- if (!isRecord9(value)) return;
129187
- const name = value.kind === "named" ? value.name : value.className;
129188
- if (value.kind === "named" || value.kind === "new") {
129189
- if (name === "NeoTileInstance" || name === "NeoObjectPlacementTile") {
129190
- if (value.kind === "new" && name === "NeoTileInstance") {
129191
- throw new Error(
129192
- "Raw tile migration cannot infer the concrete tile class of an authored NeoTileInstance constructor."
129193
- );
129194
- }
129195
- const pos = value.pos;
129196
- if (!isRecord9(pos) || typeof pos.line !== "number" || typeof pos.column !== "number") {
129197
- throw new Error(
129198
- `Raw tile migration cannot locate type "${name}" in its source.`
129199
- );
129200
- }
129201
- const start = lexical.source.offsetAt({
129202
- line: pos.line - 1,
129203
- character: pos.column - 1
129204
- });
129205
- const index = indexByStart.get(start);
129206
- const offset = value.kind === "new" ? 1 : 0;
129207
- const token = index === void 0 ? void 0 : tokens[index + offset];
129208
- if (token?.text !== name) {
129209
- throw new Error(
129210
- `Raw tile migration found inconsistent source coordinates for type "${name}".`
129211
- );
129212
- }
129213
- replacements.set(token.start, {
129214
- end: token.end,
129215
- text: name === "NeoTileInstance" ? "NeoTile" : "NeoPlacementTile"
129216
- });
129217
- }
129218
- }
129219
- for (const child of Object.values(value)) visit(child);
129220
- };
129221
- visit(ast);
129222
- if (replacements.size === 0) return code;
129223
- let next = "";
129224
- let cursor = 0;
129225
- for (const [start, replacement] of [...replacements].sort(
129226
- ([a], [b]) => a - b
129227
- )) {
129228
- next += code.slice(cursor, start) + replacement.text;
129229
- cursor = replacement.end;
129230
- }
129231
- return next + code.slice(cursor);
129232
- }
129233
- function isRecord9(value) {
129234
- return typeof value === "object" && value !== null && !Array.isArray(value);
129235
- }
129236
- var init_raw_tile_source_rewrite = __esm({
129237
- "../src/database/raw-tile-source-rewrite.ts"() {
129238
- "use strict";
129239
- init_src();
129240
- }
129241
- });
129242
-
129243
- // ../src/database/raw-tile-placement-migration.ts
129244
- function rawTileCanonicalRecords(projectId, now) {
129245
- const definitions = WORLD_SYSTEM_CLASS_DEFINITIONS.filter(
129246
- (definition2) => DECLARATION_OWNER_IDS.has(definition2.classId)
129247
- );
129248
- const seed = buildWorldSystemSeedRecords({
129249
- projectId,
129250
- now,
129251
- worldKinds: new Set(definitions.map((definition2) => definition2.worldKind)),
129252
- classIdsByWorldKind: new Map(
129253
- WORLD_SYSTEM_CLASS_DEFINITIONS.map((definition2) => [
129254
- definition2.worldKind,
129255
- definition2.classId
129256
- ])
129257
- ),
129258
- memberIds: CHANGED_MEMBER_IDS
129259
- });
129260
- return {
129261
- ...seed,
129262
- classes: seed.classes.filter((record6) => CHANGED_CLASS_IDS.has(record6.id))
129263
- };
129264
- }
129265
- function migrateRawTileRetainedRecord(args) {
129266
- if (RAW_TILE_RETIRED_RECORD_KEYS.some(
129267
- (key) => key.recordKind === args.recordKind && key.recordId === args.recordId
129268
- ))
129269
- return { kind: "retire" };
129270
- if (args.deleted) return { kind: "unchanged" };
129271
- if (args.recordKind === "value") {
129272
- if (!isMemberValue(args.data)) {
129273
- throw new Error(
129274
- `Raw tile migration cannot read value "${args.recordId}".`
129275
- );
129276
- }
129277
- const next2 = migrateRawTilePlacementValue(
129278
- args.data,
129279
- void 0,
129280
- args.footprintValueIds
129281
- );
129282
- return next2 === args.data ? { kind: "unchanged" } : { kind: "rewrite", data: next2 };
129283
- }
129284
- if (args.recordKind !== "class" && args.recordKind !== "member") {
129285
- return DECLARATION_KINDS.has(args.recordKind) ? declarationRewrite(args.data) : { kind: "unchanged" };
129286
- }
129287
- const changedIds = args.recordKind === "class" ? CHANGED_CLASS_IDS : CHANGED_MEMBER_IDS;
129288
- if (!changedIds.has(args.recordId)) {
129289
- const rewritten = declarationRewrite(args.data);
129290
- const data2 = rewritten.kind === "rewrite" ? rewritten.data : args.data;
129291
- if (args.recordKind !== "member" || !args.renderMemberIds?.has(args.recordId))
129292
- return rewritten;
129293
- if (!isRecord10(data2) || typeof data2.kind !== "number")
129294
- throw new Error(
129295
- `Raw tile render member "${args.recordId}" lacks a declared kind.`
129296
- );
129297
- if (data2.kind !== 21 /* Generic */ && !memberKindOwnsStoredValue(data2.kind))
129298
- return rewritten;
129299
- const next2 = {
129300
- ...data2,
129301
- mutability: 1 /* ReadOnly */,
129302
- storage: 1 /* Immutable */
129303
- };
129304
- return canonicalJsonStringify(next2) === canonicalJsonStringify(args.data) ? { kind: "unchanged" } : { kind: "rewrite", data: next2 };
129305
- }
129306
- if (!isRecord10(args.data)) {
129307
- throw new Error(
129308
- `Raw tile migration cannot read ${args.recordKind} "${args.recordId}".`
129309
- );
129310
- }
129311
- const data = args.data;
129312
- if (typeof data.projectId !== "string") {
129313
- throw new Error(
129314
- `Raw tile migration ${args.recordKind} "${args.recordId}" lacks a project ID.`
129315
- );
129316
- }
129317
- const canonical = rawTileCanonicalRecords(data.projectId, 0);
129318
- const candidates = args.recordKind === "class" ? canonical.classes : canonical.members;
129319
- const replacement = candidates.find((record6) => record6.id === args.recordId);
129320
- if (replacement === void 0) return { kind: "unchanged" };
129321
- const next = {
129322
- ...replacement,
129323
- createdAt: data.createdAt,
129324
- updatedAt: data.updatedAt
129325
- };
129326
- return canonicalJsonStringify(next) === canonicalJsonStringify(data) ? { kind: "unchanged" } : { kind: "rewrite", data: next };
129327
- }
129328
- function declarationRewrite(data) {
129329
- const next = rewriteDeclarationNode(data);
129330
- return next === data ? { kind: "unchanged" } : { kind: "rewrite", data: next };
129331
- }
129332
- function rewriteDeclarationNode(data) {
129333
- if (Array.isArray(data)) {
129334
- let changed = false;
129335
- const next2 = data.map((item) => {
129336
- const rewritten = rewriteDeclarationNode(item);
129337
- if (rewritten !== item) changed = true;
129338
- return rewritten;
129339
- });
129340
- return changed ? next2 : data;
129341
- }
129342
- if (!isRecord10(data)) return data;
129343
- let next;
129344
- for (const [key, value] of Object.entries(data)) {
129345
- if (key === "value" && !isNSDelegateClosureValueDraft(value) && !isNSDelegateClosureValue(value))
129346
- continue;
129347
- let rewritten;
129348
- if (CLASS_REFERENCE_KEYS.has(key) && value === RETIRED_TILE_INSTANCE_CLASS_ID) {
129349
- rewritten = RAW_TILE_CLASS_ID;
129350
- } else if ((key === "code" || key === "setterCode") && typeof value === "string") {
129351
- rewritten = rewriteRawTileSource(value);
129352
- } else {
129353
- rewritten = rewriteDeclarationNode(value);
129354
- }
129355
- if (rewritten === value) continue;
129356
- next ??= { ...data };
129357
- next[key] = rewritten;
129358
- }
129359
- return next ?? data;
129360
- }
129361
- function isRecord10(value) {
129362
- return typeof value === "object" && value !== null && !Array.isArray(value);
129363
- }
129364
- function rewriteValueSources(row) {
129365
- if (isInitValueContent(row)) {
129366
- const code = rewriteRawTileSource(row.init.code);
129367
- return code === row.init.code ? row : { ...row, init: { ...row.init, code } };
129368
- }
129369
- let next = row;
129370
- if (isNSDelegateClosureValueDraft(row.value) || isNSDelegateClosureValue(row.value)) {
129371
- const code = row.value.code;
129372
- if (typeof code === "string") {
129373
- const rewritten = rewriteRawTileSource(code);
129374
- if (rewritten !== code)
129375
- next = { ...row, value: { ...row.value, code: rewritten } };
129376
- }
129377
- }
129378
- if (row.constructorArgs !== void 0 && row.constructorArgs !== null) {
129379
- let args;
129380
- for (const [key, value] of Object.entries(row.constructorArgs)) {
129381
- if (!isNSDelegateClosureValueDraft(value) && !isNSDelegateClosureValue(value))
129382
- continue;
129383
- if (typeof value.code !== "string") continue;
129384
- const code = rewriteRawTileSource(value.code);
129385
- if (code === value.code) continue;
129386
- args ??= { ...row.constructorArgs };
129387
- args[key] = { ...value, code };
129388
- }
129389
- if (args !== void 0) next = { ...next, constructorArgs: args };
129390
- }
129391
- return next;
129392
- }
129393
- function migrateRawTilePlacementValue(physical, concreteTileClassIds, footprintValueIds) {
129394
- const decoded = decodePackedValueRow(physical);
129395
- const needsRewrite = (row) => row.classId === RETIRED_TILE_INSTANCE_CLASS_ID || row.classId == null && footprintValueIds?.has(row.id) === true;
129396
- let changed = false;
129397
- const sourcedRows = [decoded.row, ...decoded.children].map((row) => {
129398
- const next = rewriteValueSources(row);
129399
- if (next !== row) changed = true;
129400
- return next;
129401
- });
129402
- if (!changed && !sourcedRows.some(needsRewrite)) return physical;
129403
- const rows = new Map(sourcedRows.map((row) => [row.id, row]));
129404
- const packedChildren = new Map(decoded.packedChildIdsByParentId);
129405
- for (const storedRow of rows.values()) {
129406
- let row = storedRow;
129407
- if (!isLiteralValueContent(row)) continue;
129408
- if (row.classId == null && footprintValueIds?.has(row.id) === true) {
129409
- row = { ...row, classId: PLACEMENT_TILE_CLASS_ID };
129410
- rows.set(row.id, row);
129411
- changed = true;
129412
- }
129413
- if (row.classId !== RETIRED_TILE_INSTANCE_CLASS_ID) continue;
129414
- const label = `Tile placement "${row.id}"`;
129415
- if (typeof row.value !== "object" || row.value === null) {
129416
- throw new Error(`${label} has no stored placement fields.`);
129417
- }
129418
- if (Array.isArray(row.value)) {
129419
- throw new Error(`${label} stores an array instead of placement fields.`);
129420
- }
129421
- const body = row.value;
129422
- for (const key of Object.keys(body)) {
129423
- if (key !== "Cell" && key !== "assetClassId") {
129424
- throw new Error(`${label} has unsupported placement field "${key}".`);
129425
- }
129426
- }
129427
- if (typeof body.assetClassId !== "string") {
129428
- throw new Error(`${label} has no tile class in assetClassId.`);
129429
- }
129430
- if (body.assetClassId.length === 0) {
129431
- throw new Error(`${label} has an empty tile class in assetClassId.`);
129432
- }
129433
- if (concreteTileClassIds !== void 0 && !concreteTileClassIds.has(body.assetClassId)) {
129434
- throw new Error(
129435
- `${label} names non-concrete or missing tile class "${body.assetClassId}".`
129436
- );
129437
- }
129438
- if (typeof row.instanceConstructorId === "string") {
129439
- throw new Error(`${label} carries an explicit wrapper constructor.`);
129440
- }
129441
- if (row.instanceVariantId != null) {
129442
- throw new Error(`${label} carries a wrapper variant.`);
129443
- }
129444
- if (row.instanceVariantRowValueId != null) {
129445
- throw new Error(`${label} carries a bound wrapper variant row.`);
129446
- }
129447
- if (Object.keys(row.constructorArgs ?? {}).length > 0) {
129448
- throw new Error(`${label} carries wrapper constructor arguments.`);
129449
- }
129450
- if (Object.keys(row.genericBindings ?? {}).length > 0) {
129451
- throw new Error(`${label} carries wrapper generic bindings.`);
129452
- }
129453
- let cellId = body.Cell;
129454
- if (cellId === void 0) {
129455
- const defaultCellId = virtualValueId(
129456
- row.id,
129457
- "raw-tile-placement-migration:Cell"
129458
- );
129459
- if (rows.has(defaultCellId)) {
129460
- throw new Error(`${label} collides with its migrated Cell identity.`);
129461
- }
129462
- rows.set(defaultCellId, {
129463
- id: defaultCellId,
129464
- projectId: row.projectId,
129465
- createdAt: row.createdAt,
129466
- updatedAt: row.updatedAt,
129467
- ...row.mapKey === void 0 ? {} : { mapKey: row.mapKey },
129468
- value: { x: 0, y: 0 }
129469
- });
129470
- packedChildren.set(row.id, [
129471
- ...packedChildren.get(row.id) ?? [],
129472
- defaultCellId
129473
- ]);
129474
- cellId = defaultCellId;
129475
- }
129476
- if (typeof cellId !== "string") {
129477
- throw new Error(`${label} has a non-reference Cell.`);
129478
- }
129479
- rows.set(row.id, {
129480
- ...replaceLiteralValueClass(row, body.assetClassId),
129481
- value: { Cell: cellId }
129482
- });
129483
- changed = true;
129484
- }
129485
- if (!changed) return physical;
129486
- const parent = rows.get(physical.id);
129487
- if (parent === void 0) {
129488
- throw new Error(`Tile migration lost physical value "${physical.id}".`);
129489
- }
129490
- return encodePackedValueRow({
129491
- parent,
129492
- rowsById: rows,
129493
- packedChildIdsByParentId: packedChildren
129494
- });
129495
- }
129496
- var RAW_TILE_PLACEMENT_MIGRATION_ID, RAW_TILE_CLASS_ID, RAW_TILE_RETIRED_RECORD_KEYS, CHANGED_CLASS_IDS, DECLARATION_OWNER_IDS, CHANGED_MEMBER_IDS, CLASS_REFERENCE_KEYS, DECLARATION_KINDS;
129497
- var init_raw_tile_placement_migration = __esm({
129498
- "../src/database/raw-tile-placement-migration.ts"() {
129499
- "use strict";
129500
- init_raw_tile_migration_class_reader();
129501
- init_raw_tile_migration_class_reader();
129502
- init_member_kinds();
129503
- init_member_storage();
129504
- init_member_kind_taxonomy();
129505
- init_members();
129506
- init_packed_value_encoding();
129507
- init_member_value_id();
129508
- init_instance_provenance();
129509
- init_world_system_classes();
129510
- init_canonical_json();
129511
- init_raw_tile_source_rewrite();
129512
- RAW_TILE_PLACEMENT_MIGRATION_ID = "raw-tile-placements-v2";
129513
- RAW_TILE_CLASS_ID = "system_d7fa161b-b269-4bf1-9ec9-3aebec67e6e0";
129514
- RAW_TILE_RETIRED_RECORD_KEYS = [
129515
- { recordKind: "class", recordId: RETIRED_TILE_INSTANCE_CLASS_ID }
129516
- ];
129517
- CHANGED_CLASS_IDS = /* @__PURE__ */ new Set([RAW_TILE_CLASS_ID, PLACEMENT_TILE_CLASS_ID]);
129518
- DECLARATION_OWNER_IDS = /* @__PURE__ */ new Set([
129519
- ...CHANGED_CLASS_IDS,
129520
- "system_c45e7270-954c-4eb5-8cf1-709e877d4d59",
129521
- // NeoTileLayerLink
129522
- "system_f671535d-0eb6-4139-9caf-5c5276febd31"
129523
- // NeoObject
129524
- ]);
129525
- CHANGED_MEMBER_IDS = /* @__PURE__ */ new Set([
129526
- "system_3b02422f-1ef2-4a50-8386-155d5001082b",
129527
- // NeoTile.Name
129528
- "system_cbd6db9a-f473-44b5-b913-7cdc06452f35",
129529
- // NeoTile.Sprite
129530
- "system_96cda8f5-3100-45b5-adcb-0552d21504dd",
129531
- // NeoTile.SmartTile
129532
- "system_f4be2707-74f5-4833-9784-e81bb2474330",
129533
- // NeoTile.Cell
129534
- "system_b0b3c45c-a87d-4218-b056-7418ef46aac5",
129535
- // NeoPlacementTile.Cell
129536
- "system_54ecc5a7-874d-54ed-92f4-38100a4b7465",
129537
- // NeoTile.TryConvert
129538
- "system_5a9ca1f5-a21b-4d4e-8c55-00341af594b4",
129539
- // NeoObject.PlacementTiles
129540
- "system_96c7650a-1805-5b27-ae99-d1e49d3cb207",
129541
- // PlacementTiles entry
129542
- "system_98655d2b-ad0b-45e2-a901-62600b4d3a22",
129543
- // NeoTileLayerLink.Tiles
129544
- "system_843c77b2-9db6-5fe7-94e0-c3edf436b7b1"
129545
- // Tiles entry
129546
- ]);
129547
- CLASS_REFERENCE_KEYS = /* @__PURE__ */ new Set([
129548
- "classId",
129549
- "extendsClassId",
129550
- "ownerClassId",
129551
- "targetClassId"
129552
- ]);
129553
- DECLARATION_KINDS = /* @__PURE__ */ new Set([
129554
- "constructor",
129555
- "interface",
129556
- "migration",
129557
- "dialogue-node",
129558
- "dialogue-group",
129559
- "variant"
129560
- ]);
129561
- }
129562
- });
129563
-
129564
- // ../src/database/raw-tile-placement-ownership.ts
129565
- function rawTileFootprintValueIds(document) {
129566
- const values = [...expandPackedValueRows(document.values)];
129567
- const candidates = new Set(
129568
- values.filter(
129569
- (row) => row.classId == null && typeof row.value === "object" && row.value !== null && !Array.isArray(row.value)
129570
- ).map((row) => row.id)
129571
- );
129572
- const owners = resolveSemanticOwnerMembersForValues(
129573
- { ...document, values },
129574
- candidates
129575
- );
129576
- const result = /* @__PURE__ */ new Set();
129577
- for (const [id2, owner] of owners) {
129578
- if (getField(owner, "id") === RAW_TILE_FOOTPRINT_ENTRY_MEMBER_ID || getField(owner, "classId") === PLACEMENT_TILE_CLASS_ID)
129579
- result.add(id2);
129580
- }
129581
- return result;
129582
- }
129583
- var RAW_TILE_FOOTPRINT_ENTRY_MEMBER_ID;
129584
- var init_raw_tile_placement_ownership = __esm({
129585
- "../src/database/raw-tile-placement-ownership.ts"() {
129586
- "use strict";
129587
- init_raw_tile_placement_migration();
129588
- init_core();
129589
- init_packed_value_encoding();
129590
- init_constructor_argument_ownership();
129591
- RAW_TILE_FOOTPRINT_ENTRY_MEMBER_ID = "system_96c7650a-1805-5b27-ae99-d1e49d3cb207";
129592
- }
129593
- });
129594
-
129595
- // ../src/database/neoscript-compiler-revision-recompile.ts
129596
- function* readRawProjectRecords(rawDocument) {
129597
- for (const recordKind of PROJECT_RECORD_KINDS2) {
129598
- const bucket = rawDocument[PROJECT_RECORD_BUCKETS[recordKind]];
129599
- if (bucket === void 0 || bucket === null) continue;
129600
- if (Array.isArray(bucket)) {
129601
- for (const record6 of bucket) yield rawRecord(recordKind, record6);
129602
- continue;
129603
- }
129604
- yield rawRecord(recordKind, bucket);
129605
- }
129606
- }
129607
- function rawRecord(recordKind, value) {
129608
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
129609
- throw new Error(
129610
- `Project document bucket "${PROJECT_RECORD_BUCKETS[recordKind]}" holds a non-object ${recordKind} record.`
129611
- );
129612
- }
129613
- const record6 = value;
129614
- if (typeof record6.id !== "string") {
129615
- throw new Error(
129616
- `Project document bucket "${PROJECT_RECORD_BUCKETS[recordKind]}" holds a ${recordKind} record without a string id.`
129617
- );
129618
- }
129619
- return { recordKind, recordId: record6.id, record: record6 };
129620
- }
129621
- var NEOSCRIPT_COMPILER_REVISION_RECOMPILE_MAX_BYTES, PROJECT_RECORD_KINDS2;
129622
- var init_neoscript_compiler_revision_recompile = __esm({
129623
- "../src/database/neoscript-compiler-revision-recompile.ts"() {
129624
- "use strict";
129625
- init_projectRecordBuckets();
129626
- init_neoscript_compiler_revision();
129627
- init_project_version_intents();
129628
- init_neo_script_derived_bodies();
129629
- NEOSCRIPT_COMPILER_REVISION_RECOMPILE_MAX_BYTES = 1024 * 1024;
129630
- PROJECT_RECORD_KINDS2 = Object.keys(
129631
- PROJECT_RECORD_BUCKETS
129632
- ).filter(isProjectRecordKind2);
129633
- }
129634
- });
129635
-
129636
- // ../src/database/raw-tile-placement-migration-prepare.ts
129637
- function readRawTileMigrationDocument(rawDocument) {
129638
- return withStoredValueBase(
129639
- readProjectDocument({
129640
- ...rawDocument,
129641
- values: rawDocument.physicalValues ?? rawDocument.values,
129642
- classes: Array.isArray(rawDocument.classes) ? rawDocument.classes.map(rawTileMigrationReadableClass) : rawDocument.classes
129643
- })
129644
- );
129645
- }
129646
- function buildRawTilePlacementMigrationChanges(args) {
129647
- const { document } = args;
129648
- const footprintValueIds = rawTileFootprintValueIds(document);
129649
- const renderMemberIds = rawTileRenderMemberIds(document.members);
129650
- const changes = [];
129651
- const existing = /* @__PURE__ */ new Set();
129652
- for (const { recordKind, recordId, record: record6 } of readRawProjectRecords({
129653
- ...args.rawDocument,
129654
- values: document.physicalValues ?? document.values
129655
- })) {
129656
- existing.add(`${recordKind}:${recordId}`);
129657
- const rewrite = migrateRawTileRetainedRecord({
129658
- recordKind,
129659
- recordId,
129660
- deleted: false,
129661
- data: record6,
129662
- footprintValueIds,
129663
- renderMemberIds
129664
- });
129665
- if (rewrite.kind === "unchanged") continue;
129666
- const operation = rewrite.kind === "retire" ? "delete" : "update";
129667
- changes.push({
129668
- recordKind,
129669
- recordId,
129670
- operation,
129671
- ...rewrite.kind === "rewrite" ? { nextData: rewrite.data } : { deleted: true },
129672
- intent: intent(recordKind, operation)
129673
- });
129674
- }
129675
- const canonical = rawTileCanonicalRecords(document.project.id, args.now);
129676
- for (const member of canonical.members) {
129677
- if (existing.has(`member:${member.id}`)) continue;
129678
- changes.push({
129679
- recordKind: "member",
129680
- recordId: member.id,
129681
- operation: "create",
129682
- nextData: member,
129683
- intent: intent("member", "create")
129684
- });
129685
- }
129686
- return changes;
129687
- }
129688
- function intent(recordKind, operation) {
129689
- const type = `${recordKind}.${operation}`;
129690
- if (!isKnownProjectVersionIntentType(type)) {
129691
- throw new Error(`Raw tile migration cannot publish ${type}.`);
129692
- }
129693
- return createProjectVersionIntent(type, {
129694
- source: RAW_TILE_PLACEMENT_MIGRATION_ID
129695
- });
129696
- }
129697
- var init_raw_tile_placement_migration_prepare = __esm({
129698
- "../src/database/raw-tile-placement-migration-prepare.ts"() {
129699
- "use strict";
129700
- init_raw_tile_migration_class_reader();
129701
- init_raw_tile_render_members();
129702
- init_raw_tile_placement_ownership();
129703
- init_project_document_read();
129704
- init_neoscript_compiler_revision_recompile();
129705
- init_raw_tile_placement_migration();
129706
- init_project_version_intents();
129707
- init_project_version_schema_commit();
129708
- init_project_version_whole_graph_validation();
129709
- }
129710
- });
129711
-
129712
- // src/project-sync/raw-tile-pull-upgrade.ts
129713
- import { readFileSync as readFileSync10 } from "node:fs";
129714
- import { relative as relative6, sep as sep6 } from "node:path";
129715
- function prepareRawTilePullUpgrade(workspace) {
129716
- if (workspace.state.records[`class:${RETIRED_TILE_INSTANCE_CLASS_ID}`] === void 0)
129717
- return null;
129718
- const conflict2 = Object.values(workspace.state.records).find(
129719
- (record6) => record6.conflictServerHash !== void 0
129720
- );
129721
- if (conflict2 !== void 0)
129722
- throw new Error(
129723
- `Resolve the existing pull conflict for ${conflict2.file ?? conflict2.recordId} before upgrading tile sources. Your files and state have not been changed.`
129724
- );
129725
- const rawDocument = pulledProjectDocumentRaw(workspace);
129726
- const changes = buildRawTilePlacementMigrationChanges({
129727
- rawDocument,
129728
- document: readRawTileMigrationDocument(rawDocument),
129729
- now: 0
129730
- });
129731
- const records2 = { ...workspace.state.records };
129732
- const retiredPaths = /* @__PURE__ */ new Set();
129733
- for (const change of changes) {
129734
- const key = `${change.recordKind}:${change.recordId}`;
129735
- if (change.operation === "delete") {
129736
- const path = records2[key]?.file;
129737
- if (path !== void 0) retiredPaths.add(path);
129738
- delete records2[key];
129739
- continue;
129740
- }
129741
- records2[key] = {
129742
- ...records2[key],
129743
- recordKind: change.recordKind,
129744
- recordId: change.recordId,
129745
- contentHash: records2[key]?.contentHash ?? "",
129746
- data: change.nextData
129747
- };
129748
- }
129749
- const migrated = { ...workspace, state: { ...workspace.state, records: records2 } };
129750
- const emission = emitProjectDocumentFilesV4(
129751
- new Map(
129752
- Object.entries(records2).map(([key, record6]) => {
129753
- if (!isProjectRecordKind(record6.recordKind))
129754
- throw new Error(
129755
- `Cannot upgrade unknown record kind ${record6.recordKind}.`
129756
- );
129757
- return [
129758
- key,
129759
- { ...record6, recordKind: record6.recordKind, deleted: false }
129760
- ];
129761
- })
129762
- ),
129763
- {
129764
- recordFiles: readWorkspaceRecordFilesV4(workspace),
129765
- localValues: workspace.state.localValues,
129766
- binaryPaths: workspaceBinaryPathsV4(workspace)
129767
- }
129768
- );
129769
- const changedIds = new Set(changes.map((change) => change.recordId));
129770
- const readonlyMemberIds = /* @__PURE__ */ new Set();
129771
- for (const change of changes) {
129772
- if (change.recordKind === "member" && isRecord11(change.nextData) && change.nextData.mutability === 1 /* ReadOnly */ && change.nextData.storage === 1 /* Immutable */)
129773
- readonlyMemberIds.add(change.recordId);
129774
- }
129775
- const managedClassIds = /* @__PURE__ */ new Set();
129776
- for (const record6 of Object.values(workspace.state.records)) {
129777
- if (record6.recordKind !== "class" || !record6.recordId.startsWith("system_") || !isRecord11(record6.data))
129778
- continue;
129779
- const schema = record6.data.schema;
129780
- if (changedIds.has(record6.recordId) || isRecord11(schema) && Object.values(schema).some(
129781
- (id2) => typeof id2 === "string" && changedIds.has(id2)
129782
- ))
129783
- managedClassIds.add(record6.recordId);
129784
- }
129785
- const baseDeclarations = pulledSystemDeclarations(workspace, managedClassIds);
129786
- const declarations = /* @__PURE__ */ new Map();
129787
- for (const file of emission.files) {
129788
- if (requiredProjectSourceKindV4(file.path, file.content) !== "definition")
129789
- continue;
129790
- const document = parseNeoProjectSource(
129791
- file.content,
129792
- "definition",
129793
- file.path
129794
- );
129795
- const text = lex(file.content).source;
129796
- const slice = (range2) => file.content.slice(text.offsetAt(range2.start), text.offsetAt(range2.end));
129797
- for (const declaration of document.declarations) {
129798
- const id2 = declarationId(declaration);
129799
- if (id2 !== void 0 && managedClassIds.has(id2))
129800
- declarations.set(id2, slice(declaration.range));
129801
- }
129802
- }
129803
- const changedPaths = /* @__PURE__ */ new Set();
129804
- const sources = listProjectSourceFilesV4(workspace.root).map((absolute) => {
129805
- const path = relative6(workspace.root, absolute).split(sep6).join("/");
129806
- const content = readFileSync10(absolute, "utf8");
129807
- const rewritten = rewriteRawTileProjectSource(
129808
- content,
129809
- path,
129810
- declarations,
129811
- baseDeclarations,
129812
- readonlyMemberIds
129813
- );
129814
- if (rewritten !== content) changedPaths.add(path);
129815
- return { path, content: rewritten };
129816
- });
129817
- return { workspace: migrated, sources, changedPaths, retiredPaths };
129818
- }
129819
- function declarationId(value) {
129820
- const text = value.annotations.find((annotation2) => annotation2.name === "id")?.arguments[0]?.text;
129821
- if (text === void 0) return void 0;
129822
- const token = lex(text).tokens[0];
129823
- return typeof token?.value === "string" ? token.value : void 0;
129824
- }
129825
- function rewriteRawTileProjectSource(source, path, declarations = /* @__PURE__ */ new Map(), baseDeclarations = /* @__PURE__ */ new Map(), readonlyMemberIds = /* @__PURE__ */ new Set()) {
129826
- const document = parseNeoProjectSource(
129827
- source,
129828
- requiredProjectSourceKindV4(path, source),
129829
- path
129830
- );
129831
- if (document.diagnostics.length > 0)
129832
- throw new Error(
129833
- `Cannot upgrade ${path}: ${document.diagnostics[0]?.message}`
129834
- );
129835
- const lexical = lex(source);
129836
- const replacements = [];
129837
- const replace = (range2, text) => replacements.push({
129838
- start: lexical.source.offsetAt(range2.start),
129839
- end: lexical.source.offsetAt(range2.end),
129840
- text
129841
- });
129842
- const visit = (node) => {
129843
- if (Array.isArray(node)) {
129844
- for (const child of node) visit(child);
129845
- return;
129846
- }
129847
- if (!isRecord11(node)) return;
129848
- if (typeof node.text === "string" && isRange(node.range)) {
129849
- const text = rewriteRawTileSource(rewriteTileConstructors(node.text));
129850
- if (text !== node.text) replace(node.range, text);
129851
- return;
129852
- }
129853
- if (Array.isArray(node.typeArguments) && isRange(node.nameRange)) {
129854
- if (node.name === "NeoTileInstance") replace(node.nameRange, "NeoTile");
129855
- if (node.name === "NeoObjectPlacementTile")
129856
- replace(node.nameRange, "NeoPlacementTile");
129857
- }
129858
- for (const [key, child] of Object.entries(node)) {
129859
- if (key !== "syntax" && key !== "range" && key !== "sourceText")
129860
- visit(child);
129861
- }
129862
- };
129863
- for (const declaration of document.declarations) {
129864
- const id2 = declarationId(declaration);
129865
- const baseDeclaration = id2 === void 0 ? void 0 : baseDeclarations.get(id2);
129866
- if (baseDeclaration !== void 0) {
129867
- const local = source.slice(
129868
- lexical.source.offsetAt(declaration.range.start),
129869
- lexical.source.offsetAt(declaration.range.end)
129870
- );
129871
- const tokens = (text) => lex(text).tokens.map((token) => token.raw).join("\0");
129872
- if (tokens(local) !== tokens(baseDeclaration))
129873
- throw new Error(
129874
- `Cannot upgrade modified system declaration ${declaration.name} in ${path}. Preserve your edits and restore that declaration to its pulled base before retrying.`
129875
- );
129876
- }
129877
- if (id2 === RETIRED_TILE_INSTANCE_CLASS_ID) {
129878
- replace(declaration.range, "");
129879
- continue;
129880
- }
129881
- const replacement = id2 === void 0 ? void 0 : declarations.get(id2);
129882
- if (replacement !== void 0) {
129883
- replace(declaration.range, replacement);
129884
- continue;
129885
- }
129886
- if (declaration.kind === "class") {
129887
- for (const member of declaration.members) {
129888
- const memberId = declarationId(member);
129889
- if (member.kind === "field" && memberId !== void 0 && readonlyMemberIds.has(memberId)) {
129890
- if (!member.modifiers.includes("readonly"))
129891
- replace(
129892
- { start: member.type.range.start, end: member.type.range.start },
129893
- "readonly "
129894
- );
129895
- const storage = member.annotations.find(
129896
- (annotation2) => annotation2.name === "storage"
129897
- );
129898
- const allowed = storage?.arguments.find(
129899
- (argument2) => argument2.name === "allowed"
129900
- );
129901
- if (allowed !== void 0) {
129902
- if (!/^\.(Immutable|Save|Session)$/.test(allowed.text))
129903
- throw new Error(
129904
- `Cannot upgrade storage on ${member.name} in ${path}: expected a storage enum value.`
129905
- );
129906
- const start = lexical.source.offsetAt(allowed.range.start);
129907
- const end = lexical.source.offsetAt(allowed.range.end);
129908
- const token = lex(source.slice(start, end)).tokens.findLast(
129909
- (token2) => token2.kind === "identifier"
129910
- );
129911
- if (token === void 0)
129912
- throw new Error(
129913
- `Cannot locate storage value on ${member.name} in ${path}.`
129914
- );
129915
- replacements.push({
129916
- start: start + token.start,
129917
- end: start + token.end,
129918
- text: "Immutable"
129919
- });
129920
- } else if (storage !== void 0) {
129921
- const start = lexical.source.offsetAt(storage.range.start);
129922
- const end = lexical.source.offsetAt(storage.range.end);
129923
- const open = lex(source.slice(start, end)).tokens.find(
129924
- (token) => token.text === "("
129925
- );
129926
- if (open === void 0)
129927
- replacements.push({
129928
- start: end,
129929
- end,
129930
- text: "(allowed: .Immutable)"
129931
- });
129932
- else
129933
- replacements.push({
129934
- start: start + open.end,
129935
- end: start + open.end,
129936
- text: `allowed: .Immutable${storage.arguments.length === 0 ? "" : ", "}`
129937
- });
129938
- } else {
129939
- replace(
129940
- { start: member.range.start, end: member.range.start },
129941
- "@storage(allowed: .Immutable) "
129942
- );
129943
- }
129944
- }
129945
- }
129946
- }
129947
- visit(declaration);
129948
- }
129949
- let result = "";
129950
- let cursor = 0;
129951
- for (const replacement of replacements.sort(
129952
- (a, b) => a.start - b.start || b.end - a.end
129953
- )) {
129954
- if (replacement.start < cursor) continue;
129955
- result += source.slice(cursor, replacement.start) + replacement.text;
129956
- cursor = replacement.end;
129957
- }
129958
- return result + source.slice(cursor);
129959
- }
129960
- function rewriteTileConstructors(source) {
129961
- if (!source.includes("@tile")) return source;
129962
- const tokens = lex(source).tokens.filter((token) => token.kind !== "comment");
129963
- const replacements = [];
129964
- for (let index = 0; index < tokens.length; index++) {
129965
- if (tokens[index]?.text !== "@" || tokens[index + 1]?.text !== "tile")
129966
- continue;
129967
- const named = tokens[index + 3]?.text === "asset" && tokens[index + 4]?.text === ":";
129968
- const targetIndex = index + (named ? 5 : 3);
129969
- const target = tokens[targetIndex];
129970
- const close = tokens[targetIndex + 1];
129971
- const constructor2 = tokens[targetIndex + 3];
129972
- if (tokens[index + 2]?.text !== "(") {
129973
- throw new Error("Cannot upgrade @tile without an argument list.");
129974
- }
129975
- if (target?.kind !== "identifier" || close?.text !== ")") {
129976
- throw new Error("Cannot upgrade @tile without one concrete tile class.");
129977
- }
129978
- if (tokens[targetIndex + 2]?.text !== "new" || constructor2?.text !== "NeoTileInstance") {
129979
- throw new Error(
129980
- "Cannot upgrade @tile unless it directly annotates a NeoTileInstance constructor."
129981
- );
129982
- }
129983
- replacements.push({
129984
- start: tokens[index].start,
129985
- end: close.end,
129986
- text: ""
129987
- });
129988
- replacements.push({
129989
- start: constructor2.start,
129990
- end: constructor2.end,
129991
- text: target.text
129992
- });
129993
- }
129994
- let result = "";
129995
- let cursor = 0;
129996
- for (const replacement of replacements) {
129997
- result += source.slice(cursor, replacement.start) + replacement.text;
129998
- cursor = replacement.end;
129999
- }
130000
- return result + source.slice(cursor);
130001
- }
130002
- function isRecord11(value) {
130003
- return typeof value === "object" && value !== null && !Array.isArray(value);
130004
- }
130005
- function isRange(value) {
130006
- if (!isRecord11(value)) return false;
130007
- const position = (entry) => isRecord11(entry) && typeof entry.line === "number" && typeof entry.character === "number";
130008
- return position(value.start) && position(value.end);
130009
- }
130010
- function pulledSystemDeclarations(workspace, selected) {
130011
- const documents = [];
130012
- const retiredWorldKinds = /* @__PURE__ */ new Map();
130013
- for (const record6 of Object.values(workspace.state.records)) {
130014
- if (!isSchemaRecordKindV4(record6.recordKind)) continue;
130015
- let data = record6.data;
130016
- if (record6.recordKind === "class" && isRecord11(data) && isRecord11(data.system)) {
130017
- const world = data.system.worldKind;
130018
- if (world === "tileInstance" || world === "objectPlacementTile") {
130019
- retiredWorldKinds.set(
130020
- record6.recordId,
130021
- world === "tileInstance" ? "TileInstance" : "ObjectPlacementTile"
130022
- );
130023
- data = { ...data, system: { kind: data.system.kind } };
130024
- }
130025
- }
130026
- if (!isRecord11(data))
130027
- throw new Error(
130028
- `Cannot upgrade invalid schema record ${record6.recordId}.`
130029
- );
130030
- documents.push({
130031
- recordKind: record6.recordKind,
130032
- recordId: record6.recordId,
130033
- data
130034
- });
130035
- }
130036
- const result = /* @__PURE__ */ new Map();
130037
- for (const file of emitProjectSourcesV4(
130038
- documentsToProjectSchemaManifest(documents)
130039
- ).files) {
130040
- const id2 = file.recordKeys.find((key) => key.startsWith("class:"))?.slice(6);
130041
- if (id2 === void 0 || !selected.has(id2)) continue;
130042
- const world = retiredWorldKinds.get(id2);
130043
- result.set(
130044
- id2,
130045
- world === void 0 ? file.content : file.content.replace(
130046
- "@system(kind: .WorldAuthoring)",
130047
- `@system(kind: .WorldAuthoring, worldKind: .${world})`
130048
- )
130049
- );
130050
- }
130051
- return result;
130052
- }
130053
- var init_raw_tile_pull_upgrade = __esm({
130054
- "src/project-sync/raw-tile-pull-upgrade.ts"() {
130055
- "use strict";
130056
- init_src();
130057
- init_project2();
130058
- init_member_kinds();
130059
- init_member_storage();
130060
- init_raw_tile_placement_migration_prepare();
130061
- init_raw_tile_placement_migration();
130062
- init_raw_tile_source_rewrite();
130063
- init_server_preparation_preflight();
130064
- init_workspace_status();
130065
- init_project_documents();
130066
- init_project_manifest();
130067
- init_emitter();
130068
- init_source_layout();
130069
- }
130070
- });
130071
-
130072
128718
  // src/commands/pull.ts
130073
128719
  var pull_exports = {};
130074
128720
  __export(pull_exports, {
@@ -130080,7 +128726,7 @@ import {
130080
128726
  writeFileSync as writeFileSync8,
130081
128727
  rmSync as rmSync5,
130082
128728
  existsSync as existsSync8,
130083
- readFileSync as readFileSync11
128729
+ readFileSync as readFileSync10
130084
128730
  } from "node:fs";
130085
128731
  import { dirname as dirname8 } from "node:path";
130086
128732
  async function runPull(workspace, options, progress = spinner("Checking local workspace\u2026")) {
@@ -130089,20 +128735,13 @@ async function runPull(workspace, options, progress = spinner("Checking local wo
130089
128735
  return;
130090
128736
  }
130091
128737
  try {
130092
- const upgrade = options.force ? null : prepareRawTilePullUpgrade(workspace);
130093
- await runNormalPull(
130094
- upgrade?.workspace ?? workspace,
130095
- options,
130096
- progress,
130097
- upgrade
130098
- );
130099
- if (upgrade !== null) workspace.state = upgrade.workspace.state;
128738
+ await runNormalPull(workspace, options, progress);
130100
128739
  } catch (error) {
130101
128740
  progress.fail("Pull failed.");
130102
128741
  throw error;
130103
128742
  }
130104
128743
  }
130105
- async function runNormalPull(workspace, options, progress, upgrade = null) {
128744
+ async function runNormalPull(workspace, options, progress) {
130106
128745
  const destructive = options.force;
130107
128746
  const hasBaseline = Object.keys(workspace.state.records).length > 0;
130108
128747
  if (!destructive && !hasBaseline && listProjectSourceFilesV4(workspace.root).length > 0) {
@@ -130114,7 +128753,7 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
130114
128753
  const hadConflicts = Object.values(workspace.state.records).some(
130115
128754
  (record6) => record6.conflictServerHash !== void 0 || record6.conflictFiles !== void 0 || record6.projectBinary?.conflict !== void 0
130116
128755
  );
130117
- if (upgrade === null && acceptSourceEquivalentConflictBases(workspace, mainLocale) > 0) {
128756
+ if (acceptSourceEquivalentConflictBases(workspace, mainLocale) > 0) {
130118
128757
  writeWorkspaceState(workspace.root, workspace.state);
130119
128758
  }
130120
128759
  let changedRecordKeys = null;
@@ -130122,7 +128761,7 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
130122
128761
  let observedHeadTransactionHash;
130123
128762
  let observedDerivedEdgeVersion;
130124
128763
  let document = null;
130125
- if (!destructive && hasBaseline && upgrade === null) {
128764
+ if (!destructive && hasBaseline) {
130126
128765
  progress.update("Checking remote changes\u2026");
130127
128766
  const cursor = workspace.state.documentRevisionCursor;
130128
128767
  if (cursor !== void 0) {
@@ -130171,12 +128810,7 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
130171
128810
  document = await fetchProjectDocument(workspace);
130172
128811
  nextCursor = document.revision === void 0 ? null : cursorFromRevision(document.revision);
130173
128812
  }
130174
- if (upgrade !== null && document.records.has("class:system_4689bc94-de98-46cd-b220-efe118f4106c")) {
130175
- throw new Error(
130176
- "The server still uses wrapped tiles. Complete the raw tile migration before pulling with this CLI."
130177
- );
130178
- }
130179
- const compilerRefreshKeys = upgrade === null && !destructive && hasBaseline && !hadConflicts && !options.regenerateSourceNames ? compilerMetadataChangedKeys(
128813
+ const compilerRefreshKeys = !destructive && hasBaseline && !hadConflicts && !options.regenerateSourceNames ? compilerMetadataChangedKeys(
130180
128814
  workspace.state.records,
130181
128815
  document,
130182
128816
  changedRecordKeys
@@ -130202,7 +128836,6 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
130202
128836
  let localStatus = null;
130203
128837
  if (hasBaseline && !destructive) {
130204
128838
  const status = computeWorkspaceStatus2(workspace, {
130205
- ...upgrade === null ? {} : { virtualSourceFiles: upgrade.sources },
130206
128839
  onPhase: (label) => progress.update(label)
130207
128840
  });
130208
128841
  localStatus = status;
@@ -130353,9 +128986,6 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
130353
128986
  localStatus,
130354
128987
  destructive,
130355
128988
  regenerateSourceNames: destructive || options.regenerateSourceNames,
130356
- upgradedSourcePaths: upgrade?.changedPaths,
130357
- upgradedSources: upgrade?.sources,
130358
- retiredSourcePaths: upgrade?.retiredPaths,
130359
128989
  changedRecordKeys,
130360
128990
  nextCursor,
130361
128991
  observedHeadTransactionHash,
@@ -130548,12 +129178,6 @@ async function finishFormat4Pull(args) {
130548
129178
  emittedPaths,
130549
129179
  mainLocale: workspaceMainLocale(workspace.state.records)
130550
129180
  });
130551
- const upgradedText = /* @__PURE__ */ new Map();
130552
- for (const source of args.upgradedSources ?? []) {
130553
- if (args.upgradedSourcePaths?.has(source.path) && !rewritePaths.has(source.path))
130554
- upgradedText.set(source.path, source.content);
130555
- }
130556
- for (const path of args.upgradedSourcePaths ?? []) rewritePaths.add(path);
130557
129181
  for (const key of regeneratedRecordKeys) {
130558
129182
  for (const path of localRecordFiles.get(key) ?? []) rewritePaths.add(path);
130559
129183
  }
@@ -130561,7 +129185,7 @@ async function finishFormat4Pull(args) {
130561
129185
  let written = 0;
130562
129186
  for (const path of emittedPaths) {
130563
129187
  const absolute = resolveSourcePath(path);
130564
- const existing = existsSync8(absolute) ? readFileSync11(absolute, "utf8") : null;
129188
+ const existing = existsSync8(absolute) ? readFileSync10(absolute, "utf8") : null;
130565
129189
  const unprojectedConflictKeys = authoredLocalConflictKeysByPath.get(path) ?? [];
130566
129190
  if (unprojectedConflictKeys.length > 0 && existing === null) {
130567
129191
  throw new Error(
@@ -130570,7 +129194,7 @@ async function finishFormat4Pull(args) {
130570
129194
  )}: its prior source file ${JSON.stringify(path)} no longer exists.`
130571
129195
  );
130572
129196
  }
130573
- const local = unprojectedConflictKeys.length > 0 ? existing ?? void 0 : upgradedText.get(path) ?? localByPath.get(path)?.content;
129197
+ const local = unprojectedConflictKeys.length > 0 ? existing ?? void 0 : localByPath.get(path)?.content;
130574
129198
  const server = serverByPath.get(path)?.content;
130575
129199
  const content = conflictPaths.has(path) ? renderConflictFileV4({
130576
129200
  localContent: local,
@@ -130588,10 +129212,7 @@ async function finishFormat4Pull(args) {
130588
129212
  }
130589
129213
  }
130590
129214
  let removed = 0;
130591
- const previousPaths = /* @__PURE__ */ new Set([
130592
- ...recordFiles.values(),
130593
- ...args.retiredSourcePaths ?? []
130594
- ]);
129215
+ const previousPaths = new Set(recordFiles.values());
130595
129216
  for (const state of Object.values(workspace.state.records)) {
130596
129217
  if (state.file !== void 0) previousPaths.add(state.file);
130597
129218
  }
@@ -131010,7 +129631,6 @@ var init_pull = __esm({
131010
129631
  init_static_member_ownership_recovery();
131011
129632
  init_value_base_desync();
131012
129633
  init_compiler_metadata();
131013
- init_raw_tile_pull_upgrade();
131014
129634
  }
131015
129635
  });
131016
129636
 
@@ -131019,7 +129639,7 @@ var init_exports = {};
131019
129639
  __export(init_exports, {
131020
129640
  runInit: () => runInit
131021
129641
  });
131022
- import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as readFileSync12, writeFileSync as writeFileSync9 } from "node:fs";
129642
+ import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as readFileSync11, writeFileSync as writeFileSync9 } from "node:fs";
131023
129643
  import { join as join10, resolve as resolve3 } from "node:path";
131024
129644
  async function runInit(options) {
131025
129645
  let projectId = options.projectId;
@@ -131144,7 +129764,7 @@ async function runInit(options) {
131144
129764
  }
131145
129765
  function ensurePrivateStateIgnored(root) {
131146
129766
  const path = join10(root, ".gitignore");
131147
- const existing = existsSync9(path) ? readFileSync12(path, "utf8") : "";
129767
+ const existing = existsSync9(path) ? readFileSync11(path, "utf8") : "";
131148
129768
  if (existing.split(/\r?\n/u).some((line) => line.trim() === ".neo/" || line.trim() === ".neo")) {
131149
129769
  return;
131150
129770
  }
@@ -132547,7 +131167,7 @@ var init_save_overlay_resolution = __esm({
132547
131167
  });
132548
131168
 
132549
131169
  // src/commands/push-body-diagnostics.ts
132550
- import { existsSync as existsSync10, readFileSync as readFileSync13 } from "node:fs";
131170
+ import { existsSync as existsSync10, readFileSync as readFileSync12 } from "node:fs";
132551
131171
  import { join as join11 } from "node:path";
132552
131172
  function createNeoScriptBodySourceLocator(workspace, status) {
132553
131173
  const textByFile = /* @__PURE__ */ new Map();
@@ -132571,7 +131191,7 @@ function createNeoScriptBodySourceLocator(workspace, status) {
132571
131191
  const cached = textByFile.get(file);
132572
131192
  if (cached !== void 0) return cached;
132573
131193
  const path = join11(workspace.root, file);
132574
- const text = existsSync10(path) ? readFileSync13(path, "utf8") : null;
131194
+ const text = existsSync10(path) ? readFileSync12(path, "utf8") : null;
132575
131195
  textByFile.set(file, text);
132576
131196
  return text;
132577
131197
  }
@@ -132716,7 +131336,7 @@ __export(script_exports, {
132716
131336
  readDocumentArrays: () => readDocumentArrays,
132717
131337
  runScript: () => runScript
132718
131338
  });
132719
- import { readFileSync as readFileSync14 } from "node:fs";
131339
+ import { readFileSync as readFileSync13 } from "node:fs";
132720
131340
  function readDocumentArrays(raw) {
132721
131341
  const arrayOf2 = (field) => {
132722
131342
  const value = raw[field];
@@ -133236,9 +131856,9 @@ function buildRootValue(document, lookups) {
133236
131856
  }
133237
131857
  function readSource(options, fallback) {
133238
131858
  if (options.source !== null) return options.source;
133239
- if (options.file !== null) return readFileSync14(options.file, "utf8");
131859
+ if (options.file !== null) return readFileSync13(options.file, "utf8");
133240
131860
  if (fallback !== void 0) return fallback;
133241
- const stdin = readFileSync14(0, "utf8");
131861
+ const stdin = readFileSync13(0, "utf8");
133242
131862
  if (stdin.trim().length === 0) {
133243
131863
  throw new Error(
133244
131864
  "Provide NeoScript source as an argument, --file, or stdin."
@@ -134311,7 +132931,7 @@ function decodeProjectVersionTransactionResultPage(page) {
134311
132931
  chunk.assignmentsJson,
134312
132932
  `Project transaction "${page.transactionId}" result chunk ${chunk.chunkIndex} assignments`
134313
132933
  );
134314
- if (!isRecord12(chunkAssignments)) {
132934
+ if (!isRecord9(chunkAssignments)) {
134315
132935
  throw new Error(
134316
132936
  `Project transaction "${page.transactionId}" result chunk ${chunk.chunkIndex} assignments are not an object.`
134317
132937
  );
@@ -134343,7 +132963,7 @@ function decodeProjectVersionTransactionResultPage(page) {
134343
132963
  isDone: page.isDone
134344
132964
  };
134345
132965
  }
134346
- function isRecord12(value) {
132966
+ function isRecord9(value) {
134347
132967
  return typeof value === "object" && value !== null && !Array.isArray(value);
134348
132968
  }
134349
132969
  var init_project_version_transaction_result = __esm({
@@ -134505,8 +133125,8 @@ var init_project_source_identity = __esm({
134505
133125
  // src/push-hook.ts
134506
133126
  import { spawn } from "node:child_process";
134507
133127
  import { createHash as createHash9 } from "node:crypto";
134508
- import { existsSync as existsSync11, readFileSync as readFileSync15, readdirSync as readdirSync3 } from "node:fs";
134509
- import { join as join12, relative as relative7, sep as sep7 } from "node:path";
133128
+ import { existsSync as existsSync11, readFileSync as readFileSync14, readdirSync as readdirSync3 } from "node:fs";
133129
+ import { join as join12, relative as relative6, sep as sep6 } from "node:path";
134510
133130
  function fingerprintPushInputs(workspace, options = {}) {
134511
133131
  const paths = /* @__PURE__ */ new Set([
134512
133132
  join12(workspace.root, "neo.json"),
@@ -134527,11 +133147,11 @@ function fingerprintPushInputs(workspace, options = {}) {
134527
133147
  visitManaged(join12(workspace.root, "Files", "AudioClips"));
134528
133148
  const hash = createHash9("sha256");
134529
133149
  for (const path of [...paths].sort()) {
134530
- const name = relative7(workspace.root, path).split(sep7).join("/");
133150
+ const name = relative6(workspace.root, path).split(sep6).join("/");
134531
133151
  hash.update(name);
134532
133152
  hash.update("\0");
134533
133153
  try {
134534
- hash.update(readFileSync15(path));
133154
+ hash.update(readFileSync14(path));
134535
133155
  } catch (error) {
134536
133156
  if (isRecordWithCode(error) && (error.code === "ENOENT" || error.code === "ENOTDIR")) {
134537
133157
  hash.update("<missing>");
@@ -134670,7 +133290,7 @@ var init_push_hook = __esm({
134670
133290
 
134671
133291
  // src/project-source/project-file-push.ts
134672
133292
  import { basename as basename2, join as join13 } from "node:path";
134673
- import { readFileSync as readFileSync16 } from "node:fs";
133293
+ import { readFileSync as readFileSync15 } from "node:fs";
134674
133294
  import { randomUUID as randomUUID2 } from "node:crypto";
134675
133295
  async function cleanupRejectedProjectFilePushesV4(args) {
134676
133296
  if (args.stagedUploadSessionId === null) return;
@@ -134727,7 +133347,7 @@ function prepareProjectFilePushesV4(args) {
134727
133347
  );
134728
133348
  }
134729
133349
  const absolute = join13(args.workspace.root, binary.path);
134730
- const bytes = new Uint8Array(readFileSync16(absolute));
133350
+ const bytes = new Uint8Array(readFileSync15(absolute));
134731
133351
  const digest = sha256Bytes(bytes);
134732
133352
  if (binary.localSha256 !== null && digest !== binary.localSha256) {
134733
133353
  throw new Error(
@@ -135385,10 +134005,10 @@ import {
135385
134005
  writeFileSync as writeFileSync10,
135386
134006
  rmSync as rmSync6,
135387
134007
  existsSync as existsSync12,
135388
- readFileSync as readFileSync17,
134008
+ readFileSync as readFileSync16,
135389
134009
  statSync
135390
134010
  } from "node:fs";
135391
- import { dirname as dirname9, join as join14, relative as relative8, sep as sep8 } from "node:path";
134011
+ import { dirname as dirname9, join as join14, relative as relative7, sep as sep7 } from "node:path";
135392
134012
  function assignPendingIds(changes, authoredValueSeeds, reconstructed3, localInitializerMaterialization) {
135393
134013
  const assigned = /* @__PURE__ */ new Map();
135394
134014
  const assign = (pendingId2) => {
@@ -137453,9 +136073,9 @@ function statusForPushResult(workspace, submitted) {
137453
136073
  for (let index = 0; index < paths.length; index += 1) {
137454
136074
  const path = paths[index];
137455
136075
  const input = snapshot.inputs[index];
137456
- if (input?.uri !== relative8(workspace.root, path).split(sep8).join("/"))
136076
+ if (input?.uri !== relative7(workspace.root, path).split(sep7).join("/"))
137457
136077
  return computeWorkspaceStatus2(workspace);
137458
- if (input.text !== readFileSync17(path, "utf8"))
136078
+ if (input.text !== readFileSync16(path, "utf8"))
137459
136079
  return computeWorkspaceStatus2(workspace);
137460
136080
  }
137461
136081
  const binaries = inspectProjectBinaryStatusV4(
@@ -137679,7 +136299,7 @@ function authoredMemberFormsByFile(root, alternates) {
137679
136299
  let existing = contents.get(alternate.path);
137680
136300
  if (existing === void 0) {
137681
136301
  const absolute = join14(root, alternate.path);
137682
- existing = existsSync12(absolute) ? readFileSync17(absolute, "utf8") : null;
136302
+ existing = existsSync12(absolute) ? readFileSync16(absolute, "utf8") : null;
137683
136303
  contents.set(alternate.path, existing);
137684
136304
  }
137685
136305
  if (existing === null || !existing.includes(alternate.block)) continue;
@@ -137793,7 +136413,7 @@ function rewriteFilesFromState(workspace, records2 = new Map(
137793
136413
  for (const file of files) {
137794
136414
  const absolute = resolveSourcePath(file.path);
137795
136415
  mkdirSync10(dirname9(absolute), { recursive: true });
137796
- const existing = existsSync12(absolute) ? readFileSync17(absolute, "utf8") : null;
136416
+ const existing = existsSync12(absolute) ? readFileSync16(absolute, "utf8") : null;
137797
136417
  if (existing !== file.content)
137798
136418
  writeFileSync10(absolute, file.content, "utf8");
137799
136419
  }
@@ -137837,8 +136457,8 @@ function materializeAssignedSchemaIdsInAuthoredSource(workspace, replacements, p
137837
136457
  }
137838
136458
  if (pendingIdsByUri.size === 0) return /* @__PURE__ */ new Map();
137839
136459
  const inputs = options.sourceSnapshot?.inputs ?? listProjectSourceFilesV4(workspace.root).map((absolutePath) => {
137840
- const uri = relative8(workspace.root, absolutePath).split(sep8).join("/");
137841
- const text = readFileSync17(absolutePath, "utf8");
136460
+ const uri = relative7(workspace.root, absolutePath).split(sep7).join("/");
136461
+ const text = readFileSync16(absolutePath, "utf8");
137842
136462
  const kind = neoProjectSourceKind(uri, text);
137843
136463
  if (kind === null || !isNeoProjectProductionSourceKind(kind)) {
137844
136464
  throw new Error(
@@ -138662,7 +137282,7 @@ var init_registry2 = __esm({
138662
137282
  "schema-contract/registry.mjs"() {
138663
137283
  "use strict";
138664
137284
  PROJECT_SCHEMA_CONTRACT = Object.freeze({
138665
- cliVersion: "0.52.0",
137285
+ cliVersion: "0.52.1",
138666
137286
  projectFileUploadBatchSize: 32,
138667
137287
  documentRecords: {
138668
137288
  member: {
@@ -140090,7 +138710,7 @@ import {
140090
138710
  existsSync as existsSync13,
140091
138711
  mkdirSync as mkdirSync11,
140092
138712
  readdirSync as readdirSync4,
140093
- readFileSync as readFileSync18,
138713
+ readFileSync as readFileSync17,
140094
138714
  realpathSync as realpathSync2,
140095
138715
  renameSync as renameSync5,
140096
138716
  rmSync as rmSync7,
@@ -140102,12 +138722,12 @@ import {
140102
138722
  dirname as dirname10,
140103
138723
  isAbsolute as isAbsolute3,
140104
138724
  join as join15,
140105
- relative as relative9,
138725
+ relative as relative8,
140106
138726
  resolve as resolve4,
140107
- sep as sep9
138727
+ sep as sep8
140108
138728
  } from "node:path";
140109
138729
  import { isDeepStrictEqual } from "node:util";
140110
- function isRecord13(value) {
138730
+ function isRecord10(value) {
140111
138731
  return typeof value === "object" && value !== null && !Array.isArray(value);
140112
138732
  }
140113
138733
  function expectation(actual, negated = false) {
@@ -140118,13 +138738,13 @@ function expectation(actual, negated = false) {
140118
138738
  return value;
140119
138739
  }
140120
138740
  function readExpectation(value) {
140121
- if (!isRecord13(value) || value.__neoExpectation !== true) {
138741
+ if (!isRecord10(value) || value.__neoExpectation !== true) {
140122
138742
  throw new NeoTestAssertionError("Matcher receiver is not an expectation.");
140123
138743
  }
140124
138744
  return value;
140125
138745
  }
140126
138746
  function readMockHandle(value) {
140127
- if (!isRecord13(value) || value.__neoMockHandle !== true || typeof value.mockId !== "number") {
138747
+ if (!isRecord10(value) || value.__neoMockHandle !== true || typeof value.mockId !== "number") {
140128
138748
  throw new NeoTestAssertionError(
140129
138749
  "Mock configuration receiver is not a mock handle."
140130
138750
  );
@@ -140235,13 +138855,13 @@ function errorMessage2(error) {
140235
138855
  return error instanceof Error ? error.message : String(error);
140236
138856
  }
140237
138857
  function findDelegateTargetMemberId(value) {
140238
- return isRecord13(value) && typeof value.memberId === "string" ? value.memberId : null;
138858
+ return isRecord10(value) && typeof value.memberId === "string" ? value.memberId : null;
140239
138859
  }
140240
138860
  function sharedEvaluatorBase(rawDocument) {
140241
138861
  const cached = SHARED_EVALUATOR_BASES.get(rawDocument);
140242
138862
  if (cached !== void 0) return cached;
140243
138863
  const document = readDocumentArrays(rawDocument);
140244
- const constructors = Array.isArray(rawDocument.constructors) ? rawDocument.constructors.filter(isRecord13) : [];
138864
+ const constructors = Array.isArray(rawDocument.constructors) ? rawDocument.constructors.filter(isRecord10) : [];
140245
138865
  const runtime = cliEvaluatorRuntime(
140246
138866
  { ...document, constructors },
140247
138867
  { includeValueGraphIndexes: true }
@@ -140297,21 +138917,21 @@ function preparedHookCandidate(workspace) {
140297
138917
  ".neo",
140298
138918
  "test-build"
140299
138919
  );
140300
- const pathFromRoot = relative9(cacheRoot, directory);
138920
+ const pathFromRoot = relative8(cacheRoot, directory);
140301
138921
  if (isAbsolute3(pathFromRoot)) {
140302
138922
  throw new NeoTestPreparedCandidateError(
140303
138923
  "NEO_PREPARED_BUILD_DIR must not resolve to an absolute path outside this workspace's .neo/test-build directory."
140304
138924
  );
140305
138925
  }
140306
- if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${sep9}`)) {
138926
+ if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${sep8}`)) {
140307
138927
  throw new NeoTestPreparedCandidateError(
140308
138928
  "NEO_PREPARED_BUILD_DIR must resolve inside this workspace's .neo/test-build directory."
140309
138929
  );
140310
138930
  }
140311
138931
  const parsed = JSON.parse(
140312
- readFileSync18(join15(directory, "candidate.json"), "utf8")
138932
+ readFileSync17(join15(directory, "candidate.json"), "utf8")
140313
138933
  );
140314
- if (!isRecord13(parsed)) {
138934
+ if (!isRecord10(parsed)) {
140315
138935
  throw new NeoTestPreparedCandidateError(
140316
138936
  "Configured push hook candidate manifest must be a JSON object."
140317
138937
  );
@@ -140331,7 +138951,7 @@ function preparedHookCandidate(workspace) {
140331
138951
  "Configured push hook candidate inputs no longer match the workspace."
140332
138952
  );
140333
138953
  }
140334
- if (!isRecord13(parsed.document)) {
138954
+ if (!isRecord10(parsed.document)) {
140335
138955
  throw new NeoTestPreparedCandidateError(
140336
138956
  "Configured push hook candidate is missing its project document."
140337
138957
  );
@@ -140379,8 +138999,8 @@ function testCandidateCachePath(workspace, inputFingerprint) {
140379
138999
  function cachedTestCandidate(workspace, inputFingerprint) {
140380
139000
  try {
140381
139001
  const candidatePath = testCandidateCachePath(workspace, inputFingerprint);
140382
- const parsed = JSON.parse(readFileSync18(candidatePath, "utf8"));
140383
- if (!isRecord13(parsed)) return null;
139002
+ const parsed = JSON.parse(readFileSync17(candidatePath, "utf8"));
139003
+ if (!isRecord10(parsed)) return null;
140384
139004
  if (parsed.version !== 1) return null;
140385
139005
  if (parsed.candidateRevision !== TEST_CANDIDATE_CACHE_REVISION) return null;
140386
139006
  if (parsed.cliVersion !== PROJECT_SCHEMA_CONTRACT.cliVersion) return null;
@@ -140390,7 +139010,7 @@ function cachedTestCandidate(workspace, inputFingerprint) {
140390
139010
  return null;
140391
139011
  }
140392
139012
  if (typeof parsed.documentSha256 !== "string") return null;
140393
- const documentJson = readFileSync18(
139013
+ const documentJson = readFileSync17(
140394
139014
  join15(dirname10(candidatePath), "document.json"),
140395
139015
  "utf8"
140396
139016
  );
@@ -140398,7 +139018,7 @@ function cachedTestCandidate(workspace, inputFingerprint) {
140398
139018
  return null;
140399
139019
  }
140400
139020
  const document = JSON.parse(documentJson);
140401
- if (!isRecord13(document)) return null;
139021
+ if (!isRecord10(document)) return null;
140402
139022
  return {
140403
139023
  document,
140404
139024
  sourceHash: parsed.sourceHash,
@@ -140429,8 +139049,8 @@ function cacheTestCandidate(workspace, inputFingerprint, candidate) {
140429
139049
  }
140430
139050
  function compileSpec(workspace, document, absolutePath, projectCompilationHash2) {
140431
139051
  const scriptDocument = readDocumentArrays(document);
140432
- const path = relative9(workspace.root, absolutePath).split(sep9).join("/");
140433
- const source = readFileSync18(absolutePath, "utf8");
139052
+ const path = relative8(workspace.root, absolutePath).split(sep8).join("/");
139053
+ const source = readFileSync17(absolutePath, "utf8");
140434
139054
  const sourceHash = createHash11("sha256").update(source).digest("hex");
140435
139055
  const artifactPath = join15(
140436
139056
  workspace.root,
@@ -140441,8 +139061,8 @@ function compileSpec(workspace, document, absolutePath, projectCompilationHash2)
140441
139061
  `${sourceHash}.json`
140442
139062
  );
140443
139063
  try {
140444
- const cached = JSON.parse(readFileSync18(artifactPath, "utf8"));
140445
- if (isRecord13(cached) && cached.version === 1 && cached.compilerRevision === NEOSCRIPT_COMPILER_REVISION && cached.projectCompilationHash === projectCompilationHash2 && cached.sourceHash === sourceHash && isRecord13(cached.action) && typeof cached.artifactSha256 === "string" && createHash11("sha256").update(JSON.stringify(cached.action)).digest("hex") === cached.artifactSha256 && cached.action.compilerRevision === NEOSCRIPT_COMPILER_REVISION && Array.isArray(cached.action.parameters) && Array.isArray(cached.action.instructions) && isRecord13(cached.action.typeInfo)) {
139064
+ const cached = JSON.parse(readFileSync17(artifactPath, "utf8"));
139065
+ if (isRecord10(cached) && cached.version === 1 && cached.compilerRevision === NEOSCRIPT_COMPILER_REVISION && cached.projectCompilationHash === projectCompilationHash2 && cached.sourceHash === sourceHash && isRecord10(cached.action) && typeof cached.artifactSha256 === "string" && createHash11("sha256").update(JSON.stringify(cached.action)).digest("hex") === cached.artifactSha256 && cached.action.compilerRevision === NEOSCRIPT_COMPILER_REVISION && Array.isArray(cached.action.parameters) && Array.isArray(cached.action.instructions) && isRecord10(cached.action.typeInfo)) {
140446
139066
  return {
140447
139067
  path,
140448
139068
  source,
@@ -140490,7 +139110,7 @@ function selectedSpecPaths(workspace, selectors) {
140490
139110
  const relativePaths = new Map(
140491
139111
  all.map((absolutePath) => [
140492
139112
  absolutePath,
140493
- relative9(workspace.root, absolutePath).split(sep9).join("/")
139113
+ relative8(workspace.root, absolutePath).split(sep8).join("/")
140494
139114
  ])
140495
139115
  );
140496
139116
  const normalizedSelectors = selectors.map(
@@ -140504,16 +139124,16 @@ function selectedSpecPaths(workspace, selectors) {
140504
139124
  );
140505
139125
  }
140506
139126
  const absolute = resolve4(workspace.root, selector);
140507
- const workspaceRelative = relative9(workspace.root, absolute);
140508
- if (workspaceRelative === ".." || workspaceRelative.startsWith(`..${sep9}`)) {
139127
+ const workspaceRelative = relative8(workspace.root, absolute);
139128
+ if (workspaceRelative === ".." || workspaceRelative.startsWith(`..${sep8}`)) {
140509
139129
  throw new Error(
140510
139130
  `Spec selector ${JSON.stringify(selector)} is outside the workspace.`
140511
139131
  );
140512
139132
  }
140513
139133
  if (!existsSync13(absolute)) continue;
140514
139134
  const real = realpathSync2(absolute);
140515
- const realRelative = relative9(workspace.root, real);
140516
- if (realRelative === ".." || realRelative.startsWith(`..${sep9}`)) {
139135
+ const realRelative = relative8(workspace.root, real);
139136
+ if (realRelative === ".." || realRelative.startsWith(`..${sep8}`)) {
140517
139137
  throw new Error(
140518
139138
  `Spec selector ${JSON.stringify(selector)} resolves outside the workspace through a symlink.`
140519
139139
  );
@@ -140523,7 +139143,7 @@ function selectedSpecPaths(workspace, selectors) {
140523
139143
  `Spec selector ${JSON.stringify(selector)} is ignored, private, symlinked, or is not a .spec.neo file.`
140524
139144
  );
140525
139145
  }
140526
- if (statSync2(absolute).isDirectory() && !all.some((path) => path.startsWith(`${absolute}${sep9}`))) {
139146
+ if (statSync2(absolute).isDirectory() && !all.some((path) => path.startsWith(`${absolute}${sep8}`))) {
140527
139147
  throw new Error(
140528
139148
  `Spec selector ${JSON.stringify(selector)} is ignored, private, or contains no eligible .spec.neo files.`
140529
139149
  );
@@ -140606,7 +139226,7 @@ function portableDelegate(value) {
140606
139226
  }
140607
139227
  }
140608
139228
  function callMemberId(value) {
140609
- if (!isRecord13(value) || value.type !== "callFunction") return null;
139229
+ if (!isRecord10(value) || value.type !== "callFunction") return null;
140610
139230
  return typeof value.memberId === "string" ? value.memberId : null;
140611
139231
  }
140612
139232
  function assertNoNestedRegistration(value) {
@@ -140614,7 +139234,7 @@ function assertNoNestedRegistration(value) {
140614
139234
  for (const entry of value) assertNoNestedRegistration(entry);
140615
139235
  return;
140616
139236
  }
140617
- if (!isRecord13(value)) return;
139237
+ if (!isRecord10(value)) return;
140618
139238
  const memberId = callMemberId(value);
140619
139239
  if (memberId !== null && REGISTRATION_IDS.has(memberId)) {
140620
139240
  throw new NeoTestRegistrationError(
@@ -140630,8 +139250,8 @@ function compiledDelegateActions(value) {
140630
139250
  for (const child of entry) visit(child);
140631
139251
  return;
140632
139252
  }
140633
- if (!isRecord13(entry)) return;
140634
- if (isRecord13(entry.action) && Array.isArray(entry.action.instructions) && Array.isArray(entry.action.parameters) && isRecord13(entry.action.typeInfo)) {
139253
+ if (!isRecord10(entry)) return;
139254
+ if (isRecord10(entry.action) && Array.isArray(entry.action.instructions) && Array.isArray(entry.action.parameters) && isRecord10(entry.action.typeInfo)) {
140635
139255
  actions.push(entry.action);
140636
139256
  return;
140637
139257
  }
@@ -140642,7 +139262,7 @@ function compiledDelegateActions(value) {
140642
139262
  }
140643
139263
  function validateRegistrationAction(action, allowRegistration) {
140644
139264
  for (const instruction of action.instructions) {
140645
- const record6 = isRecord13(instruction) ? instruction : null;
139265
+ const record6 = isRecord10(instruction) ? instruction : null;
140646
139266
  const call = record6?.type === "functionCall" ? record6.call : null;
140647
139267
  const memberId = callMemberId(call);
140648
139268
  if (memberId !== null && REGISTRATION_IDS.has(memberId)) {
@@ -140775,8 +139395,8 @@ function mockResponse(environment, mock, selected, call) {
140775
139395
  };
140776
139396
  }
140777
139397
  function partialObjectMatch(actual, expected) {
140778
- if (!isRecord13(expected)) return isDeepStrictEqual(actual, expected);
140779
- if (!isRecord13(actual)) return false;
139398
+ if (!isRecord10(expected)) return isDeepStrictEqual(actual, expected);
139399
+ if (!isRecord10(actual)) return false;
140780
139400
  return Object.entries(expected).every(
140781
139401
  ([key, value]) => partialObjectMatch(actual[key], value)
140782
139402
  );
@@ -140968,7 +139588,7 @@ function interceptTestCallCore(environment, call) {
140968
139588
  const contains2 = typeof actual === "string" ? actual.includes(String(call.args[0])) : Array.isArray(actual) && actual.some((entry) => isDeepStrictEqual(entry, call.args[0]));
140969
139589
  assertMatcher(contains2, expectationValue, "toContain", call.args[0]);
140970
139590
  } else if (call.memberId === NEO_TEST_IDS.toHaveLength) {
140971
- const length = typeof actual === "string" || Array.isArray(actual) ? actual.length : isRecord13(actual) ? Object.keys(actual).length : -1;
139591
+ const length = typeof actual === "string" || Array.isArray(actual) ? actual.length : isRecord10(actual) ? Object.keys(actual).length : -1;
140972
139592
  assertMatcher(
140973
139593
  length === call.args[0],
140974
139594
  expectationValue,
@@ -141059,11 +139679,11 @@ function snapshotEnvironmentDocument(environment) {
141059
139679
  const values = [...baseValues];
141060
139680
  const byId = /* @__PURE__ */ new Map();
141061
139681
  values.forEach((value, index) => {
141062
- if (isRecord13(value) && typeof value.id === "string")
139682
+ if (isRecord10(value) && typeof value.id === "string")
141063
139683
  byId.set(value.id, index);
141064
139684
  });
141065
139685
  const mergeRow = (row) => {
141066
- if (!isRecord13(row) || typeof row.id !== "string") return;
139686
+ if (!isRecord10(row) || typeof row.id !== "string") return;
141067
139687
  const cloned = structuredClone(row);
141068
139688
  const index = byId.get(row.id);
141069
139689
  if (index === void 0) {
@@ -141079,7 +139699,7 @@ function snapshotEnvironmentDocument(environment) {
141079
139699
  if (bindings.size > 0) {
141080
139700
  const baseMembers = Array.isArray(snapshot.members) ? snapshot.members : [];
141081
139701
  snapshot.members = baseMembers.map((member) => {
141082
- if (!isRecord13(member) || typeof member.id !== "string" || !bindings.has(member.id)) {
139702
+ if (!isRecord10(member) || typeof member.id !== "string" || !bindings.has(member.id)) {
141083
139703
  return member;
141084
139704
  }
141085
139705
  return { ...member, valueId: bindings.get(member.id) ?? null };
@@ -141282,13 +139902,13 @@ function maintainNeoTestBuildCache(root, maxBytes = TEST_BUILD_CACHE_LIMIT_BYTES
141282
139902
  const resolvedRoot = resolve4(root);
141283
139903
  const resolvedProtected = protectedDirectory === void 0 ? null : resolve4(protectedDirectory);
141284
139904
  const protectedInsideRoot = resolvedProtected !== null && (() => {
141285
- const fromRoot = relative9(resolvedRoot, resolvedProtected);
141286
- return fromRoot === "" || !fromRoot.startsWith(`..${sep9}`) && fromRoot !== ".." && !isAbsolute3(fromRoot);
139905
+ const fromRoot = relative8(resolvedRoot, resolvedProtected);
139906
+ return fromRoot === "" || !fromRoot.startsWith(`..${sep8}`) && fromRoot !== ".." && !isAbsolute3(fromRoot);
141287
139907
  })();
141288
139908
  const isProtected = (path) => {
141289
139909
  if (!protectedInsideRoot || resolvedProtected === null) return false;
141290
- const fromProtected = relative9(resolvedProtected, resolve4(path));
141291
- return fromProtected === "" || !fromProtected.startsWith(`..${sep9}`) && fromProtected !== ".." && !isAbsolute3(fromProtected);
139910
+ const fromProtected = relative8(resolvedProtected, resolve4(path));
139911
+ return fromProtected === "" || !fromProtected.startsWith(`..${sep8}`) && fromProtected !== ".." && !isAbsolute3(fromProtected);
141292
139912
  };
141293
139913
  for (const file of testBuildFiles(root)) {
141294
139914
  if (!isProtected(file.path) && basename3(file.path).includes(".tmp-") && now - file.modifiedMs >= ABANDONED_TEMP_MAX_AGE_MS) {
@@ -141432,7 +140052,7 @@ async function runTest(workspace, options, dependencies = {}) {
141432
140052
  throw new NeoTestUsageError(errorMessage2(error));
141433
140053
  }
141434
140054
  selectedFiles = selectedPaths.map(
141435
- (path) => relative9(workspace.root, path).split(sep9).join("/")
140055
+ (path) => relative8(workspace.root, path).split(sep8).join("/")
141436
140056
  );
141437
140057
  if (selectedPaths.length === 0 && options.passWithNoTests !== true) {
141438
140058
  throw new NeoTestNoTestsError(
@@ -141680,7 +140300,7 @@ async function inspectNeoTestCompilation(workspace, dependencies = {}) {
141680
140300
  if (candidate.document === null) {
141681
140301
  return {
141682
140302
  files: selectedPaths.map(
141683
- (path) => relative9(workspace.root, path).split(sep9).join("/")
140303
+ (path) => relative8(workspace.root, path).split(sep8).join("/")
141684
140304
  ),
141685
140305
  errors: [
141686
140306
  {
@@ -141701,14 +140321,14 @@ async function inspectNeoTestCompilation(workspace, dependencies = {}) {
141701
140321
  compileSpec(workspace, document, path, compilationHash);
141702
140322
  } catch (error) {
141703
140323
  errors.push({
141704
- file: relative9(workspace.root, path).split(sep9).join("/"),
140324
+ file: relative8(workspace.root, path).split(sep8).join("/"),
141705
140325
  message: errorMessage2(error)
141706
140326
  });
141707
140327
  }
141708
140328
  }
141709
140329
  return {
141710
140330
  files: selectedPaths.map(
141711
- (path) => relative9(workspace.root, path).split(sep9).join("/")
140331
+ (path) => relative8(workspace.root, path).split(sep8).join("/")
141712
140332
  ),
141713
140333
  errors
141714
140334
  };
@@ -141804,9 +140424,9 @@ import {
141804
140424
  constants as fsConstants,
141805
140425
  accessSync,
141806
140426
  existsSync as existsSync14,
141807
- readFileSync as readFileSync19
140427
+ readFileSync as readFileSync18
141808
140428
  } from "node:fs";
141809
- import { extname as extname2, isAbsolute as isAbsolute4, join as join16, relative as relative10, sep as sep10 } from "node:path";
140429
+ import { extname as extname2, isAbsolute as isAbsolute4, join as join16, relative as relative9, sep as sep9 } from "node:path";
141810
140430
  function inspectNeoDoctor(workspace) {
141811
140431
  const formatCompatible = workspace.config.formatVersion === CURRENT_FORMAT_VERSION;
141812
140432
  const compiler = inspectCompilerContract();
@@ -141889,7 +140509,7 @@ function inspectSourceContract(workspace) {
141889
140509
  );
141890
140510
  try {
141891
140511
  const inputs = files.map((file, index) => {
141892
- const text = readFileSync19(file, "utf8");
140512
+ const text = readFileSync18(file, "utf8");
141893
140513
  return {
141894
140514
  uri: relativeFiles[index],
141895
140515
  kind: requiredProjectSourceKindV4(relativeFiles[index], text),
@@ -141937,7 +140557,7 @@ function inspectExtensionContract(root) {
141937
140557
  };
141938
140558
  }
141939
140559
  try {
141940
- const value = JSON.parse(readFileSync19(cachePath, "utf8"));
140560
+ const value = JSON.parse(readFileSync18(cachePath, "utf8"));
141941
140561
  assertProjectSourceAnalysisV4(value);
141942
140562
  return {
141943
140563
  id: NEO_VSCODE_EXTENSION_ID,
@@ -142028,7 +140648,7 @@ function canAccess(path, mode) {
142028
140648
  }
142029
140649
  }
142030
140650
  function workspacePath(root, path) {
142031
- return relative10(root, path).split(sep10).join("/");
140651
+ return relative9(root, path).split(sep9).join("/");
142032
140652
  }
142033
140653
  function errorMessage3(error) {
142034
140654
  return error instanceof Error ? error.message : String(error);
@@ -142335,8 +140955,8 @@ __export(migrate_exports, {
142335
140955
  runMigrate: () => runMigrate
142336
140956
  });
142337
140957
  import { randomUUID as randomUUID5 } from "node:crypto";
142338
- import { existsSync as existsSync15, mkdirSync as mkdirSync12, readFileSync as readFileSync20, writeFileSync as writeFileSync12 } from "node:fs";
142339
- import { join as join17, relative as relative11 } from "node:path";
140958
+ import { existsSync as existsSync15, mkdirSync as mkdirSync12, readFileSync as readFileSync19, writeFileSync as writeFileSync12 } from "node:fs";
140959
+ import { join as join17, relative as relative10 } from "node:path";
142340
140960
  async function runMigrate(workspace, subcommand, positional, targetRef, json, dependencies = {}) {
142341
140961
  if (subcommand === "new") {
142342
140962
  const name = positional[0];
@@ -142349,11 +140969,11 @@ async function runMigrate(workspace, subcommand, positional, targetRef, json, de
142349
140969
  mkdirSync12(migrationsDir, { recursive: true });
142350
140970
  let nextOrder = 1;
142351
140971
  for (const path of listProjectSourceFilesV4(workspace.root)) {
142352
- const source = readFileSync20(path, "utf8");
140972
+ const source = readFileSync19(path, "utf8");
142353
140973
  if (neoProjectSourceKind(path, source) !== "migration") continue;
142354
140974
  const migration = parseMigrationFile(
142355
140975
  source,
142356
- relative11(workspace.root, path),
140976
+ relative10(workspace.root, path),
142357
140977
  /* @__PURE__ */ new Map()
142358
140978
  );
142359
140979
  nextOrder = Math.max(nextOrder, Number(migration.fileFields.order) + 1);
@@ -144534,7 +143154,7 @@ __export(content_exports, {
144534
143154
  makeContentContext: () => makeContentContext,
144535
143155
  runLoc: () => runLoc
144536
143156
  });
144537
- import { readFileSync as readFileSync21 } from "node:fs";
143157
+ import { readFileSync as readFileSync20 } from "node:fs";
144538
143158
  import { randomUUID as randomUUID6 } from "node:crypto";
144539
143159
  function versionPath2(workspace, suffix) {
144540
143160
  return `/api/projects/${workspace.config.projectId}/versions/${workspace.config.versionId}/${suffix}`;
@@ -144542,9 +143162,9 @@ function versionPath2(workspace, suffix) {
144542
143162
  function readBatch(file) {
144543
143163
  let raw = null;
144544
143164
  if (file !== null) {
144545
- raw = readFileSync21(file, "utf8");
143165
+ raw = readFileSync20(file, "utf8");
144546
143166
  } else if (!process.stdin.isTTY) {
144547
- raw = readFileSync21(0, "utf8");
143167
+ raw = readFileSync20(0, "utf8");
144548
143168
  if (raw.trim().length === 0) raw = null;
144549
143169
  }
144550
143170
  if (raw === null) return null;
@@ -145792,7 +144412,7 @@ import { createHash as createHash12 } from "node:crypto";
145792
144412
  import {
145793
144413
  existsSync as existsSync16,
145794
144414
  mkdirSync as mkdirSync13,
145795
- readFileSync as readFileSync22,
144415
+ readFileSync as readFileSync21,
145796
144416
  unlinkSync,
145797
144417
  writeFileSync as writeFileSync13
145798
144418
  } from "node:fs";
@@ -145805,7 +144425,7 @@ function validatePath(path) {
145805
144425
  }
145806
144426
  function readManifest(path) {
145807
144427
  if (!existsSync16(path)) return null;
145808
- const data = JSON.parse(readFileSync22(path, "utf8"));
144428
+ const data = JSON.parse(readFileSync21(path, "utf8"));
145809
144429
  if (data === null || typeof data !== "object" || !("schemaVersion" in data) || data.schemaVersion !== 1)
145810
144430
  throw new Error(`Invalid generated-file manifest version: ${path}`);
145811
144431
  if (!("files" in data) || !Array.isArray(data.files) || data.files.length === 0)
@@ -145885,7 +144505,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
145885
144505
  const meta = join18(directory, old.path + ".meta");
145886
144506
  operations.push([
145887
144507
  path + ".meta",
145888
- existsSync16(meta) ? readFileSync22(meta, "utf8") : null
144508
+ existsSync16(meta) ? readFileSync21(meta, "utf8") : null
145889
144509
  ]);
145890
144510
  }
145891
144511
  operations.push([path, file.content]);
@@ -145912,7 +144532,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
145912
144532
  if (!previous.has(key))
145913
144533
  previous.set(key, {
145914
144534
  path,
145915
- content: existsSync16(path) ? readFileSync22(path, "utf8") : null
144535
+ content: existsSync16(path) ? readFileSync21(path, "utf8") : null
145916
144536
  });
145917
144537
  }
145918
144538
  const write = (path, content) => {
@@ -145926,7 +144546,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
145926
144546
  const changed = [];
145927
144547
  try {
145928
144548
  for (const [path, content] of operations) {
145929
- const current = existsSync16(path) ? readFileSync22(path, "utf8") : null;
144549
+ const current = existsSync16(path) ? readFileSync21(path, "utf8") : null;
145930
144550
  if (current === content) continue;
145931
144551
  changed.push(path);
145932
144552
  write(path, content);
@@ -145939,7 +144559,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
145939
144559
  restored.add(key);
145940
144560
  const original = previous.get(key);
145941
144561
  if (original.path !== path && existsSync16(path)) unlinkSync(path);
145942
- const current = existsSync16(original.path) ? readFileSync22(original.path, "utf8") : null;
144562
+ const current = existsSync16(original.path) ? readFileSync21(original.path, "utf8") : null;
145943
144563
  if (current !== original.content) write(original.path, original.content);
145944
144564
  }
145945
144565
  throw error;
@@ -146180,8 +144800,8 @@ __export(resolve_exports, {
146180
144800
  resolveMarkers: () => resolveMarkers,
146181
144801
  runResolve: () => runResolve
146182
144802
  });
146183
- import { readFileSync as readFileSync23, rmSync as rmSync8, writeFileSync as writeFileSync15 } from "node:fs";
146184
- import { join as join21, relative as relative12 } from "node:path";
144803
+ import { readFileSync as readFileSync22, rmSync as rmSync8, writeFileSync as writeFileSync15 } from "node:fs";
144804
+ import { join as join21, relative as relative11 } from "node:path";
146185
144805
  function runResolve(workspace, side) {
146186
144806
  const marked = readMarkedProjectSourcesV4(workspace.root);
146187
144807
  assertRecordConflictsResolveTogetherV4(
@@ -146204,7 +144824,7 @@ function runResolve(workspace, side) {
146204
144824
  if (conflict2.remoteSha256 !== null && conflict2.artifactPath !== void 0) {
146205
144825
  writeVerifiedBinaryDownloadV4(
146206
144826
  destination,
146207
- readFileSync23(join21(workspace.root, conflict2.artifactPath)),
144827
+ readFileSync22(join21(workspace.root, conflict2.artifactPath)),
146208
144828
  conflict2.remoteSha256
146209
144829
  );
146210
144830
  binary.sha256 = conflict2.remoteSha256;
@@ -146233,10 +144853,10 @@ function runResolve(workspace, side) {
146233
144853
  function readMarkedProjectSourcesV4(root) {
146234
144854
  const files = [];
146235
144855
  for (const absolutePath of listProjectSourceFilesV4(root)) {
146236
- const source = readFileSync23(absolutePath, "utf8");
144856
+ const source = readFileSync22(absolutePath, "utf8");
146237
144857
  if (detectConflictMarkers(source) === null) continue;
146238
144858
  files.push({
146239
- path: normalizeWorkspaceSourcePath(relative12(root, absolutePath)),
144859
+ path: normalizeWorkspaceSourcePath(relative11(root, absolutePath)),
146240
144860
  absolutePath,
146241
144861
  source
146242
144862
  });
@@ -146533,7 +145153,7 @@ There is no --keep-current: preserving current semantic state defines flatten.
146533
145153
  async function main() {
146534
145154
  const args = parseArgs(process.argv.slice(2));
146535
145155
  if (args.command === "--version") {
146536
- console.log("0.52.0");
145156
+ console.log("0.52.1");
146537
145157
  return;
146538
145158
  }
146539
145159
  if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {