@neocompose/cli 0.57.1 → 0.57.3

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.57.3] - 2026-09-24
4
+
5
+ - Status, pull, and push no longer copy a shared row passed to a constructor when they check a stored construction. Before, a constructor argument that named a shared row, such as a schedule event's `area`, copied that row's whole graph for every construction. Once an area grid held a few placed characters, this failed with "NeoScript constructed Session row limit of 4096 exceeded."
6
+ - Dry run and push no longer read a shared constructor argument's current graph when they check a stored construction. Before, a push that deleted a variant still placed in that graph, such as a character in the area a schedule event names, failed with "Variant '…' does not exist in this project."
7
+ - `neo dialogue dryrun` evaluates conditions that have the dialogue context in scope. Before, every such condition failed with "NeoScript getter expected 1 argument(s), got 0."
8
+
9
+ ## [0.57.2] - 2026-09-23
10
+
11
+ - Removing a variant's last `overrides:` argument deletes its stored override row. Dry run and push accept the edit, including variants whose initializer is an inline delegate.
12
+
3
13
  ## [0.57.1] - 2026-09-23
4
14
 
5
15
  - A dialogue authored in `.neoflow` for a `.Lookup` group is triggered by its `@primary` value, matching dialogues created in the web editor. Before, it was saved with no lookup value, so the group never triggered it. Moving a dialogue to another kind of group clears its lookup value. Push again to repair affected dialogues.
package/dist/neo.mjs CHANGED
@@ -46299,7 +46299,8 @@ function isValidProjectBindingIdentifier(value) {
46299
46299
  var init_project_source_identifiers2 = __esm({
46300
46300
  "../src/models/project-source-identifiers.ts"() {
46301
46301
  "use strict";
46302
- init_src();
46302
+ init_generated_csharp_identifiers();
46303
+ init_project_source_identifiers();
46303
46304
  }
46304
46305
  });
46305
46306
 
@@ -46323,46 +46324,6 @@ var init_schema_identifiers = __esm({
46323
46324
  }
46324
46325
  });
46325
46326
 
46326
- // ../src/models/neoscript/neoscript-types.ts
46327
- var NS_TYPE_UNKNOWN, NS_TYPE_VOID, NSAssignmentOperator, NSWritability, NSCollectionMutation;
46328
- var init_neoscript_types = __esm({
46329
- "../src/models/neoscript/neoscript-types.ts"() {
46330
- "use strict";
46331
- NS_TYPE_UNKNOWN = "Unknown";
46332
- NS_TYPE_VOID = "Void";
46333
- NSAssignmentOperator = /* @__PURE__ */ ((NSAssignmentOperator2) => {
46334
- NSAssignmentOperator2["Assign"] = "=";
46335
- NSAssignmentOperator2["AddAssign"] = "+=";
46336
- NSAssignmentOperator2["SubtractAssign"] = "-=";
46337
- NSAssignmentOperator2["MultiplyAssign"] = "*=";
46338
- NSAssignmentOperator2["DivideAssign"] = "/=";
46339
- NSAssignmentOperator2["ModuloAssign"] = "%=";
46340
- NSAssignmentOperator2["Increment"] = "++";
46341
- NSAssignmentOperator2["Decrement"] = "--";
46342
- return NSAssignmentOperator2;
46343
- })(NSAssignmentOperator || {});
46344
- NSWritability = /* @__PURE__ */ ((NSWritability2) => {
46345
- NSWritability2["Local"] = "local";
46346
- NSWritability2["Save"] = "save";
46347
- NSWritability2["Session"] = "session";
46348
- NSWritability2["Immutable"] = "immutable";
46349
- NSWritability2["ImmutableToSaveLookup"] = "immutableToSaveLookup";
46350
- NSWritability2["ImmutableToSessionLookup"] = "immutableToSessionLookup";
46351
- NSWritability2["Runtime"] = "runtime";
46352
- NSWritability2["ReadOnly"] = "readOnly";
46353
- NSWritability2["Setter"] = "setter";
46354
- return NSWritability2;
46355
- })(NSWritability || {});
46356
- NSCollectionMutation = /* @__PURE__ */ ((NSCollectionMutation2) => {
46357
- NSCollectionMutation2["Add"] = "Add";
46358
- NSCollectionMutation2["Remove"] = "Remove";
46359
- NSCollectionMutation2["RemoveAt"] = "RemoveAt";
46360
- NSCollectionMutation2["Clear"] = "Clear";
46361
- return NSCollectionMutation2;
46362
- })(NSCollectionMutation || {});
46363
- }
46364
- });
46365
-
46366
46327
  // ../src/models/neoscript/neoscript-compiler-revision.ts
