@neocompose/cli 0.22.5 → 0.22.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.22.7] - 2026-08-05
4
+
5
+ ### Fixed
6
+
7
+ - Pull and reset cache canonical required-constructor calls reconstructed from
8
+ legacy materialized rows that predate durable constructor arguments.
9
+ - A pull followed by status or push remains a semantic no-op for projected
10
+ animation track and generic segment-frame rows, while later constructor edits
11
+ are still detected normally.
12
+
13
+ ## [0.22.6] - 2026-08-05
14
+
15
+ ### Fixed
16
+
17
+ - Normal pull ignores compiler-derived NeoScript body differences and clears
18
+ stale conflict bookkeeping when authored source already matches Production.
19
+ - Required-constructor replay compiles nested generic initializer rows without
20
+ mutating authored source payloads, including immutable animation defaults.
21
+ - Large constructor replays reuse project indexes and an immutable persisted
22
+ snapshot, keeping Neowyn push dry-runs in seconds rather than minutes.
23
+
3
24
  ## [0.22.5] - 2026-08-04
4
25
 
5
26
  ### Fixed
package/dist/neo.mjs CHANGED
@@ -40934,7 +40934,11 @@ function evaluateLiteralContainer(args) {
40934
40934
  `Cannot materialize member "${args.member.name}": its value is a NeoScript initializer, which this builder cannot evaluate. Supply an initEvaluator.`
40935
40935
  );
40936
40936
  }