46367
46328
  function isAcceptedNeoScriptCompilerRevision(stamp, rollout = ACTIVE_NEOSCRIPT_COMPILER_REVISION_ROLLOUT) {
46368
46329
  if (stamp === NEOSCRIPT_COMPILER_REVISION) return true;
@@ -46407,12 +46368,52 @@ var ACTIVE_NEOSCRIPT_COMPILER_REVISION_ROLLOUT;
46407
46368
  var init_neoscript_compiler_revision = __esm({
46408
46369
  "../src/models/neoscript/neoscript-compiler-revision.ts"() {
46409
46370
  "use strict";
46410
- init_src();
46371
+ init_strict_ir();
46411
46372
  ACTIVE_NEOSCRIPT_COMPILER_REVISION_ROLLOUT = // <neoscript-compiler-revision-rollout>
46412
46373
  null;
46413
46374
  }
46414
46375
  });
46415
46376
 
46377
+ // ../src/models/neoscript/neoscript-types.ts
46378
+ var NS_TYPE_UNKNOWN, NS_TYPE_VOID, NSAssignmentOperator, NSWritability, NSCollectionMutation;
46379
+ var init_neoscript_types = __esm({
46380
+ "../src/models/neoscript/neoscript-types.ts"() {
46381
+ "use strict";
46382
+ NS_TYPE_UNKNOWN = "Unknown";
46383
+ NS_TYPE_VOID = "Void";
46384
+ NSAssignmentOperator = /* @__PURE__ */ ((NSAssignmentOperator2) => {
46385
+ NSAssignmentOperator2["Assign"] = "=";
46386
+ NSAssignmentOperator2["AddAssign"] = "+=";
46387
+ NSAssignmentOperator2["SubtractAssign"] = "-=";
46388
+ NSAssignmentOperator2["MultiplyAssign"] = "*=";
46389
+ NSAssignmentOperator2["DivideAssign"] = "/=";
46390
+ NSAssignmentOperator2["ModuloAssign"] = "%=";
46391
+ NSAssignmentOperator2["Increment"] = "++";
46392
+ NSAssignmentOperator2["Decrement"] = "--";
46393
+ return NSAssignmentOperator2;
46394
+ })(NSAssignmentOperator || {});
46395
+ NSWritability = /* @__PURE__ */ ((NSWritability2) => {
46396
+ NSWritability2["Local"] = "local";
46397
+ NSWritability2["Save"] = "save";
46398
+ NSWritability2["Session"] = "session";
46399
+ NSWritability2["Immutable"] = "immutable";
46400
+ NSWritability2["ImmutableToSaveLookup"] = "immutableToSaveLookup";
46401
+ NSWritability2["ImmutableToSessionLookup"] = "immutableToSessionLookup";
46402
+ NSWritability2["Runtime"] = "runtime";
46403
+ NSWritability2["ReadOnly"] = "readOnly";
46404
+ NSWritability2["Setter"] = "setter";
46405
+ return NSWritability2;
46406
+ })(NSWritability || {});
46407
+ NSCollectionMutation = /* @__PURE__ */ ((NSCollectionMutation2) => {
46408
+ NSCollectionMutation2["Add"] = "Add";
46409
+ NSCollectionMutation2["Remove"] = "Remove";
46410
+ NSCollectionMutation2["RemoveAt"] = "RemoveAt";
46411
+ NSCollectionMutation2["Clear"] = "Clear";
46412
+ return NSCollectionMutation2;
46413
+ })(NSCollectionMutation || {});
46414
+ }
46415
+ });
46416
+
46416
46417
  // ../src/models/neoscript/neoscript-guards.ts
46417
46418
  function isNSTypeInfoBase(value) {
46418
46419
  const v = value;
@@ -47460,7 +47461,7 @@ var init_neoscript_guards = __esm({
47460
47461
  "../src/models/neoscript/neoscript-guards.ts"() {
47461
47462
  "use strict";
47462
47463
  init_neoscript_compiler_revision();
47463
- init_member_kinds();
47464
+ init_member_kind_enum();
47464
47465
  init_core();
47465
47466
  init_neoscript_types();
47466
47467
  NS_STRING_OPS = [
@@ -47536,78 +47537,7 @@ var init_parameter_defaults = __esm({
47536
47537
  }
47537
47538
  });
47538
47539
 
47539
- // ../src/models/interfaces/interface-graph.ts
47540
- function resolveInterfaceClosure(interfaceId, interfaces) {
47541
- const byId = new Map(
47542
- interfaces.map((neoInterface) => [neoInterface.id, neoInterface])
47543
- );
47544
- const result = [];
47545
- const emitted = /* @__PURE__ */ new Set();
47546
- const visiting = [];
47547
- const visitingSet = /* @__PURE__ */ new Set();
47548
- const visit = (id2) => {
47549
- if (visitingSet.has(id2)) {
47550
- throw new CircularInterfaceExtensionError(id2, [...visiting, id2]);
47551
- }
47552
- if (emitted.has(id2)) return;
47553
- const neoInterface = byId.get(id2);
47554
- if (!neoInterface) return;
47555
- visiting.push(id2);
47556
- visitingSet.add(id2);
47557
- result.push(neoInterface);
47558
- emitted.add(id2);
47559
- for (const parentId of neoInterface.extendsInterfaceIds ?? []) {
47560
- visit(parentId);
47561
- }
47562
- visiting.pop();
47563
- visitingSet.delete(id2);
47564
- };
47565
- visit(interfaceId);
47566
- return result;
47567
- }
47568
- function resolveImplementedInterfaces(classId, classes, interfaces) {
47569
- const result = [];
47570
- const seen = /* @__PURE__ */ new Set();
47571
- for (const schemaClass2 of resolveInheritanceChain(classId, classes)) {
47572
- for (const interfaceId of schemaClass2.implementsInterfaceIds ?? []) {
47573
- for (const neoInterface of resolveInterfaceClosure(
47574
- interfaceId,
47575
- interfaces
47576
- )) {
47577
- if (seen.has(neoInterface.id)) continue;
47578
- seen.add(neoInterface.id);
47579
- result.push(neoInterface);
47580
- }
47581
- }
47582
- }
47583
- return result;
47584
- }
47585
- function classImplementsInterface(classId, interfaceId, classes, interfaces) {
47586
- return resolveImplementedInterfaces(classId, classes, interfaces).some(
47587
- (neoInterface) => neoInterface.id === interfaceId
47588
- );
47589
- }
47590
- var CircularInterfaceExtensionError;
47591
- var init_interface_graph = __esm({
47592
- "../src/models/interfaces/interface-graph.ts"() {
47593
- "use strict";
47594
- init_inheritance();
47595
- CircularInterfaceExtensionError = class extends Error {
47596
- constructor(interfaceId, chain) {
47597
- super(
47598
- `Circular interface extension detected at "${interfaceId}"; chain: ${chain.join(" -> ")}`
47599
- );
47600
- this.interfaceId = interfaceId;
47601
- this.chain = chain;
47602
- this.name = "CircularInterfaceExtensionError";
47603
- }
47604
- interfaceId;
47605
- chain;
47606
- };
47607
- }
47608
- });
47609
-
47610
- // ../src/models/neoscript/type-info-compatibility.ts
47540
+ // ../src/models/neoscript/type-info-equality.ts
47611
47541
  function typeInfosInvariantlyEqual(left, right) {
47612
47542
  if (left.type !== right.type) return false;
47613
47543
  if (left.required !== right.required) return false;
@@ -47657,28 +47587,14 @@ function typeInfosInvariantlyEqual(left, right) {
47657
47587
  }
47658
47588
  return true;
47659
47589
  }
47660
- var init_type_info_compatibility = __esm({
47661
- "../src/models/neoscript/type-info-compatibility.ts"() {
47590
+ var init_type_info_equality = __esm({
47591
+ "../src/models/neoscript/type-info-equality.ts"() {
47662
47592
  "use strict";
47663
- init_member_kinds();
47664
- init_inheritance();
47665
- init_interface_graph();
47593
+ init_member_kind_enum();
47666
47594
  init_neoscript_types();
47667
47595
  }
47668
47596
  });
47669
47597
 
47670
- // ../src/models/neoscript/index.ts
47671
- var init_neoscript = __esm({
47672
- "../src/models/neoscript/index.ts"() {
47673
- "use strict";
47674
- init_neoscript_types();
47675
- init_neoscript_guards();
47676
- init_parameter_defaults();
47677
- init_type_info_compatibility();
47678
- init_neoscript_compiler_revision();
47679
- }
47680
- });
47681
-
47682
47598
  // ../src/common/collections.ts
47683
47599
  function indexById2(records2) {
47684
47600
  const indexed = /* @__PURE__ */ new Map();
@@ -49116,7 +49032,10 @@ var init_member_kinds = __esm({
49116
49032
  init_core();
49117
49033
  init_docs_text2();
49118
49034
  init_schema_identifiers();
49119
- init_neoscript();
49035
+ init_neoscript_guards();
49036
+ init_neoscript_types();
49037
+ init_parameter_defaults();
49038
+ init_type_info_equality();
49120
49039
  init_classes();
49121
49040
  init_member_kind_enum();
49122
49041
  init_member_kind_taxonomy();
@@ -49700,6 +49619,102 @@ var init_inheritance = __esm({
49700
49619
  }
49701
49620
  });
49702
49621
 
49622
+ // ../src/models/interfaces/interface-graph.ts
49623
+ function resolveInterfaceClosure(interfaceId, interfaces) {
49624
+ const byId = new Map(
49625
+ interfaces.map((neoInterface) => [neoInterface.id, neoInterface])
49626
+ );
49627
+ const result = [];
49628
+ const emitted = /* @__PURE__ */ new Set();
49629
+ const visiting = [];
49630
+ const visitingSet = /* @__PURE__ */ new Set();
49631
+ const visit = (id2) => {
49632
+ if (visitingSet.has(id2)) {
49633
+ throw new CircularInterfaceExtensionError(id2, [...visiting, id2]);
49634
+ }
49635
+ if (emitted.has(id2)) return;
49636
+ const neoInterface = byId.get(id2);
49637
+ if (!neoInterface) return;
49638
+ visiting.push(id2);
49639
+ visitingSet.add(id2);
49640
+ result.push(neoInterface);
49641
+ emitted.add(id2);
49642
+ for (const parentId of neoInterface.extendsInterfaceIds ?? []) {
49643
+ visit(parentId);
49644
+ }
49645
+ visiting.pop();
49646
+ visitingSet.delete(id2);
49647
+ };
49648
+ visit(interfaceId);
49649
+ return result;
49650
+ }
49651
+ function resolveImplementedInterfaces(classId, classes, interfaces) {
49652
+ const result = [];
49653
+ const seen = /* @__PURE__ */ new Set();
49654
+ for (const schemaClass2 of resolveInheritanceChain(classId, classes)) {
49655
+ for (const interfaceId of schemaClass2.implementsInterfaceIds ?? []) {
49656
+ for (const neoInterface of resolveInterfaceClosure(
49657
+ interfaceId,
49658
+ interfaces
49659
+ )) {
49660
+ if (seen.has(neoInterface.id)) continue;
49661
+ seen.add(neoInterface.id);
49662
+ result.push(neoInterface);
49663
+ }
49664
+ }
49665
+ }
49666
+ return result;
49667
+ }
49668
+ function classImplementsInterface(classId, interfaceId, classes, interfaces) {
49669
+ return resolveImplementedInterfaces(classId, classes, interfaces).some(
49670
+ (neoInterface) => neoInterface.id === interfaceId
49671
+ );
49672
+ }
49673
+ var CircularInterfaceExtensionError;
49674
+ var init_interface_graph = __esm({
49675
+ "../src/models/interfaces/interface-graph.ts"() {
49676
+ "use strict";
49677
+ init_inheritance();
49678
+ CircularInterfaceExtensionError = class extends Error {
49679
+ constructor(interfaceId, chain) {
49680
+ super(
49681
+ `Circular interface extension detected at "${interfaceId}"; chain: ${chain.join(" -> ")}`
49682
+ );
49683
+ this.interfaceId = interfaceId;
49684
+ this.chain = chain;
49685
+ this.name = "CircularInterfaceExtensionError";
49686
+ }
49687
+ interfaceId;
49688
+ chain;
49689
+ };
49690
+ }
49691
+ });
49692
+
49693
+ // ../src/models/neoscript/type-info-compatibility.ts
49694
+ var init_type_info_compatibility = __esm({
49695
+ "../src/models/neoscript/type-info-compatibility.ts"() {
49696
+ "use strict";
49697
+ init_member_kind_enum();
49698
+ init_type_info_equality();
49699
+ init_inheritance();
49700
+ init_interface_graph();
49701
+ init_neoscript_types();
49702
+ }
49703
+ });
49704
+
49705
+ // ../src/models/neoscript/index.ts
49706
+ var init_neoscript = __esm({
49707
+ "../src/models/neoscript/index.ts"() {
49708
+ "use strict";
49709
+ init_neoscript_types();
49710
+ init_neoscript_guards();
49711
+ init_parameter_defaults();
49712
+ init_type_info_compatibility();
49713
+ init_type_info_equality();
49714
+ init_neoscript_compiler_revision();
49715
+ }
49716
+ });
49717
+
49703
49718
  // node_modules/uuid/dist-node/regex.js
49704
49719
  var regex_default;
49705
49720
  var init_regex = __esm({
@@ -52713,7 +52728,6 @@ var init_generics = __esm({
52713
52728
  init_structural_narrow();
52714
52729
  init_classes();
52715
52730
  init_inheritance();
52716
- init_members();
52717
52731
  }
52718
52732
  });
52719
52733
 
@@ -53458,7 +53472,6 @@ var init_read_only_members = __esm({
53458
53472
  init_member_storage();
53459
53473
  init_unordered_list_membership();
53460
53474
  init_dist_node();
53461
- init_members();
53462
53475
  init_classes();
53463
53476
  READ_ONLY_SYNTHETIC_VALUE_ID_PREFIX = "__neo_readonly_default:";
53464
53477
  }
@@ -54557,13 +54570,13 @@ function resolveConstructionTypeArguments(typeArguments, document) {
54557
54570
  var init_construction_requirements = __esm({
54558
54571
  "../src/models/classes/construction-requirements.ts"() {
54559
54572
  "use strict";
54560
- init_type_info_compatibility();
54573
+ init_type_info_equality();
54561
54574
  init_classes();
54562
54575
  init_inheritance();
54563
54576
  init_generics();
54564
54577
  init_constructors2();
54565
54578
  init_parameter_defaults();
54566
- init_members();
54579
+ init_member_kinds();
54567
54580
  }
54568
54581
  });
54569
54582
 
@@ -55538,7 +55551,7 @@ var OPTION_ID_REGEX;
55538
55551
  var init_enum_types = __esm({
55539
55552
  "../src/models/enum/enum-types.ts"() {
55540
55553
  "use strict";
55541
- init_src();
55554
+ init_pending_id();
55542
55555
  init_core();
55543
55556
  init_schema_identifiers();
55544
55557
  init_system_record_id();
@@ -56893,7 +56906,6 @@ var init_build_default_member_value = __esm({
56893
56906
  init_member_storage_key();
56894
56907
  init_structured_leaf_fields();
56895
56908
  init_stored_value_shape();
56896
- init_members();
56897
56909
  init_classes();
56898
56910
  init_unordered_list_membership();
56899
56911
  init_stored_value_shape();
@@ -57241,7 +57253,6 @@ var init_list_indexes = __esm({
57241
57253
  init_core();
57242
57254
  init_generics();
57243
57255
  init_inheritance();
57244
- init_members();
57245
57256
  init_classes();
57246
57257
  }
57247
57258
  });
@@ -62187,7 +62198,7 @@ var init_lookup_declared_type = __esm({
62187
62198
  "../src/models/members/lookup-declared-type.ts"() {
62188
62199
  "use strict";
62189
62200
  init_member_kind_enum();
62190
- init_members();
62201
+ init_member_kinds();
62191
62202
  }
62192
62203
  });
62193
62204
 
@@ -62203,9 +62214,9 @@ var init_interface_conformance = __esm({
62203
62214
  init_neoscript_guards();
62204
62215
  init_core();
62205
62216
  init_type_info_compatibility();
62217
+ init_type_info_equality();
62206
62218
  init_interface_types();
62207
62219
  init_lookup_declared_type();
62208
- init_members();
62209
62220
  }
62210
62221
  });
62211
62222
 
@@ -69231,7 +69242,7 @@ function evaluateCellPatternNative(memberId, receiver, args, ctx) {
69231
69242
  var init_cell_pattern2 = __esm({
69232
69243
  "../src/runtime/neoscript/cell-pattern.ts"() {
69233
69244
  "use strict";
69234
- init_src();
69245
+ init_cell_pattern();
69235
69246
  init_member_kinds();
69236
69247
  }
69237
69248
  });
@@ -70866,7 +70877,7 @@ var DecimalOverflowError, DecimalDivisionByZeroError, DecimalDigitsRangeError, D
70866
70877
  var init_decimal_math = __esm({
70867
70878
  "../src/models/decimal/decimal-math.ts"() {
70868
70879
  "use strict";
70869
- init_members();
70880
+ init_member_kinds();
70870
70881
  DecimalOverflowError = class extends Error {
70871
70882
  };
70872
70883
  DecimalDivisionByZeroError = class extends Error {
@@ -72056,7 +72067,9 @@ function evaluateNSGetterWithEffects(getter, ctx, argumentValues = [], options =
72056
72067
  const writes = runtimeCtx.__executionState?.writes ?? requestedWrites;
72057
72068
  const creationCheckpoint = sessionCreationCheckpoint(runtimeCtx);
72058
72069
  const scope = createTopLevelScope(runtimeCtx);
72059
- const parameters = getter.parameters.slice(2);
72070
+ const parameters = getter.parameters.slice(
72071
+ getter.parameters[2]?.id === DIALOGUE_CONTEXT_PARAMETER_ID ? 3 : 2
72072
+ );
72060
72073
  if (parameters.length !== argumentValues.length) {
72061
72074
  throw new NSGetterRuntimeError(
72062
72075
  `NeoScript getter expected ${parameters.length} argument(s), got ${argumentValues.length}.`
@@ -72931,7 +72944,7 @@ function createTopLevelScope(ctx) {
72931
72944
  scope.setLocal("__this__", ctx.thisValue);
72932
72945
  scope.setLocal("__root__", ctx.rootValue);
72933
72946
  scope.setLocal(
72934
- "__context__",
72947
+ DIALOGUE_CONTEXT_PARAMETER_ID,
72935
72948
  ctx.dialogueContext ?? {
72936
72949
  primary: null,
72937
72950
  trigger: null
@@ -81197,7 +81210,7 @@ function collectionEntryUsesReferenceResolution(collection, key, ctx) {
81197
81210
  );
81198
81211
  return referenceIndexes === void 0 || referenceIndexes.has(key);
81199
81212
  }
81200
- var DELEGATE_LEXICAL_THIS, DELEGATE_LEXICAL_ROOT, NonCatchableNSGetterRuntimeError, NativeFunctionDelegateUnavailableError, CorruptNeoScriptIRError, NeoScriptResourceLimitError, NeoScriptWallClockTimeoutError, DEFAULT_NEO_SCRIPT_EXECUTION_BUDGET_LIMITS, liveListIndexesByProject, evaluatorOwnershipCachesByBase, MAX_CONSTRUCTION_DEPTH, MAX_LOOP_ITERATIONS, resolutionCacheByMembers, NO_SCHEMA_REVISION, LazyValueOverlay, READONLY_FOREACH_BINDING_ERROR, READONLY_CATCH_BINDING_ERROR, NS_MATH_OP_NAMES, DOUBLE_INTEGRAL_MAGNITUDE, EMPTY_SUPPLIED_CONSTRUCTOR_FIELDS;
81213
+ var DELEGATE_LEXICAL_THIS, DELEGATE_LEXICAL_ROOT, NonCatchableNSGetterRuntimeError, NativeFunctionDelegateUnavailableError, CorruptNeoScriptIRError, NeoScriptResourceLimitError, NeoScriptWallClockTimeoutError, DEFAULT_NEO_SCRIPT_EXECUTION_BUDGET_LIMITS, liveListIndexesByProject, evaluatorOwnershipCachesByBase, MAX_CONSTRUCTION_DEPTH, MAX_LOOP_ITERATIONS, resolutionCacheByMembers, NO_SCHEMA_REVISION, LazyValueOverlay, READONLY_FOREACH_BINDING_ERROR, READONLY_CATCH_BINDING_ERROR, DIALOGUE_CONTEXT_PARAMETER_ID, NS_MATH_OP_NAMES, DOUBLE_INTEGRAL_MAGNITUDE, EMPTY_SUPPLIED_CONSTRUCTOR_FIELDS;
81201
81214
  var init_evaluateNSGetter = __esm({
81202
81215
  "../src/runtime/neoscript/evaluateNSGetter.ts"() {
81203
81216
  "use strict";
@@ -81205,7 +81218,7 @@ var init_evaluateNSGetter = __esm({
81205
81218
  init_initializer_dependencies();
81206
81219
  init_unattributable_reads();
81207
81220
  init_value_row_owner_members();
81208
- init_src();
81221
+ init_cell_pattern();
81209
81222
  init_cell_pattern2();
81210
81223
  init_world_grid_query();
81211
81224
  init_classes();
@@ -81366,6 +81379,7 @@ var init_evaluateNSGetter = __esm({
81366
81379
  };
81367
81380
  READONLY_FOREACH_BINDING_ERROR = "Cannot assign to a read-only foreach iterator binding.";
81368
81381
  READONLY_CATCH_BINDING_ERROR = "Cannot assign to a read-only catch message binding.";
81382
+ DIALOGUE_CONTEXT_PARAMETER_ID = "__context__";
81369
81383
  NS_MATH_OP_NAMES = {
81370
81384
  min: "Min",
81371
81385
  max: "Max",
@@ -81988,7 +82002,6 @@ var init_stored_value_placement_index = __esm({
81988
82002
  init_constructors2();
81989
82003
  init_project2();
81990
82004
  init_member_kinds();
81991
- init_members();
81992
82005
  }
81993
82006
  });
81994
82007
 
@@ -84658,7 +84671,7 @@ var init_virtual_instance_graph = __esm({
84658
84671
  init_neoscript();
84659
84672
  init_project_schema_index();
84660
84673
  init_initializer_context();
84661
- init_src();
84674
+ init_strict_ir();
84662
84675
  init_initializer_materialization();
84663
84676
  init_unattributable_reads();
84664
84677
  KEPT_ROW_SAMPLE_LIMIT = 12;
@@ -90065,7 +90078,7 @@ var init_neo_script_derived_bodies = __esm({
90065
90078
  "use strict";
90066
90079
  init_members();
90067
90080
  init_dialogue();
90068
- init_src();
90081
+ init_strict_ir();
90069
90082
  init_packed_value_encoding();
90070
90083
  }
90071
90084
  });
@@ -94975,7 +94988,7 @@ var init_general_function_call_ir_source_recompile = __esm({
94975
94988
  init_compiler_adapter();
94976
94989
  init_neoscript();
94977
94990
  init_dialogue_node_index();
94978
- init_src();
94991
+ init_strict_ir();
94979
94992
  init_neo_script_derived_bodies();
94980
94993
  VOID_ACTION_TYPE_INFO = {
94981
94994
  type: 0 /* Null */,
@@ -95957,7 +95970,7 @@ function neoScriptCompilationProjectContract(document) {
95957
95970
  var init_project_fingerprint = __esm({
95958
95971
  "../src/database/neoscript/project-fingerprint.ts"() {
95959
95972
  "use strict";
95960
- init_src();
95973
+ init_strict_ir();
95961
95974
  init_neo_script_recompile_scope();
95962
95975
  init_compiler_adapter();
95963
95976
  }
@@ -97672,8 +97685,62 @@ function appendAuthoredOwnedValueCascadeDeletes(args) {
97672
97685
  thisClass: replayMembers.ownerClassesByMemberId.get(member.id) ?? null
97673
97686
  });
97674
97687
  }
97688
+ const replayCandidates = /* @__PURE__ */ new Map();
97689
+ const authoredCandidateIds = /* @__PURE__ */ new Set();
97690
+ for (const change of args.authoredChanges) {
97691
+ if (change.recordKind !== "value" || change.operation === "delete") {
97692
+ continue;
97693
+ }
97694
+ const row = postValuesById.get(change.recordId);
97695
+ if (row === void 0) continue;
97696
+ if (inlineDelegateArgumentRow(row) === null && delegateValueRow(row) === null) {
97697
+ continue;
97698
+ }
97699
+ replayCandidates.set(change.recordId, row);
97700
+ authoredCandidateIds.add(change.recordId);
97701
+ }
97702
+ for (const rootId of survivingConstructionIds) {
97703
+ const root = postValuesById.get(rootId);
97704
+ const inline = inlineDelegateArgumentRow(root);
97705
+ if (inline !== null) replayCandidates.set(rootId, inline);
97706
+ }
97707
+ const compiledReplayRows = /* @__PURE__ */ new Map();
97708
+ if (replayCandidates.size > 0) {
97709
+ const compiler = createDelegateValueBodyCompiler(
97710
+ authoredPost,
97711
+ new Set(replayCandidates.keys())
97712
+ );
97713
+ if (authoredCandidateIds.size > 0) {
97714
+ args.earlyDelegateCompilation.contractHash = hashCanonicalJson(
97715
+ neoScriptCompilationProjectContract(authoredPost)
97716
+ );
97717
+ }
97718
+ for (const [id2, row] of replayCandidates) {
97719
+ let compiled = row;
97720
+ const closure = delegateValueRow(compiled);
97721
+ if (closure !== null) compiled = compiler.compileClosure(closure);
97722
+ const inline = inlineDelegateArgumentRow(compiled);
97723
+ if (inline !== null) {
97724
+ compiled = {
97725
+ ...inline,
97726
+ constructorArgs: compiler.compileInline(inline)
97727
+ };
97728
+ }
97729
+ compiledReplayRows.set(id2, compiled);
97730
+ if (authoredCandidateIds.has(id2)) {
97731
+ args.earlyDelegateCompilation.rows.set(id2, {
97732
+ source: row,
97733
+ compiled,
97734
+ ...compiler.ownershipIds(id2)
97735
+ });
97736
+ }
97737
+ }
97738
+ }
97675
97739
  const replayDocument = {
97676
97740
  ...postScope.document,
97741
+ values: postScope.document.values.map(
97742
+ (value) => compiledReplayRows.get(value.id) ?? value
97743
+ ),
97677
97744
  initializerCompiler: documentInitializerCompiler(
97678
97745
  postScope.document,
97679
97746
  compilationProject
@@ -97687,7 +97754,7 @@ function appendAuthoredOwnedValueCascadeDeletes(args) {
97687
97754
  document: resolverDocument
97688
97755
  });
97689
97756
  for (const rootId of survivingConstructionIds) {
97690
- const instanceRoot = postValuesById.get(rootId);
97757
+ const instanceRoot = compiledReplayRows.get(rootId) ?? postValuesById.get(rootId);
97691
97758
  const rootMember = postPlacements.get(rootId).member;
97692
97759
  const expanded = expandStoredInstance({
97693
97760
  document: resolverDocument,
@@ -97867,11 +97934,16 @@ function* prepareServerOwnedSchemaCommitPasses(args) {
97867
97934
  authoredChanges
97868
97935
  );
97869
97936
  }
97937
+ const earlyDelegateCompilation = {
97938
+ contractHash: null,
97939
+ rows: /* @__PURE__ */ new Map()
97940
+ };
97870
97941
  let authoredPost = appendAuthoredOwnedValueCascadeDeletes({
97871
97942
  document: args.document,
97872
97943
  authoredChanges,
97873
97944
  contentHashHeads: args.contentHashHeads,
97874
- expandReadOnlySourceConversions: args.expandReadOnlySourceConversions === true
97945
+ expandReadOnlySourceConversions: args.expandReadOnlySourceConversions === true,
97946
+ earlyDelegateCompilation
97875
97947
  }) ?? applyProjectVersionWriteChanges(args.document, authoredChanges);
97876
97948
  if (authoredPost.localizationConfig?.mainLocale !== args.document.localizationConfig?.mainLocale) {
97877
97949
  const normalized = planMemberLocalizationNormalization(
@@ -98271,7 +98343,8 @@ function* prepareServerOwnedSchemaCommitPasses(args) {
98271
98343
  prepared,
98272
98344
  targetIds: recompileTargets.valueIds,
98273
98345
  contentHashHeads: args.contentHashHeads,
98274
- physicalValues: args.document.physicalValues
98346
+ physicalValues: args.document.physicalValues,
98347
+ earlyDelegateCompilation
98275
98348
  });
98276
98349
  args.passLifecycle?.("complete", "delegate-value-bodies");
98277
98350
  yield { pass: "delegate-value-bodies", preparedChanges: prepared };
@@ -101287,43 +101360,19 @@ function compileInlineDelegateConstructorArguments(args) {
101287
101360
  }
101288
101361
  return compiled;
101289
101362
  }
101290
- function prepareServerOwnedDelegateValueBodies(args) {
101291
- const explicitRows = /* @__PURE__ */ new Map();
101292
- const inlineArgumentRows = /* @__PURE__ */ new Map();
101293
- for (let index = 0; index < args.prepared.length; index += 1) {
101294
- const change = args.prepared[index];
101295
- if (change?.recordKind !== "value" || change.operation === "delete") {
101296
- continue;
101297
- }
101298
- const row = delegateValueRow(change.nextData);
101299
- if (row !== null) explicitRows.set(index, row);
101300
- const withInlineArgs = inlineDelegateArgumentRow(change.nextData);
101301
- if (withInlineArgs !== null) inlineArgumentRows.set(index, withInlineArgs);
101302
- }
101303
- const { closureRows: sweepRows, inlineRows: inlineSweepRows } = collectDelegateSweepRows(args);
101304
- if (explicitRows.size === 0 && sweepRows.length === 0 && inlineArgumentRows.size === 0 && inlineSweepRows.length === 0) {
101305
- return;
101306
- }
101307
- const committedDocument = applyProjectVersionWriteChanges(
101308
- args.postDocument,
101309
- args.prepared
101310
- );
101311
- const targetIds = valueIdsFromRows(
101312
- [...explicitRows.values(), ...inlineArgumentRows.values()],
101313
- [...sweepRows, ...inlineSweepRows]
101363
+ function createDelegateValueBodyCompiler(postDocument, targetIds) {
101364
+ const scope = withVariantOwnershipRoots(
101365
+ postDocument,
101366
+ postDocument.variants ?? []
101314
101367
  );
101315
101368
  const rootOwnerByValueId = /* @__PURE__ */ new Map();
101316
- const delegateScope = withVariantOwnershipRoots(
101317
- committedDocument,
101318
- committedDocument.variants ?? []
101319
- );
101320
101369
  const ownerByValueId = resolveSemanticOwnerMembersForValues(
101321
- delegateScope.document,
101370
+ scope.document,
101322
101371
  targetIds,
101323
- delegateScope.roots,
101372
+ scope.roots,
101324
101373
  rootOwnerByValueId
101325
101374
  );
101326
- const compileOne = (document, row) => {
101375
+ const compileClosure = (row, document = scope.document) => {
101327
101376
  const member = ownerByValueId.get(row.id);
101328
101377
  if (!isMemberDelegateBase(member)) {
101329
101378
  const placement = typeof row.containerId === "string" ? `container "${row.containerId}"` : `map key "${row.mapKey ?? "none"}"`;
@@ -101333,8 +101382,9 @@ function prepareServerOwnedDelegateValueBodies(args) {
101333
101382
  }
101334
101383
  const rootOwner = rootOwnerByValueId.get(row.id);
101335
101384
  const thisClass = findSchemaPlacement(rootOwner?.id ?? "", document.classes)?.ownerClass ?? null;
101385
+ const compiled = { ...row, value: { ...row.value } };
101336
101386
  try {
101337
- row.value = compileDelegateClosureValue(row.value.code, {
101387
+ compiled.value = compileDelegateClosureValue(row.value.code, {
101338
101388
  project: document.project,
101339
101389
  projectFiles: document.projectFiles,
101340
101390
  members: document.members,
@@ -101342,9 +101392,8 @@ function prepareServerOwnedDelegateValueBodies(args) {
101342
101392
  enums: document.enums,
101343
101393
  interfaces: document.interfaces,
101344
101394
  constructors: document.constructors ?? [],
101345
- // P67 §3.5 — a variant's `initialize` may delegate to another
101346
- // variant's, so the closure being compiled has to see the variant
101347
- // records committed alongside it.
101395
+ // P67 §3.5: one variant's initialize may call another variant's, so
101396
+ // compilation must see variants committed alongside this closure.
101348
101397
  variants: document.variants ?? [],
101349
101398
  variantFolders: document.variantFolders ?? [],
101350
101399
  thisClass,
@@ -101359,24 +101408,71 @@ function prepareServerOwnedDelegateValueBodies(args) {
101359
101408
  { cause: error }
101360
101409
  );
101361
101410
  }
101411
+ return compiled;
101412
+ };
101413
+ const compileInline = (row, document = scope.document) => compileInlineDelegateConstructorArguments({
101414
+ document,
101415
+ row,
101416
+ ownerMember: ownerByValueId.get(row.id),
101417
+ rootOwner: rootOwnerByValueId.get(row.id) ?? null
101418
+ });
101419
+ const ownershipIds = (valueId) => ({
101420
+ ownerMemberId: getOptionalString(ownerByValueId.get(valueId), "id") ?? null,
101421
+ rootOwnerId: rootOwnerByValueId.get(valueId)?.id ?? null
101422
+ });
101423
+ return { compileClosure, compileInline, ownershipIds };
101424
+ }
101425
+ function prepareServerOwnedDelegateValueBodies(args) {
101426
+ const explicitRows = /* @__PURE__ */ new Map();
101427
+ const inlineArgumentRows = /* @__PURE__ */ new Map();
101428
+ for (let index = 0; index < args.prepared.length; index += 1) {
101429
+ const change = args.prepared[index];
101430
+ if (change?.recordKind !== "value" || change.operation === "delete") {
101431
+ continue;
101432
+ }
101433
+ const row = delegateValueRow(change.nextData);
101434
+ if (row !== null) explicitRows.set(index, row);
101435
+ const withInlineArgs = inlineDelegateArgumentRow(change.nextData);
101436
+ if (withInlineArgs !== null) inlineArgumentRows.set(index, withInlineArgs);
101437
+ }
101438
+ const { closureRows: sweepRows, inlineRows: inlineSweepRows } = collectDelegateSweepRows(args);
101439
+ if (explicitRows.size === 0 && sweepRows.length === 0 && inlineArgumentRows.size === 0 && inlineSweepRows.length === 0) {
101440
+ return;
101441
+ }
101442
+ const committedDocument = applyProjectVersionWriteChanges(
101443
+ args.postDocument,
101444
+ args.prepared
101445
+ );
101446
+ const targetIds = valueIdsFromRows(
101447
+ [...explicitRows.values(), ...inlineArgumentRows.values()],
101448
+ [...sweepRows, ...inlineSweepRows]
101449
+ );
101450
+ const compiler = createDelegateValueBodyCompiler(
101451
+ committedDocument,
101452
+ targetIds
101453
+ );
101454
+ const early = args.earlyDelegateCompilation;
101455
+ const sameCompilerContract = early.rows.size > 0 && early.contractHash === hashCanonicalJson(neoScriptCompilationProjectContract(committedDocument));
101456
+ const reusableEarlyRow = (row) => {
101457
+ if (!sameCompilerContract) return null;
101458
+ const candidate = early.rows.get(row.id);
101459
+ if (candidate?.source !== row) return null;
101460
+ const ownership = compiler.ownershipIds(row.id);
101461
+ return ownership.ownerMemberId === candidate.ownerMemberId && ownership.rootOwnerId === candidate.rootOwnerId ? candidate.compiled : null;
101362
101462
  };
101363
101463
  for (const [index, row] of explicitRows) {
101364
- const compiled = { ...row, value: { ...row.value } };
101365
- compileOne(delegateScope.document, compiled);
101464
+ const reused = reusableEarlyRow(row);
101465
+ const compiled = (reused === null ? null : delegateValueRow(reused)) ?? compiler.compileClosure(row);
101366
101466
  const change = args.prepared[index];
101367
101467
  if (change !== void 0) {
101368
101468
  args.prepared[index] = { ...change, nextData: compiled };
101369
101469
  }
101370
101470
  }
101371
101471
  for (const [index, row] of inlineArgumentRows) {
101372
- const ownerMember = ownerByValueId.get(row.id);
101373
- const rootOwner = rootOwnerByValueId.get(row.id);
101374
- const compiledArgs = compileInlineDelegateConstructorArguments({
101375
- document: delegateScope.document,
101376
- row,
101377
- ownerMember,
101378
- rootOwner: rootOwner ?? null
101379
- });
101472
+ const reused = reusableEarlyRow(row);
101473
+ const compiledArgs = asRecord4(
101474
+ reused?.constructorArgs
101475
+ ) ?? compiler.compileInline(row);
101380
101476
  const change = args.prepared[index];
101381
101477
  if (change !== void 0) {
101382
101478
  args.prepared[index] = {
@@ -101416,16 +101512,16 @@ function prepareServerOwnedDelegateValueBodies(args) {
101416
101512
  });
101417
101513
  };
101418
101514
  for (const row of sweepRows) {
101419
- const compiled = { ...row, value: { ...row.value } };
101515
+ let compiled;
101420
101516
  try {
101421
- compileOne(delegateScope.document, compiled);
101517
+ compiled = compiler.compileClosure(row);
101422
101518
  } catch (postWriteError) {
101423
101519
  const current = delegateValueRow(
101424
101520
  structuredClone(currentById.get(row.id))
101425
101521
  );
101426
101522
  if (current === null) throw postWriteError;
101427
101523
  try {
101428
- compileOne(args.document, current);
101524
+ compiler.compileClosure(current, args.document);
101429
101525
  } catch (preWriteError) {
101430
101526
  if (sameCompileFailure(preWriteError, postWriteError)) continue;
101431
101527
  }
@@ -101433,21 +101529,15 @@ function prepareServerOwnedDelegateValueBodies(args) {
101433
101529
  }
101434
101530
  refresh(row.id, compiled);
101435
101531
  }
101436
- const compileInlineOne = (document, row) => compileInlineDelegateConstructorArguments({
101437
- document,
101438
- row,
101439
- ownerMember: ownerByValueId.get(row.id),
101440
- rootOwner: rootOwnerByValueId.get(row.id) ?? null
101441
- });
101442
101532
  for (const row of inlineSweepRows) {
101443
101533
  let compiledArgs;
101444
101534
  try {
101445
- compiledArgs = compileInlineOne(delegateScope.document, row);
101535
+ compiledArgs = compiler.compileInline(row);
101446
101536
  } catch (postWriteError) {
101447
101537
  const current = inlineDelegateSweepRow(currentById.get(row.id));
101448
101538
  if (current === null) throw postWriteError;
101449
101539
  try {
101450
- compileInlineOne(args.document, current);
101540
+ compiler.compileInline(current, args.document);
101451
101541
  } catch (preWriteError) {
101452
101542
  if (sameCompileFailure(preWriteError, postWriteError)) continue;
101453
101543
  }
@@ -101968,7 +102058,7 @@ var nativePatternMembers;
101968
102058
  var init_unity_static_members = __esm({
101969
102059
  "../src/models/exports/unity-static-members.ts"() {
101970
102060
  "use strict";
101971
- init_src();
102061
+ init_cell_pattern();
101972
102062
  init_members();
101973
102063
  nativePatternMembers = new Set(
101974
102064
  Object.values(NEO_CELL_PATTERN_MEMBER_IDS)
@@ -117100,12 +117190,13 @@ function materializedInitializerReconciliationFailuresV4(args) {
117100
117190
  const replay = replayRows.get(reconciliation.valueId);
117101
117191
  const replayArgs = replay !== void 0 && isLiteralValueContent(replay) ? replay.constructorArgs : void 0;
117102
117192
  const currentRoot = currentRows.get(reconciliation.valueId);
117193
+ const [storedArgs, replayedArgs] = isObjectRecord2(replayArgs) ? withoutSharedArguments(reconciliation.storedConstructorArgs, replayArgs) : [reconciliation.storedConstructorArgs, replayArgs];
117103
117194
  const currentNormalized = currentRoot === void 0 ? void 0 : currentReader.normalizeConstructorArguments(
117104
- reconciliation.storedConstructorArgs,
117195
+ storedArgs,
117105
117196
  currentRoot,
117106
117197
  owner
117107
117198
  );
117108
- const replayNormalized = replay === void 0 || !isObjectRecord2(replayArgs) ? void 0 : currentReader.withRowOverrides(replayRows).normalizeConstructorArguments(replayArgs, replay, owner);
117199
+ const replayNormalized = replay === void 0 || !isObjectRecord2(replayedArgs) ? void 0 : currentReader.withRowOverrides(replayRows).normalizeConstructorArguments(replayedArgs, replay, owner);
117109
117200
  const argumentsMatch = isObjectRecord2(replayArgs) && currentRoot !== void 0 && replay !== void 0 && effectiveValuesEqual(currentNormalized, replayNormalized);
117110
117201
  if (argumentsMatch) {
117111
117202
  continue;
@@ -117126,6 +117217,16 @@ function materializedInitializerReconciliationFailuresV4(args) {
117126
117217
  }
117127
117218
  return failures;
117128
117219
  }
117220
+ function withoutSharedArguments(stored, replayed) {
117221
+ const storedRest = { ...stored };
117222
+ const replayedRest = { ...replayed };
117223
+ for (const [slot, value] of Object.entries(stored)) {
117224
+ if (typeof value !== "string" || replayed[slot] !== value) continue;
117225
+ delete storedRest[slot];
117226
+ delete replayedRest[slot];
117227
+ }
117228
+ return [storedRest, replayedRest];
117229
+ }
117129
117230
  function reconciliationRecords(workspace, changes, seeds = /* @__PURE__ */ new Map()) {
117130
117231
  return prospectiveInitializerRecordsV4({
117131
117232
  workspace,
@@ -121162,6 +121263,7 @@ function buildValueEmitContext(records2, manifest, options = {}) {
121162
121263
  localizedTextIds: /* @__PURE__ */ new Set(),
121163
121264
  constructionReplays: /* @__PURE__ */ new Map(),
121164
121265
  constructorBodySchemaKeys: /* @__PURE__ */ new WeakMap(),
121266
+ activeStoredConstructorArguments: /* @__PURE__ */ new Set(),
121165
121267
  materializedConstructors: /* @__PURE__ */ new Map(),
121166
121268
  materializedConstructorOverrideKeys: /* @__PURE__ */ new Map()
121167
121269
  };
@@ -126792,6 +126894,9 @@ function classValueBody(context, member, value, visited, targetTyped, outerEnvir
126792
126894
  storedEnvironment
126793
126895
  );
126794
126896
  const name = targetTyped ? stringField3(schemaClass2, "name") : classValueTypeName(context, classId, member, environment);
126897
+ const storedArgumentEntries = isObjectRecord2(value.constructorArgs) ? Object.entries(value.constructorArgs).filter(
126898
+ (entry) => typeof entry[1] === "string"
126899
+ ) : [];
126795
126900
  let storedConstruction;
126796
126901
  try {
126797
126902
  storedConstruction = partial ? null : storedConstructorCallSource(
@@ -126809,6 +126914,12 @@ function classValueBody(context, member, value, visited, targetTyped, outerEnvir
126809
126914
  { cause: error }
126810
126915
  );
126811
126916
  }
126917
+ const constructorArgumentValueIds = /* @__PURE__ */ new Set();
126918
+ for (const [, id2] of storedArgumentEntries) {
126919
+ if (context.values.has(id2) && visited.has(id2)) {
126920
+ constructorArgumentValueIds.add(id2);
126921
+ }
126922
+ }
126812
126923
  const replayConstruction = storedConstruction === null ? null : storedConstructorCallSource(
126813
126924
  context,
126814
126925
  schemaClass2,
@@ -126833,6 +126944,15 @@ function classValueBody(context, member, value, visited, targetTyped, outerEnvir
126833
126944
  )
126834
126945
  );
126835
126946
  const replayBody = isObjectRecord2(replayRoot?.value) ? replayRoot.value : {};
126947
+ const replayArgs = isObjectRecord2(replayRoot?.constructorArgs) ? replayRoot.constructorArgs : {};
126948
+ const replayArgumentIdsByStoredId = /* @__PURE__ */ new Map();
126949
+ for (const [slot, storedId] of storedArgumentEntries) {
126950
+ const replayId = replayArgs[slot];
126951
+ if (typeof replayId !== "string") continue;
126952
+ const ids = replayArgumentIdsByStoredId.get(storedId) ?? /* @__PURE__ */ new Set();
126953
+ ids.add(replayId);
126954
+ replayArgumentIdsByStoredId.set(storedId, ids);
126955
+ }
126836
126956
  const order = Array.isArray(schemaClass2.schemaKeyOrder) ? schemaClass2.schemaKeyOrder.filter(
126837
126957
  (entry) => typeof entry === "string" && typeof schema[entry] === "string"
126838
126958
  ) : Object.keys(schema);
@@ -126856,6 +126976,30 @@ function classValueBody(context, member, value, visited, targetTyped, outerEnvir
126856
126976
  const childMember = context.members.get(childMemberId);
126857
126977
  if (childMember === void 0)
126858
126978
  throw new Error(`Class ${name}.${key} has no member record.`);
126979
+ if (constructorArgumentValueIds.has(childId)) {
126980
+ const replayChildId2 = replayBody[key];
126981
+ const replaysBodyKey = replayGraph !== null && typeof replayChildId2 === "string" && replayArgumentIdsByStoredId.get(childId)?.has(replayChildId2) === true && materializedValueSubgraphsEqual(
126982
+ context,
126983
+ context.readEffectiveValues(),
126984
+ replayGraph,
126985
+ childId,
126986
+ replayChildId2,
126987
+ childMember,
126988
+ environment
126989
+ );
126990
+ if (!replaysBodyKey) {
126991
+ const type = schemaTypeForBindingMember(
126992
+ context,
126993
+ childMemberId,
126994
+ environment
126995
+ );
126996
+ fields.push(
126997
+ `${key} = Reference<${storedSchemaTypeName(context, type, environment, childId)}>(id: ${quote5(childId)})`
126998
+ );
126999
+ overrideKeys.add(key);
127000
+ }
127001
+ continue;
127002
+ }
126859
127003
  const preservesExternalBinding = context.collectionBindingValueIds.has(childId);
126860
127004
  const baseChildBody = context.storedValueBase?.get(childId)?.value;
126861
127005
  const clearedStoredClassOverrides = isObjectRecord2(baseChildBody) && Object.keys(baseChildBody).length > 0;
@@ -127288,7 +127432,13 @@ function storedConstructorArgumentSource(context, type, value, environment, visi
127288
127432
  );
127289
127433
  }
127290
127434
  if (cloneAggregateArguments) {
127291
- return storedAggregateCloneSource(context, type, value, environment);
127435
+ return storedAggregateReplaySource(
127436
+ context,
127437
+ type,
127438
+ value,
127439
+ environment,
127440
+ constructorOwnsGraph
127441
+ );
127292
127442
  }
127293
127443
  return storedTypedRowSource(
127294
127444
  context,
@@ -127531,14 +127681,18 @@ function requiredGenericBindingMemberId(environment, genericParamId) {
127531
127681
  }
127532
127682
  return bindingId;
127533
127683
  }
127534
- function storedAggregateCloneSource(context, type, valueId, environment) {
127684
+ function storedAggregateReplaySource(context, type, valueId, environment, constructorOwnsGraph) {
127535
127685
  if (!context.values.has(valueId)) {
127536
127686
  throw new Error(
127537
127687
  `Stored ${type.kind} constructor argument references missing value row ${valueId}.`
127538
127688
  );
127539
127689
  }
127540
127690
  const typeName = storedSchemaTypeName(context, type, environment, valueId);
127541
- return `Reference<${typeName}>(id: ${quote5(valueId)}).Clone()`;
127691
+ const reference2 = `Reference<${typeName}>(id: ${quote5(valueId)})`;
127692
+ return isSharedConstructorArgument(context, valueId, constructorOwnsGraph) ? reference2 : `${reference2}.Clone()`;
127693
+ }
127694
+ function isSharedConstructorArgument(context, valueId, constructorOwnsGraph) {
127695
+ return !constructorOwnsGraph && context.readMaterializedGraph().independentlyOwnedValueIds.has(valueId);
127542
127696
  }
127543
127697
  function storedSchemaTypeName(context, type, environment, valueId) {
127544
127698
  switch (type.kind) {
@@ -127628,14 +127782,15 @@ function storedTypedRowSource(context, type, valueId, environment, visited, writ
127628
127782
  `Stored ${type.kind} constructor argument references missing value row ${valueId}.`
127629
127783
  );
127630
127784
  }
127631
- if (!constructorOwnsGraph && context.readMaterializedGraph().independentlyOwnedValueIds.has(valueId)) {
127785
+ if (isSharedConstructorArgument(context, valueId, constructorOwnsGraph)) {
127632
127786
  return `Reference<${storedSchemaTypeName(context, type, environment, valueId)}>(id: ${quote5(valueId)})`;
127633
127787
  }
127634
- if (visited.has(valueId)) {
127788
+ if (context.activeStoredConstructorArguments.has(valueId)) {
127635
127789
  throw new Error(
127636
127790
  `Stored constructor argument containment cycle reaches ${valueId}.`
127637
127791
  );
127638
127792
  }
127793
+ context.activeStoredConstructorArguments.add(valueId);
127639
127794
  visited.add(valueId);
127640
127795
  try {
127641
127796
  if (type.kind === "class" || type.kind === "interface" || type.kind === "generic") {
@@ -127767,7 +127922,7 @@ ${entries.flatMap(
127767
127922
  )
127768
127923
  );
127769
127924
  } finally {
127770
- visited.delete(valueId);
127925
+ context.activeStoredConstructorArguments.delete(valueId);
127771
127926
  }
127772
127927
  }
127773
127928
  function storedRowIdentitySource(valueId, writeIdentity, expression) {
@@ -140290,7 +140445,7 @@ var init_registry2 = __esm({
140290
140445
  "schema-contract/registry.mjs"() {
140291
140446
  "use strict";
140292
140447
  PROJECT_SCHEMA_CONTRACT = Object.freeze({
140293
- cliVersion: "0.57.1",
140448
+ cliVersion: "0.57.3",
140294
140449
  projectFileUploadBatchSize: 32,
140295
140450
  documentRecords: {
140296
140451
  member: {
@@ -148111,7 +148266,7 @@ There is no --keep-current: preserving current semantic state defines flatten.
148111
148266
  async function main() {
148112
148267
  const args = parseArgs(process.argv.slice(2));
148113
148268
  if (args.command === "--version") {
148114
- console.log("0.57.1");
148269
+ console.log("0.57.3");
148115
148270
  return;
148116
148271
  }
148117
148272
  if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neocompose/cli",
3
- "version": "0.57.1",
3
+ "version": "0.57.3",
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.57.1 -->
12
+ <!-- reviewed-through-cli: 0.57.3 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -97,7 +97,7 @@ wrappers.
97
97
  The marker near the top of `SKILL.md` must exactly match the package version:
98
98
 
99
99
  ```html
100
- <!-- reviewed-through-cli: 0.57.1 -->
100
+ <!-- reviewed-through-cli: 0.57.3 -->
101
101
  ```
102
102
 
103
103
  The quoted version above is checked too, so this instruction cannot go stale