40937
- const evaluated = args.initEvaluator(args.member, body.init);
40937
+ const evaluated = args.initEvaluator(
40938
+ args.member,
40939
+ body.init,
40940
+ args.sourceValueId
40941
+ );
40938
40942
  return {
40939
40943
  literal: {
40940
40944
  value: evaluated.value,
@@ -41292,7 +41296,8 @@ function cloneDefaultValueForMember(args) {
41292
41296
  const evaluated = evaluateLiteralContainer({
41293
41297
  body: sourceValue,
41294
41298
  member,
41295
- initEvaluator: args.initEvaluator
41299
+ initEvaluator: args.initEvaluator,
41300
+ sourceValueId: args.sourceValueId
41296
41301
  });
41297
41302
  if (evaluated === void 0) {
41298
41303
  throw new Error(
@@ -54223,14 +54228,18 @@ var init_NSGetterRuntimeError = __esm({
54223
54228
  }
54224
54229
  };
54225
54230
  UncompiledInitializerRuntimeError = class extends NSGetterRuntimeError {
54226
- constructor(memberId, memberName) {
54231
+ constructor(memberId, memberName, initializer = null, valueId = null) {
54227
54232
  super(
54228
54233
  `Initializer for '${memberName}' has no compiled body; push the project so the server compiles it.`
54229
54234
  );
54230
54235
  this.memberId = memberId;
54236
+ this.initializer = initializer;
54237
+ this.valueId = valueId;
54231
54238
  this.name = "UncompiledInitializerRuntimeError";
54232
54239
  }
54233
54240
  memberId;
54241
+ initializer;
54242
+ valueId;
54234
54243
  };
54235
54244
  }
54236
54245
  });
@@ -55356,6 +55365,14 @@ function trackedRowForValueReference(value, ctx) {
55356
55365
  const indexes = evaluatorIndexes(ctx);
55357
55366
  return indexes.rowByValueReference.get(value) ?? indexes.baseRowByValueReference?.get(value) ?? null;
55358
55367
  }
55368
+ function assertStoredReplayMutableValue(value, ctx, label) {
55369
+ if (ctx.storedConstructionReplay !== true) return;
55370
+ const row = trackedRowForValueReference(value, ctx);
55371
+ if (row === null || ctx.__runtimeSessionValues?.has(row.id) === true) return;
55372
+ throw new NSGetterRuntimeError(
55373
+ `Stored construction replay cannot mutate persisted ${label}.`
55374
+ );
55375
+ }
55359
55376
  function pushConstructionFrame(ctx, label) {
55360
55377
  const state = ctx.__executionState;
55361
55378
  if (state === void 0) {
@@ -55520,7 +55537,7 @@ function withEvaluationRuntime(ctx, writes) {
55520
55537
  if (ctx.__runtimeSessionValues !== void 0 && ctx.__executionState !== void 0 && ctx.__valueOverlay !== void 0) {
55521
55538
  return ctx;
55522
55539
  }
55523
- const overlay = ctx.__valueOverlay ?? buildValueOverlay(ctx.vm);
55540
+ const overlay = ctx.__valueOverlay ?? (ctx.storedConstructionReplay === true ? /* @__PURE__ */ new Map() : buildValueOverlay(ctx.vm));
55524
55541
  const referenceRemap = ctx.__runtimeReferenceRemap ?? /* @__PURE__ */ new Map();
55525
55542
  const runtimeReferences = runtimeSessionValueReferences(
55526
55543
  ctx.__runtimeSessionValues
@@ -56528,6 +56545,11 @@ function evalInstructions(instructions, scope, ctx, options) {
56528
56545
  }
56529
56546
  function applyOverlayAssignment(target, targetTypeInfo, value, scope, ctx) {
56530
56547
  if (target.type === "staticMember" /* staticMember */) {
56548
+ if (ctx.storedConstructionReplay === true) {
56549
+ throw new NSGetterRuntimeError(
56550
+ "Stored construction replay cannot assign persisted static values."
56551
+ );
56552
+ }
56531
56553
  applyOverlayStaticAssignment(target.memberId, value, ctx);
56532
56554
  return;
56533
56555
  }
@@ -56537,6 +56559,7 @@ function applyOverlayAssignment(target, targetTypeInfo, value, scope, ctx) {
56537
56559
  );
56538
56560
  }
56539
56561
  const receiver = evalPointer(target.keyOf.pointer, scope, ctx);
56562
+ assertStoredReplayMutableValue(receiver, ctx, "assignment target");
56540
56563
  const key = evalPointer(target.keyOf.key, scope, ctx);
56541
56564
  const referenceValueId = targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 6 /* List */ || targetTypeInfo.type === 5 /* Dictionary */ ? findKnownRowIdByValueReference(value, ctx) : null;
56542
56565
  if (Array.isArray(receiver)) {
@@ -56845,6 +56868,11 @@ function resolveCompiledSetter(memberId, ctx) {
56845
56868
  }
56846
56869
  function evalCollectionMutationInstruction(ins, scope, ctx, options) {
56847
56870
  if (ins.target.pointer.type === "staticMember" /* staticMember */) {
56871
+ if (ctx.storedConstructionReplay === true) {
56872
+ throw new NSGetterRuntimeError(
56873
+ "Stored construction replay cannot mutate persisted static collections."
56874
+ );
56875
+ }
56848
56876
  const member = evalMemberById(ctx.vm, ins.target.pointer.memberId);
56849
56877
  if (member === null) {
56850
56878
  throw new NSGetterRuntimeError(
@@ -56854,6 +56882,13 @@ function evalCollectionMutationInstruction(ins, scope, ctx, options) {
56854
56882
  writableStaticBindingMap(member, ctx);
56855
56883
  }
56856
56884
  const targetValue = evalPointer(ins.target.pointer, scope, ctx);
56885
+ if (ins.target.pointer.type !== "variable" /* variable */) {
56886
+ assertStoredReplayMutableValue(
56887
+ targetValue,
56888
+ ctx,
56889
+ "collection mutation target"
56890
+ );
56891
+ }
56857
56892
  const args = ins.args.map((arg) => evalPointer(arg, scope, ctx));
56858
56893
  const isLookupSet = ins.target.typeInfo.type === 9 /* Lookup */;
56859
56894
  if (ins.mutation === "Add" /* Add */) {
@@ -59089,7 +59124,7 @@ function validateClassConstructorDescriptor(info, ctx, requireEveryRequiredField
59089
59124
  `Cannot construct abstract Class '${schemaClass2.name}'.`
59090
59125
  );
59091
59126
  }
59092
- const replaySlot = ctx.__storedConstructionReplaySlot;
59127
+ const replaySlot = ctx.__storedConstructionReplayNestedSlots?.toReversed().find((slot) => slot.classId === classId) ?? ctx.__storedConstructionReplaySlot;
59093
59128
  const classArguments2 = replaySlot?.classId === classId ? replaySlot.classArguments : void 0;
59094
59129
  const instanceEnv = resolveInstanceEnv(
59095
59130
  classId,
@@ -59938,9 +59973,41 @@ function constructionInitEvaluator(ctx, createdValues, argumentScopes, construct
59938
59973
  }
59939
59974
  return null;
59940
59975
  };
59941
- return (member, init) => {
59976
+ return (member, init, sourceValueId) => {
59977
+ const evaluate = (argumentValues = []) => {
59978
+ if (ctx.storedConstructionReplay !== true || !isMemberClassBase(member) || Object.keys(member.classArguments ?? {}).length === 0) {
59979
+ return evaluateInitializerInContext(
59980
+ init,
59981
+ member,
59982
+ ctx,
59983
+ createdValues,
59984
+ argumentValues,
59985
+ sourceValueId ?? null
59986
+ );
59987
+ }
59988
+ const previousSlots = ctx.__storedConstructionReplayNestedSlots;
59989
+ ctx.__storedConstructionReplayNestedSlots = [
59990
+ ...previousSlots ?? [],
59991
+ {
59992
+ classId: member.classId,
59993
+ classArguments: member.classArguments ?? {}
59994
+ }
59995
+ ];
59996
+ try {
59997
+ return evaluateInitializerInContext(
59998
+ init,
59999
+ member,
60000
+ ctx,
60001
+ createdValues,
60002
+ argumentValues,
60003
+ sourceValueId ?? null
60004
+ );
60005
+ } finally {
60006
+ ctx.__storedConstructionReplayNestedSlots = previousSlots;
60007
+ }
60008
+ };
59942
60009
  if (init.compiled === void 0) {
59943
- return evaluateInitializerInContext(init, member, ctx, createdValues);
60010
+ return evaluate();
59944
60011
  }
59945
60012
  const memberId = Reflect.get(member, "id");
59946
60013
  const scopeMemberId = indexes.initializerScopeMemberIds.get(init) ?? (typeof memberId === "string" ? memberId : "");
@@ -59952,12 +60019,12 @@ function constructionInitEvaluator(ctx, createdValues, argumentScopes, construct
59952
60019
  `Member initializer '${member.name}' has ${expectedArgumentCount} constructor parameter(s), but its declaring class scope could not be resolved.`
59953
60020
  );
59954
60021
  }
59955
- return evaluateInitializerInContext(init, member, ctx, createdValues);
60022
+ return evaluate();
59956
60023
  }
59957
60024
  const scopedArguments = argumentScopes.valuesByClassId.get(ownerClassId);
59958
60025
  if (scopedArguments === void 0) {
59959
60026
  if (expectedArgumentCount === 0) {
59960
- return evaluateInitializerInContext(init, member, ctx, createdValues);
60027
+ return evaluate();
59961
60028
  }
59962
60029
  if (argumentScopes.missingScopeReason === "no-constructor") {
59963
60030
  throw new NSGetterRuntimeError(
@@ -59973,13 +60040,7 @@ function constructionInitEvaluator(ctx, createdValues, argumentScopes, construct
59973
60040
  `Member initializer '${member.name}' on '${ownerClassId}' expected ${expectedArgumentCount} constructor argument(s), got ${scopedArguments.length}.`
59974
60041
  );
59975
60042
  }
59976
- return evaluateInitializerInContext(
59977
- init,
59978
- member,
59979
- ctx,
59980
- createdValues,
59981
- scopedArguments
59982
- );
60043
+ return evaluate(scopedArguments);
59983
60044
  };
59984
60045
  }
59985
60046
  function constructorInitializerIndexes(ctx) {
@@ -60094,14 +60155,16 @@ function runtimeValueReferencesVariable(value, variableId, visited = /* @__PURE_
60094
60155
  (child) => runtimeValueReferencesVariable(child, variableId, visited)
60095
60156
  );
60096
60157
  }
60097
- function evaluateInitializerInContext(init, member, ctx, createdValues, argumentValues = []) {
60158
+ function evaluateInitializerInContext(init, member, ctx, createdValues, argumentValues = [], sourceValueId = null) {
60098
60159
  ctx.__constructedArgumentsByValue ??= /* @__PURE__ */ new WeakMap();
60099
60160
  const compiled = init.compiled;
60100
60161
  if (compiled === void 0) {
60101
60162
  const memberId = Reflect.get(member, "id");
60102
60163
  throw new UncompiledInitializerRuntimeError(
60103
60164
  typeof memberId === "string" ? memberId : null,
60104
- member.name
60165
+ member.name,
60166
+ init,
60167
+ sourceValueId
60105
60168
  );
60106
60169
  }
60107
60170
  const closeFrame = pushConstructionFrame(ctx, `${member.name} initializer`);
@@ -61547,7 +61610,8 @@ function evaluateMemberInitializer(args) {
61547
61610
  if (compiled === void 0) {
61548
61611
  throw new UncompiledInitializerRuntimeError(
61549
61612
  typeof Reflect.get(args.member, "id") === "string" ? Reflect.get(args.member, "id") : null,
61550
- args.member.name
61613
+ args.member.name,
61614
+ args.init
61551
61615
  );
61552
61616
  }
61553
61617
  const ctx = {
@@ -69864,14 +69928,16 @@ function materializedInitializerReconciliationFailuresV4(args) {
69864
69928
  [...args.reconciliations.values()].map((entry) => [entry.valueId, entry])
69865
69929
  );
69866
69930
  const candidateValueIds = new Set(
69867
- [...reconciliationByValueId.values()].filter((reconciliation) => reconciliation.storedConstructorArgs !== null).map((reconciliation) => reconciliation.valueId)
69931
+ [...reconciliationByValueId.values()].filter(
69932
+ (reconciliation) => reconciliation.storedConstructorArgs !== null || reconciliation.requiresCanonicalConstruction === true
69933
+ ).map((reconciliation) => reconciliation.valueId)
69868
69934
  );
69869
69935
  const candidateOwners = resolveOwnerMembersForValues(
69870
69936
  document,
69871
69937
  candidateValueIds
69872
69938
  );
69873
69939
  const currentRecords = reconciliationRecords(args.workspace, []);
69874
- const cachedExpressions = readMaterializedConstructionBuildCacheV1(
69940
+ const cachedExpressions = args.useBuildCaches === false ? null : readMaterializedConstructionBuildCacheV1(
69875
69941
  args.workspace.root,
69876
69942
  args.workspace.state
69877
69943
  );
@@ -69895,28 +69961,60 @@ function materializedInitializerReconciliationFailuresV4(args) {
69895
69961
  )) {
69896
69962
  canonicalExpressions.set(valueId, expression);
69897
69963
  }
69898
- writeMaterializedConstructionBuildCacheV1(
69899
- args.workspace.root,
69900
- args.workspace.state,
69901
- canonicalExpressions
69902
- );
69964
+ if (args.useBuildCaches !== false) {
69965
+ writeMaterializedConstructionBuildCacheV1(
69966
+ args.workspace.root,
69967
+ args.workspace.state,
69968
+ canonicalExpressions
69969
+ );
69970
+ }
69903
69971
  }
69904
69972
  }
69973
+ const authoredConstructionChangedByValueId = /* @__PURE__ */ new Map();
69905
69974
  const replayableValueIds = /* @__PURE__ */ new Set();
69906
69975
  for (const valueId of candidateValueIds) {
69907
69976
  const reconciliation = reconciliationByValueId.get(valueId);
69908
69977
  const owner = candidateOwners.get(valueId);
69909
69978
  if (reconciliation === void 0 || owner === void 0) continue;
69910
- const authoredConstructionChanged = args.manifest !== void 0 && canonicalExpressions.get(valueId) !== constructorExpressionSlice(reconciliation.code);
69911
- if (authoredConstructionChanged || recompileTargets.valueIds.has(valueId)) {
69979
+ const canonicalExpression = canonicalExpressions.get(valueId);
69980
+ if (args.manifest !== void 0 && canonicalExpression === void 0) {
69981
+ throw new Error(
69982
+ `Cannot reconcile stored construction for value "${valueId}": its canonical pulled constructor expression is unavailable.`
69983
+ );
69984
+ }
69985
+ const authoredConstructionChanged = args.manifest !== void 0 && canonicalExpression !== constructorExpressionSlice(reconciliation.code);
69986
+ authoredConstructionChangedByValueId.set(
69987
+ valueId,
69988
+ authoredConstructionChanged
69989
+ );
69990
+ if (reconciliation.storedConstructorArgs !== null && (authoredConstructionChanged || recompileTargets.valueIds.has(valueId))) {
69912
69991
  replayableValueIds.add(valueId);
69913
69992
  }
69914
69993
  }
69915
69994
  const owners = resolveOwnerMembersForValues(document, replayableValueIds);
69916
- const compilationProject = replayableValueIds.size === 0 ? void 0 : loadOrBuildNeoScriptProjectV1(args.workspace.root, document);
69995
+ const compilationProject = replayableValueIds.size === 0 ? void 0 : args.useBuildCaches === false ? createNeoScriptCompilationProject(document) : loadOrBuildNeoScriptProjectV1(args.workspace.root, document);
69917
69996
  const failures = [];
69918
69997
  for (const reconciliation of args.reconciliations.values()) {
69919
- if (reconciliation.storedConstructorArgs === null) continue;
69998
+ if (reconciliation.storedConstructorArgs === null) {
69999
+ if (reconciliation.requiresCanonicalConstruction !== true) continue;
70000
+ if (authoredConstructionChangedByValueId.get(reconciliation.valueId) !== true) {
70001
+ continue;
70002
+ }
70003
+ const position2 = composeReferenceSitePosition(
70004
+ reconciliation.site,
70005
+ args.sourceTextByUri
70006
+ );
70007
+ failures.push(
70008
+ new SchemaSourceError(
70009
+ `construction-arguments-conflict: Value "${reconciliation.valueId}" is already materialized without durable constructor arguments, and this construction no longer matches its pulled canonical projection. Delete and recreate the value to change its construction.`,
70010
+ position2.file,
70011
+ position2.line,
70012
+ position2.column,
70013
+ "construction-arguments-conflict"
70014
+ )
70015
+ );
70016
+ continue;
70017
+ }
69920
70018
  if (!replayableValueIds.has(reconciliation.valueId)) continue;
69921
70019
  const owner = owners.get(reconciliation.valueId);
69922
70020
  if (owner === void 0) {
@@ -70253,6 +70351,7 @@ var init_local_initializer_materialization = __esm({
70253
70351
  init_value_row_owner_members();
70254
70352
  init_neo_script_recompile_scope();
70255
70353
  init_neoscript_build_cache();
70354
+ init_compiler_adapter();
70256
70355
  }
70257
70356
  });
70258
70357
 
@@ -70458,7 +70557,12 @@ function computeWorkspaceStatus(workspace, options) {
70458
70557
  seeds: /* @__PURE__ */ new Map()
70459
70558
  };
70460
70559
  let projectAnalysisV4 = null;
70461
- const valueLowerRegistry = createValueLowerRegistryV4();
70560
+ const valueLowerRegistry = createValueLowerRegistryV4({
70561
+ materializedConstructorExpressions: options.useBuildCaches === false ? /* @__PURE__ */ new Map() : readMaterializedConstructionBuildCacheV1(
70562
+ workspace.root,
70563
+ workspace.state
70564
+ ) ?? /* @__PURE__ */ new Map()
70565
+ });
70462
70566
  try {
70463
70567
  if (!baseManifest) {
70464
70568
  throw new Error(
@@ -70891,6 +70995,7 @@ function computeWorkspaceStatus(workspace, options) {
70891
70995
  reconciliations: valueLowerRegistry.initializerReconciliations,
70892
70996
  manifest,
70893
70997
  forceRecompile: options.forceRecompile,
70998
+ useBuildCaches: options.useBuildCaches,
70894
70999
  sourceTextByUri: new Map(
70895
71000
  sourceEntries.map((entry) => [entry.relPath, entry.source])
70896
71001
  )
@@ -70961,13 +71066,15 @@ function computeWorkspaceStatus(workspace, options) {
70961
71066
  parseErrors.push(new SchemaSourceError(message, "<project-files>", 1, 1));
70962
71067
  }
70963
71068
  try {
71069
+ const animationRecords = prospectiveAnimationRecords(
71070
+ workspace.state.records,
71071
+ reconstructed3,
71072
+ changes,
71073
+ authoredValueSeeds
71074
+ );
70964
71075
  validateProspectiveAnimationRecordsV4(
70965
- prospectiveAnimationRecords(
70966
- workspace.state.records,
70967
- reconstructed3,
70968
- changes,
70969
- authoredValueSeeds
70970
- )
71076
+ animationRecords,
71077
+ animationRecordsFromState(workspace.state.records)
70971
71078
  );
70972
71079
  } catch (error) {
70973
71080
  parseErrors.push(
@@ -71035,17 +71142,19 @@ function computeWorkspaceStatus(workspace, options) {
71035
71142
  )
71036
71143
  };
71037
71144
  }
71038
- function validateProspectiveAnimationRecordsV4(records2) {
71145
+ function validateProspectiveAnimationRecordsV4(records2, fallbackRecords = []) {
71039
71146
  const candidates = [...records2];
71040
71147
  const document = prospectiveAnimationDocumentV4(candidates);
71041
71148
  if (document === null) return;
71149
+ const fallbackDocument = prospectiveAnimationDocumentV4(fallbackRecords);
71042
71150
  const replayed = replayAnimationDeclarationInitializersV4(
71043
71151
  candidates,
71044
- document
71152
+ document,
71153
+ fallbackDocument
71045
71154
  );
71046
71155
  assertAnimationClipDocumentValid(replayed);
71047
71156
  }
71048
- function replayAnimationDeclarationInitializersV4(records2, document) {
71157
+ function replayAnimationDeclarationInitializersV4(records2, document, fallbackDocument) {
71049
71158
  const initializers = document.values.flatMap((row) => {
71050
71159
  const init = Reflect.get(row, "init");
71051
71160
  return isObjectRecord2(init) && typeof init.code === "string" ? [{ row, code: init.code }] : [];
@@ -71072,7 +71181,24 @@ function replayAnimationDeclarationInitializersV4(records2, document) {
71072
71181
  data: record3.data
71073
71182
  });
71074
71183
  }
71075
- const values = new Map(document.values.map((row) => [row.id, row]));
71184
+ const replayDocument = readPulledProjectDocumentV4(pulled);
71185
+ const compilationProject = createNeoScriptCompilationProject({
71186
+ project: replayDocument.project,
71187
+ projectFiles: replayDocument.projectFiles,
71188
+ members: replayDocument.members,
71189
+ classes: replayDocument.classes,
71190
+ enums: replayDocument.enums,
71191
+ interfaces: replayDocument.interfaces,
71192
+ constructors: replayDocument.constructors ?? []
71193
+ });
71194
+ let documentBodiesCompiled = false;
71195
+ const fallbackValues = new Map(
71196
+ (fallbackDocument?.values ?? []).map((row) => [row.id, row])
71197
+ );
71198
+ const values = new Map([
71199
+ ...fallbackValues,
71200
+ ...document.values.map((row) => [row.id, row])
71201
+ ]);
71076
71202
  for (const { row, code } of initializers) {
71077
71203
  if (rootKinds.get(row.id) !== "declaration") continue;
71078
71204
  const owner = owners.get(row.id);
@@ -71085,26 +71211,34 @@ function replayAnimationDeclarationInitializersV4(records2, document) {
71085
71211
  const rootOwner = rootOwners.get(row.id);
71086
71212
  const rootOwnerId = Reflect.get(rootOwner ?? {}, "id");
71087
71213
  const initializerOwnerClass = typeof rootOwnerId !== "string" ? null : findSchemaPlacement(rootOwnerId, document.classes)?.ownerClass ?? null;
71214
+ const evaluate = initializerOwnerClass?.requiredConstructorId === void 0 || initializerOwnerClass.requiredConstructorId === null;
71088
71215
  let replay;
71089
71216
  try {
71090
71217
  replay = replayStoredConstructionV4({
71091
71218
  records: pulled,
71219
+ document: replayDocument,
71092
71220
  valueId: row.id,
71093
71221
  code,
71094
71222
  member: owner,
71095
- compileDocumentBodies: true,
71223
+ compileDocumentBodies: !documentBodiesCompiled,
71224
+ compilationProject,
71096
71225
  initializerOwnerClass,
71097
71226
  // A parameterized declaration is a template. Its arguments exist only
71098
71227
  // at concrete construction sites, so validate the authored body here
71099
71228
  // without fabricating values for the class header parameters.
71100
- evaluate: initializerOwnerClass?.requiredConstructorId === void 0 || initializerOwnerClass.requiredConstructorId === null
71229
+ evaluate
71101
71230
  });
71231
+ documentBodiesCompiled = true;
71102
71232
  } catch (error) {
71103
71233
  throw new Error(
71104
71234
  `Animation declaration replay failed for value "${row.id}": ${error instanceof Error ? error.message : String(error)}`,
71105
71235
  { cause: error }
71106
71236
  );
71107
71237
  }
71238
+ if (!evaluate) {
71239
+ const fallback = fallbackValues.get(row.id);
71240
+ if (fallback !== void 0) values.set(row.id, fallback);
71241
+ }
71108
71242
  for (const [id2, value] of replay) {
71109
71243
  if (!isMemberValue(value)) {
71110
71244
  throw new Error(
@@ -71116,6 +71250,12 @@ function replayAnimationDeclarationInitializersV4(records2, document) {
71116
71250
  }
71117
71251
  return { ...document, values: [...values.values()] };
71118
71252
  }
71253
+ function animationRecordsFromState(records2) {
71254
+ return Object.values(records2).flatMap((record3) => {
71255
+ const data = record3.conflictServerHash !== void 0 && isObjectRecord2(record3.conflictServerData) ? record3.conflictServerData : record3.data;
71256
+ return isObjectRecord2(data) ? [{ recordKind: record3.recordKind, data }] : [];
71257
+ });
71258
+ }
71119
71259
  function classBelongsToAnimationFamily(classes, classId) {
71120
71260
  const classesById = new Map(
71121
71261
  classes.map((schemaClass2) => [schemaClass2.id, schemaClass2])
@@ -71489,6 +71629,8 @@ var init_workspace_status_core = __esm({
71489
71629
  init_local_initializer_materialization();
71490
71630
  init_push_change_intent();
71491
71631
  init_initializer_replay();
71632
+ init_compiler_adapter();
71633
+ init_materialized_construction_cache();
71492
71634
  IGNORED_SCHEMA_DIRECTORIES = /* @__PURE__ */ new Set([
71493
71635
  ".git",
71494
71636
  ".neo",
@@ -71539,6 +71681,7 @@ function verifyProjectSourceCommitAgainstStateV4(args) {
71539
71681
  }
71540
71682
  const status = computeWorkspaceStatus(workspace, {
71541
71683
  skipProjectBinaryInspection: true,
71684
+ useBuildCaches: false,
71542
71685
  writeProjectAnalysisCache: () => void 0,
71543
71686
  trustedPendingProjectFiles,
71544
71687
  virtualSourceFiles: args.files,
@@ -75076,13 +75219,14 @@ function materializePreparedInstanceInitializers(args) {
75076
75219
  `Value "${valueId}" carries an initializer but no instance ownership path resolves its declared member.`
75077
75220
  );
75078
75221
  }
75222
+ const existingRoot = existingValueById.get(valueId);
75223
+ const existingConstructedRoot = existingRoot !== void 0 && isLiteralValueContent(existingRoot) && (typeof existingRoot.classId === "string" || existingRoot.constructorArgs !== void 0 && existingRoot.constructorArgs !== null);
75079
75224
  const materialized = materializeInitializerValue({
75080
75225
  document: compiledDocument,
75081
75226
  member,
75082
- row: site.row
75227
+ row: site.row,
75228
+ ...existingConstructedRoot ? { storedConstructionReplay: true } : {}
75083
75229
  });
75084
- const existingRoot = existingValueById.get(valueId);
75085
- const existingConstructedRoot = existingRoot !== void 0 && isLiteralValueContent(existingRoot) && (typeof existingRoot.classId === "string" || existingRoot.constructorArgs !== void 0 && existingRoot.constructorArgs !== null);
75086
75230
  if (existingConstructedRoot) {
75087
75231
  if (!isLiteralValueContent(materialized.root) || existingRoot.classId !== materialized.root.classId || !replayedCreationDataMatches({
75088
75232
  currentDocument: args.document,
@@ -77266,6 +77410,9 @@ function prepareServerOwnedValueInitializerBodies(args) {
77266
77410
  void 0,
77267
77411
  rootOwnerByValueId
77268
77412
  );
77413
+ const currentValueById = new Map(
77414
+ args.document.values.map((value) => [value.id, value])
77415
+ );
77269
77416
  const compileOne = (document, row) => {
77270
77417
  const member = ownerByValueId.get(row.id);
77271
77418
  if (member === void 0) {
@@ -77273,6 +77420,8 @@ function prepareServerOwnedValueInitializerBodies(args) {
77273
77420
  `Value "${row.id}" carries an initializer but no member in this project version stores it, so its declared type is unknown.`
77274
77421
  );
77275
77422
  }
77423
+ const currentValue = currentValueById.get(row.id);
77424
+ const replaysStoredConstruction = isLiteralValueContent(currentValue) && (typeof currentValue.classId === "string" || currentValue.constructorArgs !== void 0);
77276
77425
  compileValueRowInitializerBody({
77277
77426
  project: document.project,
77278
77427
  projectFiles: document.projectFiles,
@@ -77287,7 +77436,8 @@ function prepareServerOwnedValueInitializerBodies(args) {
77287
77436
  initializerOwnerClass: findSchemaPlacement(
77288
77437
  rootOwnerByValueId.get(row.id)?.id ?? "",
77289
77438
  document.classes
77290
- )?.ownerClass ?? null
77439
+ )?.ownerClass ?? null,
77440
+ ...replaysStoredConstruction ? { storedConstructionReplay: true } : {}
77291
77441
  });
77292
77442
  };
77293
77443
  for (const [index, row] of explicitRows) {
@@ -81330,8 +81480,22 @@ var init_server_preparation_preflight = __esm({
81330
81480
  // src/project-source/initializer-replay.ts
81331
81481
  function replayStoredConstructionV4(args) {
81332
81482
  const document = args.document ?? readPulledProjectDocumentV4(args.records);
81483
+ const compilationProject = args.compilationProject ?? (args.compileDocumentBodies === true ? createNeoScriptCompilationProject({
81484
+ project: document.project,
81485
+ projectFiles: document.projectFiles,
81486
+ members: document.members,
81487
+ classes: document.classes,
81488
+ enums: document.enums,
81489
+ interfaces: document.interfaces,
81490
+ constructors: document.constructors ?? []
81491
+ }) : void 0);
81333
81492
  if (args.compileDocumentBodies === true) {
81334
- compilePulledProjectDocumentBodiesV4(document);
81493
+ if (compilationProject === void 0) {
81494
+ throw new Error(
81495
+ "Construction replay cannot compile document bodies without a compiler project."
81496
+ );
81497
+ }
81498
+ compilePulledProjectDocumentBodiesV4(document, compilationProject);
81335
81499
  }
81336
81500
  const root = document.values.find((value) => value.id === args.valueId);
81337
81501
  if (root === void 0) {
@@ -81384,7 +81548,7 @@ function replayStoredConstructionV4(args) {
81384
81548
  // header parameters that are in lexical scope at their source site.
81385
81549
  initializerOwnerClass: args.initializerOwnerClass ?? null,
81386
81550
  storedConstructionReplay: true,
81387
- ...args.compilationProject === void 0 ? {} : { compilationProject: args.compilationProject }
81551
+ ...compilationProject === void 0 ? {} : { compilationProject }
81388
81552
  });
81389
81553
  if (!isMemberValue(candidate) || !isInitValueContent(candidate)) {
81390
81554
  throw new Error(
@@ -81407,15 +81571,24 @@ function replayStoredConstructionV4(args) {
81407
81571
  });
81408
81572
  break;
81409
81573
  } catch (error) {
81410
- if (!(error instanceof UncompiledInitializerRuntimeError) || error.memberId === null || compiledDependencies.has(error.memberId)) {
81574
+ const dependencyKey = error instanceof UncompiledInitializerRuntimeError && error.valueId !== null ? error.valueId : error instanceof UncompiledInitializerRuntimeError && error.initializer !== null ? error.initializer : error instanceof UncompiledInitializerRuntimeError ? error.memberId : null;
81575
+ if (!(error instanceof UncompiledInitializerRuntimeError) || error.memberId === null || dependencyKey === null || compiledDependencies.has(dependencyKey)) {
81411
81576
  throw error;
81412
81577
  }
81413
- compilePulledMemberInitializerBodyV4(
81414
- document,
81415
- error.memberId,
81416
- args.compilationProject
81417
- );
81418
- compiledDependencies.add(error.memberId);
81578
+ if (error.valueId !== null) {
81579
+ compilePulledValueInitializerBodyV4(
81580
+ document,
81581
+ error.valueId,
81582
+ compilationProject
81583
+ );
81584
+ } else {
81585
+ compilePulledMemberInitializerBodyV4(
81586
+ document,
81587
+ error.memberId,
81588
+ compilationProject
81589
+ );
81590
+ }
81591
+ compiledDependencies.add(dependencyKey);
81419
81592
  }
81420
81593
  }
81421
81594
  return new Map(
@@ -81425,7 +81598,55 @@ function replayStoredConstructionV4(args) {
81425
81598
  ])
81426
81599
  );
81427
81600
  }
81428
- function compilePulledProjectDocumentBodiesV4(document) {
81601
+ function valueInitializerCompilationSites(document) {
81602
+ const cached = pulledValueInitializerCompilationSites.get(document);
81603
+ if (cached !== void 0) return cached;
81604
+ const rows = document.values.filter(isInitValueContent);
81605
+ const rootOwners = /* @__PURE__ */ new Map();
81606
+ const owners = resolveOwnerMembersForValues(
81607
+ document,
81608
+ new Set(rows.map((row) => row.id)),
81609
+ void 0,
81610
+ rootOwners
81611
+ );
81612
+ const sites = /* @__PURE__ */ new Map();
81613
+ for (const row of rows) {
81614
+ const member = owners.get(row.id);
81615
+ if (member === void 0) continue;
81616
+ const rootOwnerId = Reflect.get(rootOwners.get(row.id) ?? {}, "id");
81617
+ sites.set(row.id, {
81618
+ row,
81619
+ member,
81620
+ ownerClass: typeof rootOwnerId !== "string" ? null : findSchemaPlacement(rootOwnerId, document.classes)?.ownerClass ?? null
81621
+ });
81622
+ }
81623
+ pulledValueInitializerCompilationSites.set(document, sites);
81624
+ return sites;
81625
+ }
81626
+ function compilePulledValueInitializerBodyV4(document, valueId, compilationProject) {
81627
+ const site = valueInitializerCompilationSites(document).get(valueId);
81628
+ if (site === void 0) {
81629
+ throw new Error(
81630
+ "Cannot compile initializer dependency because its source value row is unresolved."
81631
+ );
81632
+ }
81633
+ compileValueRowInitializerBody({
81634
+ project: document.project,
81635
+ projectFiles: document.projectFiles,
81636
+ members: document.members,
81637
+ classes: document.classes,
81638
+ enums: document.enums,
81639
+ interfaces: document.interfaces,
81640
+ constructors: document.constructors ?? [],
81641
+ member: site.member,
81642
+ valueRow: site.row,
81643
+ valueId: String(Reflect.get(site.row, "id")),
81644
+ initializerOwnerClass: site.ownerClass,
81645
+ storedConstructionReplay: true,
81646
+ ...compilationProject === void 0 ? {} : { compilationProject }
81647
+ });
81648
+ }
81649
+ function compilePulledProjectDocumentBodiesV4(document, compilationProject) {
81429
81650
  const compileArgs = {
81430
81651
  project: document.project,
81431
81652
  projectFiles: document.projectFiles,
@@ -81433,7 +81654,8 @@ function compilePulledProjectDocumentBodiesV4(document) {
81433
81654
  classes: document.classes,
81434
81655
  enums: document.enums,
81435
81656
  interfaces: document.interfaces,
81436
- constructors: document.constructors ?? []
81657
+ constructors: document.constructors ?? [],
81658
+ compilationProject
81437
81659
  };
81438
81660
  for (const constructor2 of compileArgs.constructors) {
81439
81661
  compileConstructorRecord({ ...compileArgs, constructor: constructor2 });
@@ -81492,7 +81714,10 @@ function compilePulledMemberInitializerBodyV4(document, memberId, compilationPro
81492
81714
  }
81493
81715
  function readPulledProjectDocumentV4(records2) {
81494
81716
  return readProjectDocument(
81495
- pulledProjectDocumentRaw(replayWorkspace(records2)),
81717
+ // Replay compilation mutates authored `init` envelopes with transient IR.
81718
+ // Keep that evaluator-local: the input records are also the source commit
81719
+ // payload, where compiled bodies are deliberately absent.
81720
+ structuredClone(pulledProjectDocumentRaw(replayWorkspace(records2))),
81496
81721
  { constructors: "authored-or-compiled" }
81497
81722
  );
81498
81723
  }
@@ -81523,6 +81748,7 @@ function replayWorkspace(records2) {
81523
81748
  state: { records: stateRecords }
81524
81749
  };
81525
81750
  }
81751
+ var pulledValueInitializerCompilationSites;
81526
81752
  var init_initializer_replay = __esm({
81527
81753
  "src/project-source/initializer-replay.ts"() {
81528
81754
  "use strict";
@@ -81530,11 +81756,14 @@ var init_initializer_replay = __esm({
81530
81756
  init_compile_ns_property();
81531
81757
  init_init_backed_value_materialization();
81532
81758
  init_value_row_owner_members();
81759
+ init_inheritance();
81533
81760
  init_project_document_read();
81534
81761
  init_server_preparation_preflight();
81535
81762
  init_projection();
81536
81763
  init_constructors2();
81537
81764
  init_neoscript_evaluator();
81765
+ init_compiler_adapter();
81766
+ pulledValueInitializerCompilationSites = /* @__PURE__ */ new WeakMap();
81538
81767
  }
81539
81768
  });
81540
81769
 
@@ -81677,11 +81906,20 @@ function emitStoredConstructorExpression(context, member, valueId) {
81677
81906
  value,
81678
81907
  instanceGenericEnvironment(context, classId, resolvedMember, void 0)
81679
81908
  );
81680
- const targetValueIds = animationConstructorProjectionTargetValueIds(
81909
+ if (!isObjectRecord2(value.value)) {
81910
+ throw new Error(
81911
+ `Stored materialized value ${valueId} has no Class body to project.`
81912
+ );
81913
+ }
81914
+ const hasStoredConstruction = isObjectRecord2(value.constructorArgs);
81915
+ const projection = hasStoredConstruction ? null : constructorProjectionSource(
81681
81916
  context,
81682
81917
  classId,
81683
- value
81918
+ value.value,
81919
+ /* @__PURE__ */ new Set([valueId]),
81920
+ storedEnvironment
81684
81921
  );
81922
+ const targetValueIds = projection?.targetValueIds ?? animationConstructorProjectionTargetValueIds(context, classId, value);
81685
81923
  const environment = inferAnimationChildOverrideEmitEnvironment(
81686
81924
  context,
81687
81925
  classId,
@@ -81703,12 +81941,13 @@ function emitStoredConstructorExpression(context, member, valueId) {
81703
81941
  /* @__PURE__ */ new Set([valueId]),
81704
81942
  false
81705
81943
  );
81706
- if (constructor2 === null) {
81944
+ if (constructor2 !== null) return constructor2;
81945
+ if (projection === null || projection.arguments.length === 0 && schemaClass2.requiredConstructorId === void 0) {
81707
81946
  throw new Error(
81708
81947
  `Stored materialized value ${valueId} has no constructor arguments.`
81709
81948
  );
81710
81949
  }
81711
- return constructor2;
81950
+ return projection.arguments.length === 0 ? `new ${className}()` : constructorCallSource(`new ${className}`, projection.arguments);
81712
81951
  }
81713
81952
  function animationConstructorProjectionTargetValueIds(context, classId, value) {
81714
81953
  if (context.manifestClasses.get(classId)?.system?.worldKind !== "animationChildOverride" || !isObjectRecord2(value.value)) {
@@ -81849,8 +82088,9 @@ function qualifiedProjectFileSymbolsV4(records2) {
81849
82088
  }
81850
82089
  return result;
81851
82090
  }
81852
- function createValueLowerRegistryV4() {
82091
+ function createValueLowerRegistryV4(options = {}) {
81853
82092
  return {
82093
+ materializedConstructorExpressions: options.materializedConstructorExpressions ?? /* @__PURE__ */ new Map(),
81854
82094
  pendingValues: /* @__PURE__ */ new Map(),
81855
82095
  pendingLocalizedTexts: /* @__PURE__ */ new Map(),
81856
82096
  pendingBindingMembersByClassId: /* @__PURE__ */ new Map(),
@@ -81954,7 +82194,8 @@ function buildValueLowerContext(state, manifest, options = {}) {
81954
82194
  referenceObligations: registry.referenceObligations,
81955
82195
  loweringFailures: registry.loweringFailures,
81956
82196
  pendingValueIdentitySites: registry.pendingValueIdentitySites,
81957
- initializerReconciliations: registry.initializerReconciliations
82197
+ initializerReconciliations: registry.initializerReconciliations,
82198
+ materializedConstructorExpressions: registry.materializedConstructorExpressions
81958
82199
  };
81959
82200
  }
81960
82201
  function indexMemberOverrides(members) {
@@ -83399,20 +83640,28 @@ function lowerValueRow(context, member, sourceExpression, expectedValueId, sourc
83399
83640
  }
83400
83641
  indexInitAuthoredRowIds(context, code, source.label);
83401
83642
  const storedConstructorArgs = isObjectRecord2(base.constructorArgs) ? base.constructorArgs : null;
83402
- const materializedPlainClass = resolvedMember.kind === "class" && isObjectRecord2(base.value) && context.classes.get(
83643
+ const materializedClass = resolvedMember.kind === "class" && isObjectRecord2(base.value);
83644
+ const materializedPlainClass = materializedClass && context.classes.get(
83403
83645
  typeof base.classId === "string" ? base.classId : resolvedMember.classId
83404
83646
  )?.requiredConstructorId === void 0;
83405
- if (storedConstructorArgs !== null || materializedPlainClass) {
83647
+ const requiresCanonicalConstruction = storedConstructorArgs === null && materializedClass && !materializedPlainClass;
83648
+ const canonicalConstruction = context.materializedConstructorExpressions.get(expectedValueId);
83649
+ const authoredConstruction = constructorExpressionSlice(code);
83650
+ const canonicalConstructionMatches = canonicalConstruction !== void 0 && canonicalConstruction === authoredConstruction;
83651
+ const canonicalConstructionMissing = requiresCanonicalConstruction && canonicalConstruction === void 0;
83652
+ const preserveRequiredStoredConstruction = requiresCanonicalConstruction && source.purpose === "stored";
83653
+ if (storedConstructorArgs !== null || materializedPlainClass || canonicalConstructionMatches || canonicalConstructionMissing || preserveRequiredStoredConstruction) {
83406
83654
  if (resolvedMember.kind !== "class") {
83407
83655
  throw new Error(
83408
83656
  `Value ${expectedValueId} stores constructor arguments but its declared member ${resolvedMember.name} is not a Class.`
83409
83657
  );
83410
83658
  }
83411
- if (source.purpose === "stored") {
83659
+ if (source.purpose === "stored" || canonicalConstructionMissing) {
83412
83660
  context.initializerReconciliations.set(expectedValueId, {
83413
83661
  valueId: expectedValueId,
83414
83662
  code,
83415
83663
  storedConstructorArgs: storedConstructorArgs === null ? null : structuredClone(storedConstructorArgs),
83664
+ ...requiresCanonicalConstruction ? { requiresCanonicalConstruction: true } : {},
83416
83665
  settleFields: expression.kind === "new" ? (expression.initializer ?? []).map(
83417
83666
  (assignment) => assignment.name
83418
83667
  ) : [],
@@ -85590,9 +85839,6 @@ function classValue(context, member, value, visited, targetTyped, outerEnvironme
85590
85839
  { cause: error }
85591
85840
  );
85592
85841
  }
85593
- if (storedConstruction !== null && typeof value.id === "string") {
85594
- context.materializedConstructors.set(value.id, storedConstruction);
85595
- }
85596
85842
  const replayConstruction = storedConstruction === null ? null : storedConstructorCallSource(
85597
85843
  context,
85598
85844
  schemaClass2,
@@ -85671,6 +85917,9 @@ ${fields.map((field) => indentNeoSourceNonEmptyLines(field, 2)).join(",\n")}
85671
85917
  }`;
85672
85918
  }
85673
85919
  const constructor2 = storedConstruction !== null ? storedConstruction : projection.arguments.length > 0 ? constructorCallSource(`new ${name}`, projection.arguments) : targetTyped ? "new()" : `new ${name}()`;
85920
+ if (typeof value.id === "string" && (storedConstruction !== null || projection.arguments.length > 0 || schemaClass2.requiredConstructorId !== void 0)) {
85921
+ context.materializedConstructors.set(value.id, constructor2);
85922
+ }
85674
85923
  return fields.length === 0 ? constructor2 : `${storedConstruction !== null || projection.arguments.length > 0 ? constructor2 : targetTyped ? "new()" : `new ${name}`} {
85675
85924
  ${fields.map((field) => indentNeoSourceNonEmptyLines(field, 2)).join(",\n")}
85676
85925
  }`;
@@ -86506,16 +86755,22 @@ function instanceGenericEnvironment(context, classId, member, outerEnvironment)
86506
86755
  const bindings = classGenericBindings(context.manifestClasses, classId);
86507
86756
  const memberId = stringField3(member, "id");
86508
86757
  const manifestMember = context.manifestMembers.get(memberId);
86509
- if (manifestMember?.kind === "class") {
86510
- for (const [genericParamId, argument2] of Object.entries(
86511
- manifestMember.classArguments
86758
+ const rawClassArguments = isObjectRecord2(member.classArguments) ? member.classArguments : null;
86759
+ const classArguments2 = rawClassArguments ?? (manifestMember?.kind === "class" ? manifestMember.classArguments : null);
86760
+ if (classArguments2 !== null) {
86761
+ for (const [genericParamId, rawArgument] of Object.entries(
86762
+ classArguments2
86512
86763
  )) {
86764
+ const argument2 = isObjectRecord2(rawArgument) ? rawArgument : null;
86513
86765
  if (bindings.get(genericParamId)?.kind === "member") continue;
86514
- if (argument2.kind === "member") {
86515
- bindings.set(genericParamId, argument2);
86766
+ if (argument2?.kind === "member" && typeof argument2.memberId === "string") {
86767
+ bindings.set(genericParamId, {
86768
+ kind: "member",
86769
+ memberId: argument2.memberId
86770
+ });
86516
86771
  continue;
86517
86772
  }
86518
- const outerMemberId = outerEnvironment?.get(argument2.genericParamId);
86773
+ const outerMemberId = argument2?.kind === "generic" && typeof argument2.genericParamId === "string" ? outerEnvironment?.get(argument2.genericParamId) : void 0;
86519
86774
  if (outerMemberId !== void 0) {
86520
86775
  bindings.set(genericParamId, {
86521
86776
  kind: "member",
@@ -89234,6 +89489,10 @@ async function runPull(workspace, options) {
89234
89489
  async function runNormalPull(workspace, options, progress) {
89235
89490
  const destructive = options.force;
89236
89491
  const hasBaseline = Object.keys(workspace.state.records).length > 0;
89492
+ const mainLocale = workspaceMainLocale(workspace.state.records);
89493
+ if (acceptSourceEquivalentConflictBases(workspace, mainLocale) > 0) {
89494
+ writeWorkspaceState(workspace.root, workspace.state);
89495
+ }
89237
89496
  let localByKey = /* @__PURE__ */ new Map();
89238
89497
  let localStatus = null;
89239
89498
  if (hasBaseline && !destructive) {
@@ -89326,10 +89585,11 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
89326
89585
  continue;
89327
89586
  }
89328
89587
  const serverChanged = serverRecord.contentHash !== baseState.contentHash;
89329
- const localChanged = local !== void 0 && baseState.file !== void 0 && !authoredRecordsSemanticallyEqual(
89588
+ const localChanged = local !== void 0 && baseState.file !== void 0 && !sourceAuthoredRecordsSemanticallyEqual(
89330
89589
  serverRecord.recordKind,
89331
89590
  local,
89332
- baseState.data
89591
+ baseState.data,
89592
+ mainLocale
89333
89593
  );
89334
89594
  const locallyDeleted = hasBaseline && baseState.file !== void 0 && local === void 0;
89335
89595
  if (!serverChanged) {
@@ -89338,7 +89598,8 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
89338
89598
  serverRecord.recordKind,
89339
89599
  baseState.data,
89340
89600
  serverRecord.data,
89341
- local
89601
+ local,
89602
+ mainLocale
89342
89603
  ).merged,
89343
89604
  serverHash: baseState.contentHash,
89344
89605
  serverData: baseState.data,
@@ -89360,7 +89621,8 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
89360
89621
  serverRecord.recordKind,
89361
89622
  baseState.data,
89362
89623
  serverRecord.data,
89363
- localSide
89624
+ localSide,
89625
+ mainLocale
89364
89626
  );
89365
89627
  if (locallyDeleted || conflictFields.length > 0) {
89366
89628
  conflictCount += 1;
@@ -89393,10 +89655,11 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
89393
89655
  if (baseState !== void 0 && !document.records.has(key)) {
89394
89656
  const binary = localBinaryById.get(baseState.recordId);
89395
89657
  const binaryChanged = binary !== void 0 && binary.action !== "unchanged" && binary.action !== "converged";
89396
- if (authoredRecordsSemanticallyEqual(
89658
+ if (sourceAuthoredRecordsSemanticallyEqual(
89397
89659
  baseState.recordKind,
89398
89660
  local,
89399
- baseState.data
89661
+ baseState.data,
89662
+ mainLocale
89400
89663
  ) && !binaryChanged) {
89401
89664
  continue;
89402
89665
  }
@@ -89857,6 +90120,30 @@ function sourceComparableRecord(recordKind, value, mainLocale) {
89857
90120
  }
89858
90121
  return result;
89859
90122
  }
90123
+ function acceptSourceEquivalentConflictBases(workspace, mainLocale) {
90124
+ let accepted = 0;
90125
+ for (const [key, record3] of Object.entries(workspace.state.records)) {
90126
+ if (typeof record3.conflictServerHash !== "string") continue;
90127
+ if (!sourceAuthoredRecordsSemanticallyEqual(
90128
+ record3.recordKind,
90129
+ record3.data,
90130
+ record3.conflictServerData,
90131
+ mainLocale
90132
+ )) {
90133
+ continue;
90134
+ }
90135
+ const next = {
90136
+ ...record3,
90137
+ contentHash: record3.conflictServerHash,
90138
+ data: record3.conflictServerData
90139
+ };
90140
+ delete next.conflictServerHash;
90141
+ delete next.conflictServerData;
90142
+ workspace.state.records[key] = next;
90143
+ accepted += 1;
90144
+ }
90145
+ return accepted;
90146
+ }
89860
90147
  function workspaceMainLocale(records2) {
89861
90148
  const config = Object.values(records2).find(
89862
90149
  (record3) => record3.recordKind === "localization-config"
@@ -89864,11 +90151,27 @@ function workspaceMainLocale(records2) {
89864
90151
  const data = config?.data;
89865
90152
  return isObjectRecord2(data) && typeof data.mainLocale === "string" ? data.mainLocale : "en-US";
89866
90153
  }
89867
- function authoredRecordsSemanticallyEqual(recordKind, left, right) {
89868
- return isSchemaRecordKindV4(recordKind) ? schemaDocumentAuthoredSemanticallyEqual(recordKind, left, right) : canonicallyEqual(left, right);
90154
+ function mergeProjectDocumentRecord(recordKind, base, server, local, mainLocale) {
90155
+ if (isSchemaRecordKindV4(recordKind)) {
90156
+ return mergeSchemaDocumentRecord(recordKind, base, server, local);
90157
+ }
90158
+ return threeWayMergeRecord(base, server, local, {
90159
+ recursive: true,
90160
+ comparison: {
90161
+ base: sourceComparableObjectRecord(recordKind, base, mainLocale),
90162
+ server: sourceComparableObjectRecord(recordKind, server, mainLocale),
90163
+ local: sourceComparableObjectRecord(recordKind, local, mainLocale)
90164
+ }
90165
+ });
89869
90166
  }
89870
- function mergeProjectDocumentRecord(recordKind, base, server, local) {
89871
- return isSchemaRecordKindV4(recordKind) ? mergeSchemaDocumentRecord(recordKind, base, server, local) : threeWayMergeRecord(base, server, local, { recursive: true });
90167
+ function sourceComparableObjectRecord(recordKind, value, mainLocale) {
90168
+ const comparable = sourceComparableRecord(recordKind, value, mainLocale);
90169
+ if (!isObjectRecord2(comparable)) {
90170
+ throw new Error(
90171
+ `Cannot merge ${recordKind} record because its source-comparable payload is not an object.`
90172
+ );
90173
+ }
90174
+ return comparable;
89872
90175
  }
89873
90176
  function buildEmitRecordSet(document, plans, side) {
89874
90177
  const records2 = /* @__PURE__ */ new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neocompose/cli",
3
- "version": "0.22.5",
3
+ "version": "0.22.7",
4
4
  "description": "Neo Compose native project-source CLI with bidirectional sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,7 +9,7 @@ description: >-
9
9
  `@neocompose/cli` or `node cli/bin/neo.mjs` in the neo-compose repository.
10
10
  ---
11
11
 
12
- <!-- reviewed-through-cli: 0.22.5 -->
12
+ <!-- reviewed-through-cli: 0.22.7 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -78,7 +78,7 @@ wrappers.
78
78
  The marker near the top of `SKILL.md` must exactly match the package version:
79
79
 
80
80
  ```html
81
- <!-- reviewed-through-cli: 0.22.5 -->
81
+ <!-- reviewed-through-cli: 0.22.7 -->
82
82
  ```
83
83
 
84
84
  The quoted version above is checked too, so this instruction cannot go stale