@neocompose/cli 0.84.2 → 0.84.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.
@@ -17587,7 +17587,7 @@ var init_registry = __esm({
17587
17587
  "../packages/manifest/schema-contract/registry.mjs"() {
17588
17588
  "use strict";
17589
17589
  PROJECT_SCHEMA_CONTRACT = Object.freeze({
17590
- cliVersion: "0.84.2",
17590
+ cliVersion: "0.84.3",
17591
17591
  projectFileUploadBatchSize: 32,
17592
17592
  documentRecords: {
17593
17593
  member: {
@@ -26056,13 +26056,29 @@ function memberSavedForStorage(ctx, memberId, contextSaved, declarationClassId)
26056
26056
  if (isWritableConstraint(classStorage)) return true;
26057
26057
  if (classStorage === 1 /* Immutable */) return false;
26058
26058
  }
26059
- const effective = ctx.storageResolver.effectiveStorages(memberId);
26059
+ let effective = ctx.storageResolver.effectiveStorages(memberId);
26060
+ const visited = /* @__PURE__ */ new Set([memberId]);
26061
+ let currentId = memberId;
26062
+ let baseId = member?.extendsMemberId;
26063
+ while (effective.size === 0 && baseId !== void 0 && !visited.has(baseId)) {
26064
+ if (!isResolvedAbstract(ctx, currentId) && !isResolvedAbstract(ctx, baseId))
26065
+ break;
26066
+ visited.add(baseId);
26067
+ effective = ctx.storageResolver.effectiveStorages(baseId);
26068
+ currentId = baseId;
26069
+ baseId = ctx.exportData.members[baseId]?.extendsMemberId;
26070
+ }
26060
26071
  const hasWritable = effective.has(2 /* Save */) || effective.has(3 /* Session */);
26061
26072
  const hasStatic = effective.has(1 /* Immutable */);
26062
26073
  if (hasWritable && !hasStatic) return true;
26063
26074
  if (hasStatic && !hasWritable) return false;
26064
26075
  return contextSaved;
26065
26076
  }
26077
+ function isResolvedAbstract(ctx, memberId) {
26078
+ return isAbstractMember(
26079
+ resolveMemberById(ctx, memberId, `members.${memberId}`)
26080
+ );
26081
+ }
26066
26082
  function classAllowedStorage(ctx, classId) {
26067
26083
  return ctx.storageResolver.allowedStorage(classId);
26068
26084
  }
@@ -26952,7 +26968,7 @@ function typeInfoConstructedSuffix(ctx, typeInfo, saved, genericEnv, genericBind
26952
26968
  const argType = csharpTypeInfoValueType(
26953
26969
  ctx,
26954
26970
  argInfo,
26955
- saved,
26971
+ true,
26956
26972
  genericEnv,
26957
26973
  genericBindingSaved
26958
26974
  );
@@ -82723,6 +82739,7 @@ function createdSessionValuesSince(ctx, checkpoint) {
82723
82739
  return created;
82724
82740
  }
82725
82741
  function exportInitializerCollections(created, writes, ctx) {
82742
+ const inPlace = (value) => value instanceof RuntimeSet ? exportRuntimeSetValue(value, ctx) : value;
82726
82743
  const assignedValues = /* @__PURE__ */ new Set();
82727
82744
  const mutatedIds = /* @__PURE__ */ new Set();
82728
82745
  for (const write of writes) {
@@ -82730,83 +82747,134 @@ function exportInitializerCollections(created, writes, ctx) {
82730
82747
  if (destination !== void 0 && "containerValueId" in destination)
82731
82748
  mutatedIds.add(destination.containerValueId);
82732
82749
  if (write.kind === "assign" && write.valueId === void 0 && typeof write.value === "object" && write.value !== null) {
82733
- assignedValues.add(write.value);
82750
+ assignedValues.add(inPlace(write.value));
82734
82751
  }
82735
82752
  }
82736
82753
  const candidates = /* @__PURE__ */ new Set();
82754
+ const inlineFieldsByRowId = /* @__PURE__ */ new Map();
82737
82755
  for (const row of created) {
82738
- if (assignedValues.has(row.value) || row.classId === void 0 && mutatedIds.has(row.id) || Array.isArray(row.value) && row.value.length > 0 && ctx.__unorderedListProjections?.byContainerId.has(row.id)) {
82756
+ const inlineFields = inlineCollectionFields(row, ctx);
82757
+ if (inlineFields !== null) inlineFieldsByRowId.set(row.id, inlineFields);
82758
+ if (inlineFields !== null || assignedValues.has(inPlace(row.value)) || row.classId === void 0 && mutatedIds.has(row.id) || Array.isArray(row.value) && row.value.length > 0 && ctx.__unorderedListProjections?.byContainerId.has(row.id)) {
82739
82759
  candidates.add(row.id);
82740
82760
  }
82741
82761
  }
82742
82762
  if (candidates.size === 0) return created;
82743
82763
  invalidateEvaluatorIndexes(ctx, null);
82744
82764
  const extra = [];
82745
- const exported = created.map((row) => {
82746
- if (!candidates.has(row.id)) return row;
82747
- const member = memberForValueRow(row, ctx);
82748
- if (member === null) return row;
82749
- if (!isMemberWithEntries(member)) return row;
82750
- if (isMemberEntryCollectionBase(member) && listKindOf(member) === 1 /* Unordered */) {
82751
- return { ...row, value: [] };
82752
- }
82753
- if (!assignedValues.has(row.value) && !mutatedIds.has(row.id)) return row;
82754
- const values = [];
82765
+ const encode = (member, value, genericEnv, collectionOwnerId) => {
82766
+ const rows = [];
82755
82767
  const declarations = /* @__PURE__ */ new Map();
82756
- const genericEnv = runtimeGenericEnvForValueRow(row, ctx, /* @__PURE__ */ new Set());
82757
- overlayConcreteGenericEntries(
82758
- genericEnv,
82759
- envFromStamp(row.genericBindings)
82760
- );
82761
- const materialized = materializeConstructorArgumentValue({
82768
+ const root = materializeConstructorArgumentValue({
82762
82769
  member,
82763
- value: row.value,
82770
+ value,
82764
82771
  genericEnv,
82765
82772
  ctx,
82766
- createdValues: values,
82773
+ createdValues: rows,
82767
82774
  createdById: /* @__PURE__ */ new Map(),
82768
82775
  storageKeyDeclarations: declarations,
82769
- collectionEntriesAreReferences: assignedValues.has(row.value) ? false : void 0,
82770
- collectionOwnerId: row.id
82771
- });
82772
- const encoded = { ...row, value: materialized.value };
82773
- const children = values.filter((value) => value !== materialized);
82774
- declarations.delete(materialized.id);
82775
- const groupId = constructorGroupForRow(row.id, ctx);
82776
- retargetConstructorGroupDependencies(
82777
- materialized.id,
82778
- groupId ?? row.id,
82779
- ctx
82780
- );
82776
+ collectionEntriesAreReferences: assignedValues.has(value) ? false : void 0,
82777
+ collectionOwnerId
82778
+ });
82779
+ const children = rows.filter((row) => row !== root);
82780
+ return { root, children, declarations };
82781
+ };
82782
+ const adopt = (owner, rootId, rows, declarations) => {
82783
+ const groupId = constructorGroupForRow(owner.id, ctx);
82784
+ retargetConstructorGroupDependencies(rootId, groupId ?? owner.id, ctx);
82781
82785
  if (groupId !== null) {
82782
82786
  const state = ctx.__executionState;
82783
82787
  const group = state?.constructorGroups.get(groupId);
82784
- for (const child2 of children) {
82785
- retargetConstructorGroupDependencies(child2.id, groupId, ctx);
82786
- group?.add(child2.id);
82787
- state?.constructorGroupByRowId.set(child2.id, groupId);
82788
+ for (const row of rows) {
82789
+ retargetConstructorGroupDependencies(row.id, groupId, ctx);
82790
+ group?.add(row.id);
82791
+ state?.constructorGroupByRowId.set(row.id, groupId);
82788
82792
  }
82789
82793
  }
82790
- stampCreatedValuesMapKey(children, row.mapKey);
82794
+ stampCreatedValuesMapKey(rows, owner.mapKey);
82791
82795
  applyDeclaredStorageKeyOverrides({
82792
- createdValues: [encoded, ...children],
82796
+ createdValues: [owner, ...rows],
82793
82797
  declarationByValueId: declarations
82794
82798
  });
82795
- for (const child2 of children) {
82796
- if (!isLiteralValueContent(child2)) {
82799
+ for (const row of rows) {
82800
+ if (!isLiteralValueContent(row)) {
82797
82801
  throw new NSGetterRuntimeError(
82798
82802
  "Initializer collection produced an unevaluated row."
82799
82803
  );
82800
82804
  }
82801
- extra.push(child2);
82805
+ extra.push(row);
82802
82806
  }
82803
82807
  for (const [id2, declaration] of declarations) {
82804
82808
  ctx.__createdStorageKeyDeclarations?.set(id2, declaration);
82805
82809
  }
82810
+ };
82811
+ const exported = created.map((row) => {
82812
+ if (!candidates.has(row.id)) return row;
82813
+ const inlineFields = inlineFieldsByRowId.get(row.id);
82814
+ if (inlineFields !== void 0) {
82815
+ const record7 = { ...inlineFields.record };
82816
+ const encoded2 = { ...row, value: record7 };
82817
+ for (const [key, member2] of inlineFields.members) {
82818
+ const { root: root2, children: children2, declarations: declarations2 } = encode(
82819
+ member2,
82820
+ inPlace(record7[key]),
82821
+ inlineFields.genericEnv
82822
+ );
82823
+ record7[key] = root2.id;
82824
+ adopt(encoded2, root2.id, [root2, ...children2], declarations2);
82825
+ }
82826
+ return encoded2;
82827
+ }
82828
+ const member = memberForValueRow(row, ctx);
82829
+ if (member === null) return row;
82830
+ if (!isMemberWithEntries(member)) return row;
82831
+ if (isMemberEntryCollectionBase(member) && listKindOf(member) === 1 /* Unordered */) {
82832
+ return { ...row, value: [] };
82833
+ }
82834
+ const value = inPlace(row.value);
82835
+ if (!assignedValues.has(value) && !mutatedIds.has(row.id)) return row;
82836
+ const { root, children, declarations } = encode(
82837
+ member,
82838
+ value,
82839
+ rowGenericEnv(row, ctx),
82840
+ row.id
82841
+ );
82842
+ const encoded = { ...row, value: root.value };
82843
+ declarations.delete(root.id);
82844
+ adopt(encoded, root.id, children, declarations);
82806
82845
  return encoded;
82807
82846
  });
82808
82847
  return [...exported, ...extra];
82809
82848
  }
82849
+ function inlineCollectionFields(row, ctx) {
82850
+ if (typeof row.classId !== "string") return null;
82851
+ if (!isPlainRecord2(row.value)) return null;
82852
+ let fields = null;
82853
+ for (const key in row.value) {
82854
+ const value = row.value[key];
82855
+ if (typeof value !== "object" || value === null) continue;
82856
+ const rawMember = memberForCustomSchemaValue(row.classId, key, ctx);
82857
+ if (rawMember === null) continue;
82858
+ fields ??= {
82859
+ record: row.value,
82860
+ members: /* @__PURE__ */ new Map(),
82861
+ genericEnv: rowGenericEnv(row, ctx)
82862
+ };
82863
+ const member = substituteMember(
82864
+ rawMember,
82865
+ fields.genericEnv,
82866
+ ctx.vm.members,
82867
+ cachedResolvedMember(rawMember, ctx)
82868
+ );
82869
+ if (isMemberWithEntries(member)) fields.members.set(key, member);
82870
+ }
82871
+ return fields === null || fields.members.size === 0 ? null : fields;
82872
+ }
82873
+ function rowGenericEnv(row, ctx) {
82874
+ const genericEnv = runtimeGenericEnvForValueRow(row, ctx, /* @__PURE__ */ new Set());
82875
+ overlayConcreteGenericEntries(genericEnv, envFromStamp(row.genericBindings));
82876
+ return genericEnv;
82877
+ }
82810
82878
  function prepareSessionValueExport(ctx, checkpoint, writes) {
82811
82879
  const created = createdSessionValuesSince(ctx, checkpoint);
82812
82880
  if (created.length === 0) return;
@@ -94159,6 +94227,7 @@ function clonedConstructorProvenance(source) {
94159
94227
  }
94160
94228
  function cloneConstructorLiteralValue(value) {
94161
94229
  if (typeof value !== "object" || value === null) return value;
94230
+ if (value instanceof NSSlotReference) return value.targetId;
94162
94231
  if (Array.isArray(value)) {
94163
94232
  return value.map((entry) => cloneConstructorLiteralValue(entry));
94164
94233
  }
@@ -96204,7 +96273,7 @@ var init_constructor_argument_ownership = __esm({
96204
96273
  const typeInfo = parameterTypes.get(parameterId);
96205
96274
  return [
96206
96275
  parameterId,
96207
- typeInfo !== void 0 && isAggregateTypeInfo(typeInfo) && typeof argument2 === "string" ? rewriteId(argument2) : argument2
96276
+ typeInfo !== void 0 && (isAggregateTypeInfo(typeInfo) || typeInfo.type === 29 /* Reference */) && typeof argument2 === "string" ? rewriteId(argument2) : argument2
96208
96277
  ];
96209
96278
  }
96210
96279
  )
@@ -96240,6 +96309,41 @@ var init_constructor_argument_ownership = __esm({
96240
96309
  ids.push(edge.targetValueId);
96241
96310
  return ids;
96242
96311
  }
96312
+ /** The targets a row's Reference creation data names (P112 §1.1). */
96313
+ referenceArgumentIds(row) {
96314
+ if (!isLiteralValueContent(row)) return [];
96315
+ const args = row.constructorArgs;
96316
+ if (args === void 0 || args === null) return [];
96317
+ const ids = [];
96318
+ for (const parameterId of this.referenceParameterIds(row)) {
96319
+ const argument2 = args[parameterId];
96320
+ if (typeof argument2 === "string") ids.push(argument2);
96321
+ }
96322
+ return ids;
96323
+ }
96324
+ /** Creation data with each Reference argument's target remapped (P112 §1.1). */
96325
+ remapReferenceArguments(row, remap, contextualMember) {
96326
+ const args = row.constructorArgs;
96327
+ if (args === void 0 || args === null) return args;
96328
+ let remapped;
96329
+ for (const parameterId of this.referenceParameterIds(
96330
+ row,
96331
+ contextualMember
96332
+ )) {
96333
+ const argument2 = args[parameterId];
96334
+ if (typeof argument2 !== "string") continue;
96335
+ const target = remap(argument2);
96336
+ if (target !== argument2) (remapped ??= { ...args })[parameterId] = target;
96337
+ }
96338
+ return remapped ?? args;
96339
+ }
96340
+ *referenceParameterIds(row, contextualMember) {
96341
+ for (const [parameterId, typeInfo] of this.constructorParameterTypes(
96342
+ row,
96343
+ contextualMember
96344
+ ))
96345
+ if (typeInfo.type === 29 /* Reference */) yield parameterId;
96346
+ }
96243
96347
  slotEntries(row) {
96244
96348
  const value = row.value;
96245
96349
  switch (this.referenceSlots(row.id, void 0, value)) {
@@ -98147,7 +98251,11 @@ function resolveVirtualInstanceGraph(args) {
98147
98251
  }
98148
98252
  }
98149
98253
  }
98150
- const virtualRow = rewriteExpandedRow(indexed, expansion);
98254
+ const virtualRow = rewriteExpandedRow(
98255
+ indexed,
98256
+ expansion,
98257
+ materializedGraph
98258
+ );
98151
98259
  const location3 = {
98152
98260
  id: effectiveId2,
98153
98261
  instanceRootId: args.instanceRoot.id,
@@ -99601,6 +99709,16 @@ function sparsifyConstructedInstance(args) {
99601
99709
  protectedValueIds.add(location3.materializedRow.id);
99602
99710
  }
99603
99711
  }
99712
+ const rootId = args.constructed.root.id;
99713
+ const locationValueId = (location3) => args.virtualValueIdForSource?.(rootId, location3.sourceIdentity) ?? location3.virtualRow.id;
99714
+ if (args.bindingTargets !== void 0)
99715
+ pinReferencedSlots(
99716
+ graph,
99717
+ rootId,
99718
+ args.bindingTargets,
99719
+ locationValueId,
99720
+ protectedValueIds
99721
+ );
99604
99722
  let plan;
99605
99723
  try {
99606
99724
  plan = planCollapseVirtualInstance({
@@ -99632,10 +99750,7 @@ function sparsifyConstructedInstance(args) {
99632
99750
  if (real === null || deletedIds.has(real.id)) continue;
99633
99751
  nextIdById.set(
99634
99752
  real.id,
99635
- location3.parentSegment === null ? args.constructed.root.id : args.virtualValueIdForSource?.(
99636
- args.constructed.root.id,
99637
- location3.sourceIdentity
99638
- ) ?? location3.virtualRow.id
99753
+ location3.parentSegment === null ? rootId : locationValueId(location3)
99639
99754
  );
99640
99755
  }
99641
99756
  nextIdById.set(args.constructed.root.id, args.constructed.root.id);
@@ -99734,6 +99849,8 @@ function restoreRowsRetainedRowsName(materializedGraph, rows, updatedValueById,
99734
99849
  updated === void 0 ? row : { ...row, value: updated }
99735
99850
  ))
99736
99851
  restore(valueId);
99852
+ for (const valueId of materializedGraph.referenceArgumentIds(row))
99853
+ restore(valueId);
99737
99854
  entriesByContainerId ??= buildUnorderedListMembershipIndex(rows);
99738
99855
  for (const valueId of entriesByContainerId.get(row.id) ?? [])
99739
99856
  restore(valueId);
@@ -99856,6 +99973,24 @@ function childEnvForRow(member, row, genericEnv, document) {
99856
99973
  }
99857
99974
  return instanceEnv;
99858
99975
  }
99976
+ function pinReferencedSlots(graph, rootId, targets, locationValueId, pinned) {
99977
+ if (targets.ids.size === 0) return;
99978
+ const matched = /* @__PURE__ */ new Set();
99979
+ for (const location3 of graph.locationsByPath.values()) {
99980
+ if (location3.parentSegment === null) continue;
99981
+ const valueId = locationValueId(location3);
99982
+ if (!targets.ids.has(valueId)) continue;
99983
+ matched.add(valueId);
99984
+ if (location3.materializedRow !== null)
99985
+ pinned.add(location3.materializedRow.id);
99986
+ }
99987
+ for (const valueId of targets.pendingIdsByRootId.get(rootId) ?? []) {
99988
+ if (matched.has(valueId)) continue;
99989
+ throw new Error(
99990
+ `A binding names ${valueId}, which construction ${rootId} does not build.`
99991
+ );
99992
+ }
99993
+ }
99859
99994
  function indexExpansion(args) {
99860
99995
  const rowsByExpandedId = args.indexedRows?.rowsById ?? new Map([
99861
99996
  ...args.expandedRows.map((row) => [row.id, row]),
@@ -100122,7 +100257,7 @@ function planAtomicCollectionOverrideWrite(args) {
100122
100257
  childId = parent.id;
100123
100258
  }
100124
100259
  }
100125
- function rewriteExpandedRow(node, expansion) {
100260
+ function rewriteExpandedRow(node, expansion, graph) {
100126
100261
  const rewrite = (id2) => expansion.nodesByExpandedId.get(id2)?.virtualId ?? id2;
100127
100262
  const row = cloneRow(node.expandedRow);
100128
100263
  row.id = node.virtualId;
@@ -100144,6 +100279,12 @@ function rewriteExpandedRow(node, expansion) {
100144
100279
  if (node.member.kind === 9 /* Lookup */) {
100145
100280
  row.value = remapLookupSelection(row.value, rewrite);
100146
100281
  }
100282
+ if (isLiteralValueContent(row) && row.constructorArgs !== void 0)
100283
+ row.constructorArgs = graph.remapReferenceArguments(
100284
+ row,
100285
+ rewrite,
100286
+ node.member
100287
+ );
100147
100288
  if (typeof row.containerId === "string") {
100148
100289
  row.containerId = rewrite(row.containerId);
100149
100290
  }
@@ -100360,6 +100501,18 @@ function memberIdOf(member) {
100360
100501
  function appendVirtualValuePath(parent, segment) {
100361
100502
  return `${parent}/${JSON.stringify(segment)}`;
100362
100503
  }
100504
+ function constructedSlotValueId(rootId, steps) {
100505
+ let pathKey = ROOT_PATH;
100506
+ for (const step of steps)
100507
+ pathKey = appendVirtualValuePath(pathKey, {
100508
+ kind: "class",
100509
+ schemaKey: step.schemaKey
100510
+ });
100511
+ const memberId = steps.at(-1)?.memberId;
100512
+ if (memberId === void 0)
100513
+ throw new Error(`Construction ${rootId} names no slot.`);
100514
+ return derivedVirtualValueId(rootId, `path:${memberId}:${pathKey}`);
100515
+ }
100363
100516
  function parentPathKey(pathKey) {
100364
100517
  if (pathKey === ROOT_PATH) return null;
100365
100518
  const separator = lastPathSeparator(pathKey);
@@ -123909,6 +124062,7 @@ var init_collection_binding_materialization = __esm({
123909
124062
  "../src/database/collection-binding-materialization.ts"() {
123910
124063
  "use strict";
123911
124064
  init_members();
124065
+ init_constructor_argument_ownership();
123912
124066
  init_virtual_instance_values();
123913
124067
  init_headless_virtual_instance_lookups();
123914
124068
  init_document_initializer_compiler();
@@ -123925,6 +124079,7 @@ var init_collection_binding_materialization = __esm({
123925
124079
  pathRowsByRootId = /* @__PURE__ */ new Map();
123926
124080
  stored;
123927
124081
  lookups;
124082
+ schema;
123928
124083
  resolvePath(rootId, segments) {
123929
124084
  let id2 = rootId;
123930
124085
  const pathRows = this.pathRowsByRootId.get(rootId) ?? /* @__PURE__ */ new Set();
@@ -123982,17 +124137,20 @@ var init_collection_binding_materialization = __esm({
123982
124137
  valueId: id2,
123983
124138
  value: row.value
123984
124139
  });
124140
+ const created = [];
123985
124141
  for (const create of plan.creates) {
123986
124142
  pathRows?.add(create.id);
123987
124143
  const { valuePlacement: _placement, ...fields } = create;
123988
124144
  const previous = this.rows.get(create.id);
123989
- this.rows.set(create.id, {
124145
+ const row2 = {
123990
124146
  ...fields,
123991
124147
  value: mergeBodies(fields.value, previous?.value),
123992
124148
  projectId: this.document.project.id,
123993
124149
  createdAt: 0,
123994
124150
  updatedAt: 0
123995
- });
124151
+ };
124152
+ this.rows.set(create.id, row2);
124153
+ created.push(row2);
123996
124154
  }
123997
124155
  for (const update of plan.updates) {
123998
124156
  pathRows?.add(update.valueId);
@@ -124006,6 +124164,13 @@ var init_collection_binding_materialization = __esm({
124006
124164
  value: mergeBodies(previous.value, update.value)
124007
124165
  });
124008
124166
  }
124167
+ this.schema ??= new MaterializedValueGraphContext({
124168
+ ...this.document,
124169
+ values: []
124170
+ });
124171
+ for (const row2 of created)
124172
+ for (const targetId of this.schema.referenceArgumentIds(row2))
124173
+ if (graph.rowsById.has(targetId)) this.materialize(targetId, pathRows);
124009
124174
  return true;
124010
124175
  }
124011
124176
  };
@@ -124214,6 +124379,42 @@ var init_prepared_collection_bindings = __esm({
124214
124379
  }
124215
124380
  });
124216
124381
 
124382
+ // ../src/database/declared-binding-targets.ts
124383
+ function declaredBindingTargetIds(document) {
124384
+ const ids = /* @__PURE__ */ new Set();
124385
+ for (const member of document.members) {
124386
+ if (member.kind !== 9 /* Lookup */) continue;
124387
+ if (isMemberCollectionLookupBase(member) && typeof member.collectionValueId === "string")
124388
+ ids.add(member.collectionValueId);
124389
+ const selection2 = isLiteralValueContent(member.defaultValue) ? member.defaultValue.value : void 0;
124390
+ if (typeof selection2 === "string") ids.add(selection2);
124391
+ if (Array.isArray(selection2)) {
124392
+ for (const id2 of selection2) if (typeof id2 === "string") ids.add(id2);
124393
+ }
124394
+ }
124395
+ for (const folder of document.variantFolders ?? [])
124396
+ if (folder.binding !== void 0) ids.add(folder.binding.collectionValueId);
124397
+ for (const group of document.dialogueGroups)
124398
+ if (group.type === 1 /* Lookup */ && typeof group.collectionValueId === "string")
124399
+ ids.add(group.collectionValueId);
124400
+ const pendingIdsByRootId = /* @__PURE__ */ new Map();
124401
+ for (const id2 of ids) {
124402
+ const rootId = pendingVirtualValueIdentity(id2)?.instanceRootId;
124403
+ if (rootId === void 0) continue;
124404
+ const pending = pendingIdsByRootId.get(rootId);
124405
+ if (pending === void 0) pendingIdsByRootId.set(rootId, [id2]);
124406
+ else pending.push(id2);
124407
+ }
124408
+ return { ids, pendingIdsByRootId };
124409
+ }
124410
+ var init_declared_binding_targets = __esm({
124411
+ "../src/database/declared-binding-targets.ts"() {
124412
+ "use strict";
124413
+ init_members();
124414
+ init_member_value_id();
124415
+ }
124416
+ });
124417
+
124217
124418
  // ../src/runtime/stored-closure-captures.ts
124218
124419
  function assertStoredClosuresKeepNoCaptures(args) {
124219
124420
  for (const row of args.rows) {
@@ -127961,6 +128162,7 @@ function materializePreparedInstanceInitializers(args) {
127961
128162
  const localizedTextIds = new Set(
127962
128163
  materializationScope.document.localizedTexts.map((text) => text.id)
127963
128164
  );
128165
+ const bindingTargets = declaredBindingTargetIds(compiledDocument);
127964
128166
  const replayOnlyIndexes = [];
127965
128167
  const pendingSites = /* @__PURE__ */ new Map();
127966
128168
  for (const [valueId, site] of sites) {
@@ -128050,7 +128252,8 @@ function materializePreparedInstanceInitializers(args) {
128050
128252
  // the class default, so the evaluated construction's own field list is
128051
128253
  // what pins rows against collapse.
128052
128254
  pinnedRootSchemaKeys: materialized.pinnedRootSchemaKeys,
128053
- pinnedSchemaKeysByValueId: materialized.pinnedSchemaKeysByValueId
128255
+ pinnedSchemaKeysByValueId: materialized.pinnedSchemaKeysByValueId,
128256
+ bindingTargets
128054
128257
  });
128055
128258
  assertStoredClosuresKeepNoCaptures({
128056
128259
  sourceValueId: valueId,
@@ -131217,6 +131420,7 @@ var init_project_version_schema_commit = __esm({
131217
131420
  init_neoscript_compiler_revision();
131218
131421
  init_neoscript_source_catalog();
131219
131422
  init_prepared_collection_bindings();
131423
+ init_declared_binding_targets();
131220
131424
  init_stored_closure_captures();
131221
131425
  init_document_initializer_compiler();
131222
131426
  init_effective_value_comparison();
@@ -150701,6 +150905,11 @@ function storedConstructorArgumentSource(context, type, value, environment, visi
150701
150905
  false
150702
150906
  );
150703
150907
  case "reference":
150908
+ if (typeof value !== "string") {
150909
+ throw new Error(
150910
+ "Stored Reference constructor argument is not a target id."
150911
+ );
150912
+ }
150704
150913
  return referenceValue(
150705
150914
  context,
150706
150915
  {
@@ -150708,7 +150917,7 @@ function storedConstructorArgumentSource(context, type, value, environment, visi
150708
150917
  name: "argument",
150709
150918
  kind: 9 /* Lookup */
150710
150919
  },
150711
- value,
150920
+ [value],
150712
150921
  false,
150713
150922
  storedTypeArgumentName(context, type.target, environment)
150714
150923
  );
@@ -153539,6 +153748,7 @@ function materializeInitializersLocallyV4(args) {
153539
153748
  const localizedTextIds = new Set(
153540
153749
  authoredDocument.localizedTexts?.map((text) => text.id)
153541
153750
  );
153751
+ const bindingTargets = declaredBindingTargetIds(authoredDocument);
153542
153752
  const pendingRoots = new Set(
153543
153753
  [...sourceRoots].filter((id2) => rootKinds.get(id2) !== "declaration").sort()
153544
153754
  );
@@ -153735,6 +153945,7 @@ function materializeInitializersLocallyV4(args) {
153735
153945
  // pins rows against collapse. Push preparation pins the same set.
153736
153946
  pinnedRootSchemaKeys: pinned.pinnedRootSchemaKeys,
153737
153947
  pinnedSchemaKeysByValueId: pinned.pinnedSchemaKeysByValueId,
153948
+ bindingTargets,
153738
153949
  virtualValueIdForSource: (instanceRootId, sourceIdentity3) => isPendingId(instanceRootId) || hasPendingVirtualSourceIdentity(sourceIdentity3) ? pendingVirtualValueId(instanceRootId, sourceIdentity3) : virtualValueId(instanceRootId, sourceIdentity3)
153739
153950
  });
153740
153951
  const evaluatedRows = [sparse2.root, ...sparse2.createdChildren];
@@ -153931,6 +154142,7 @@ var init_local_initializer_materialization = __esm({
153931
154142
  init_inheritance();
153932
154143
  init_effective_value_reader();
153933
154144
  init_virtual_instance_values();
154145
+ init_declared_binding_targets();
153934
154146
  init_value_graph();
153935
154147
  init_pending_id();
153936
154148
  init_value_comparison();
@@ -156980,7 +157192,7 @@ function quote4(value) {
156980
157192
  function resolveRootPathCollectionValuesV4(args) {
156981
157193
  const resolved = /* @__PURE__ */ new Map();
156982
157194
  let rootValues;
156983
- let placements;
157195
+ let walk;
156984
157196
  for (const member of args.manifest.members) {
156985
157197
  if (member.kind !== "lookup") continue;
156986
157198
  const spelled = member.collectionValueId;
@@ -157002,16 +157214,9 @@ function resolveRootPathCollectionValuesV4(args) {
157002
157214
  };
157003
157215
  const target = walkRootValuePath(
157004
157216
  path,
157005
- args.state,
157006
- args.registry,
157007
- () => placements ??= prospectiveStoredValuePlacements(
157008
- args.state,
157009
- args.registry,
157010
- args.manifest
157011
- ),
157217
+ walk ??= valuePathWalk(args),
157012
157218
  rootValues,
157013
157219
  fail2,
157014
- args.resolveVirtualPath,
157015
157220
  args.unavailableSlots
157016
157221
  );
157017
157222
  if (target !== null) resolved.set(member.id, target);
@@ -157021,7 +157226,7 @@ function resolveRootPathCollectionValuesV4(args) {
157021
157226
  function resolveRootPathVariantFolderCollectionValuesV4(args) {
157022
157227
  const resolved = /* @__PURE__ */ new Map();
157023
157228
  let rootValues;
157024
- let placements;
157229
+ let walk;
157025
157230
  for (const folder of args.manifest.variantFolders) {
157026
157231
  const spelled = folder.binding?.collectionValueId;
157027
157232
  if (typeof spelled !== "string") continue;
@@ -157042,16 +157247,9 @@ function resolveRootPathVariantFolderCollectionValuesV4(args) {
157042
157247
  };
157043
157248
  const target = walkRootValuePath(
157044
157249
  path,
157045
- args.state,
157046
- args.registry,
157047
- () => placements ??= prospectiveStoredValuePlacements(
157048
- args.state,
157049
- args.registry,
157050
- args.manifest
157051
- ),
157250
+ walk ??= valuePathWalk(args),
157052
157251
  rootValues,
157053
157252
  fail2,
157054
- args.resolveVirtualPath,
157055
157253
  args.unavailableSlots
157056
157254
  );
157057
157255
  if (target !== null) resolved.set(folder.id, target);
@@ -157059,83 +157257,87 @@ function resolveRootPathVariantFolderCollectionValuesV4(args) {
157059
157257
  return resolved;
157060
157258
  }
157061
157259
  function createRootValuePathResolverV4(args) {
157062
- let placements;
157260
+ const walk = valuePathWalk(args);
157063
157261
  let rootValues;
157064
- let computed;
157065
- const readPlacements = () => placements ??= prospectiveStoredValuePlacements(
157066
- args.state,
157067
- args.registry,
157068
- args.manifest
157069
- );
157070
- const settle = (walk2) => {
157262
+ const settle = (resolve7) => {
157071
157263
  const failures = [];
157072
- const valueId = walk2((failure) => failures.push(failure));
157264
+ const valueId = resolve7((failure) => failures.push(failure));
157073
157265
  if (valueId !== null) {
157074
157266
  const stored = args.state[`value:${valueId}`] !== void 0 || args.registry.pendingValues.has(valueId);
157075
157267
  return {
157076
157268
  kind: "resolved",
157077
157269
  valueId,
157078
- memberId: readPlacements().placementByChildValueId.get(valueId)?.memberId ?? null,
157270
+ memberId: walk.placements().placementByChildValueId.get(valueId)?.memberId ?? null,
157079
157271
  ...stored ? {} : { virtual: true }
157080
157272
  };
157081
157273
  }
157082
157274
  const message = failures[0];
157083
157275
  return message === void 0 ? { kind: "unavailable" } : { kind: "failed", message };
157084
157276
  };
157085
- const walk = () => ({
157086
- state: args.state,
157087
- registry: args.registry,
157088
- placements: readPlacements,
157089
- resolveVirtualPath: args.resolveVirtualPath,
157090
- isComputed: computed ??= computedMemberTest(args.manifest)
157091
- });
157092
157277
  return {
157093
157278
  root: (path) => settle((fail2) => {
157094
157279
  if (rootValues === void 0) rootValues = rootSlotValueIds(args.state);
157095
157280
  return walkRootValuePath(
157096
157281
  path,
157097
- args.state,
157098
- args.registry,
157099
- readPlacements,
157282
+ walk,
157100
157283
  rootValues,
157101
157284
  fail2,
157102
- args.resolveVirtualPath,
157103
157285
  args.unavailableSlots,
157104
- "Index path",
157105
- walk().isComputed
157286
+ "Index path"
157106
157287
  );
157107
157288
  }),
157108
157289
  from: (valueId, segments, path) => settle(
157109
- (fail2) => walkValueSegments(walk(), valueId, segments, path, "Reference", fail2)
157290
+ (fail2) => walkValueSegments(walk, valueId, segments, path, "Reference", fail2)
157110
157291
  )
157111
157292
  };
157112
157293
  }
157113
- function computedMemberTest(manifest) {
157294
+ function valuePathWalk(args) {
157295
+ let placements;
157296
+ let schema;
157297
+ return {
157298
+ state: args.state,
157299
+ registry: args.registry,
157300
+ placements: () => placements ??= prospectiveStoredValuePlacements(
157301
+ args.state,
157302
+ args.registry,
157303
+ args.manifest
157304
+ ),
157305
+ schema: () => schema ??= manifestSchemaIndex(args.manifest),
157306
+ resolveVirtualPath: args.resolveVirtualPath,
157307
+ initBuiltSlots: args.initBuiltSlots ?? "derive"
157308
+ };
157309
+ }
157310
+ function manifestSchemaIndex(manifest) {
157114
157311
  const classes = new Map(
157115
157312
  manifest.classes.map((schemaClass2) => [schemaClass2.id, schemaClass2])
157116
157313
  );
157117
- const computed = new Set(
157118
- manifest.members.flatMap(
157119
- (member) => member.kind === "computed" ? [member.id] : []
157120
- )
157314
+ const members = new Map(
157315
+ manifest.members.map((member) => [member.id, member])
157121
157316
  );
157122
- return (valueId, name, walk) => {
157123
- const pending = walk.registry.pendingValues.get(valueId);
157124
- const stored = walk.state[`value:${valueId}`]?.data;
157125
- const classId = pending?.nodeType === "literal" ? pending.classId : isObjectRecord(stored) ? stored.classId : void 0;
157126
- const visited = /* @__PURE__ */ new Set();
157127
- let cursor = typeof classId === "string" ? classes.get(classId) : void 0;
157128
- while (cursor !== void 0 && !visited.has(cursor.id)) {
157129
- visited.add(cursor.id);
157130
- const memberId = cursor.schema[name];
157131
- if (memberId !== void 0) return computed.has(memberId);
157132
- cursor = cursor.extendsClassId === null || cursor.extendsClassId === void 0 ? void 0 : classes.get(cursor.extendsClassId);
157317
+ return {
157318
+ member: (memberId) => members.get(memberId),
157319
+ schemaMember: (classId, schemaKey) => {
157320
+ const visited = /* @__PURE__ */ new Set();
157321
+ let cursor = classes.get(classId);
157322
+ while (cursor !== void 0 && !visited.has(cursor.id)) {
157323
+ visited.add(cursor.id);
157324
+ const memberId = cursor.schema[schemaKey];
157325
+ if (memberId !== void 0) return members.get(memberId);
157326
+ cursor = cursor.extendsClassId === null ? void 0 : classes.get(cursor.extendsClassId);
157327
+ }
157328
+ return void 0;
157133
157329
  }
157134
- return false;
157135
157330
  };
157136
157331
  }
157332
+ function isComputedMember(walk, valueId, name) {
157333
+ const pending = walk.registry.pendingValues.get(valueId);
157334
+ const stored = walk.state[`value:${valueId}`]?.data;
157335
+ const storedClassId = isObjectRecord(stored) ? stored.classId : void 0;
157336
+ const classId = pending?.nodeType === "literal" ? pending.classId : storedClassId;
157337
+ return typeof classId === "string" && walk.schema().schemaMember(classId, name)?.kind === "computed";
157338
+ }
157137
157339
  function resolveRootPathDialogueGroupCollectionValuesV4(args) {
157138
- let placements;
157340
+ let walk;
157139
157341
  let rootValues;
157140
157342
  for (const record7 of args.records) {
157141
157343
  if (record7.recordKind !== "dialogue-group") continue;
@@ -157145,13 +157347,7 @@ function resolveRootPathDialogueGroupCollectionValuesV4(args) {
157145
157347
  if (rootValues === void 0) rootValues = rootSlotValueIds(args.state);
157146
157348
  const target = walkRootValuePath(
157147
157349
  spelled.slice(ROOT_PATH_PENDING_PREFIX.length),
157148
- args.state,
157149
- args.registry,
157150
- () => placements ??= prospectiveStoredValuePlacements(
157151
- args.state,
157152
- args.registry,
157153
- args.manifest
157154
- ),
157350
+ walk ??= valuePathWalk(args),
157155
157351
  rootValues,
157156
157352
  (message) => args.registry.loweringFailures.push({
157157
157353
  message,
@@ -157165,7 +157361,6 @@ function resolveRootPathDialogueGroupCollectionValuesV4(args) {
157165
157361
  label: String(record7.fileFields.name)
157166
157362
  }
157167
157363
  }),
157168
- args.resolveVirtualPath,
157169
157364
  args.unavailableSlots
157170
157365
  );
157171
157366
  if (target !== null) record7.fileFields.collectionValueId = target;
@@ -157184,7 +157379,7 @@ function rootSlotValueIds(state) {
157184
157379
  }
157185
157380
  return values;
157186
157381
  }
157187
- function walkRootValuePath(path, state, registry, placements, rootValues, fail2, resolveVirtualPath, unavailableSlots, subject = "collectionValue path", isComputed) {
157382
+ function walkRootValuePath(path, walk, rootValues, fail2, unavailableSlots, subject = "collectionValue path") {
157188
157383
  const segments = path.split(".");
157189
157384
  const slotName = segments[1];
157190
157385
  if (segments[0] !== "root" || slotName === void 0) {
@@ -157211,7 +157406,7 @@ function walkRootValuePath(path, state, registry, placements, rootValues, fail2,
157211
157406
  return null;
157212
157407
  }
157213
157408
  return walkValueSegments(
157214
- { state, registry, placements, resolveVirtualPath, isComputed },
157409
+ walk,
157215
157410
  slotValueId,
157216
157411
  segments.slice(2),
157217
157412
  path,
@@ -157221,7 +157416,7 @@ function walkRootValuePath(path, state, registry, placements, rootValues, fail2,
157221
157416
  }
157222
157417
  function walkValueSegments(walk, startId, segments, path, subject, fail2) {
157223
157418
  let cursor = startId;
157224
- for (const segment of segments) {
157419
+ for (const [index, segment] of segments.entries()) {
157225
157420
  const pending = walk.registry.pendingValues.get(cursor);
157226
157421
  const body = (pending?.nodeType === "literal" ? pending.value : void 0) ?? (isObjectRecord(walk.state[`value:${cursor}`]?.data) ? (walk.state[`value:${cursor}`]?.data).value : void 0);
157227
157422
  if (Array.isArray(body)) {
@@ -157232,12 +157427,21 @@ function walkValueSegments(walk, startId, segments, path, subject, fail2) {
157232
157427
  }
157233
157428
  if (!isObjectRecord(body)) {
157234
157429
  const initializer = pending !== void 0 ? pending.nodeType === "initializer" : isInitValueContent(walk.state[`value:${cursor}`]?.data);
157235
- if (initializer) {
157430
+ if (initializer && walk.initBuiltSlots === "refuse") {
157236
157431
  fail2(
157237
- `${subject} ${path} stops before segment ${segment}: an init block constructs the row it reaches, so a path cannot name its members yet.`
157432
+ `${subject} ${path} stops before segment ${segment}: an init block constructs the row it reaches, so a value cannot name its members. Bind it from a declaration instead.`
157238
157433
  );
157239
157434
  return null;
157240
157435
  }
157436
+ if (initializer)
157437
+ return constructedSlotId(
157438
+ walk,
157439
+ cursor,
157440
+ segments.slice(index),
157441
+ path,
157442
+ subject,
157443
+ fail2
157444
+ );
157241
157445
  fail2(
157242
157446
  `${subject} ${path} stops before segment ${segment}: the row it reaches stores no single-valued members.`
157243
157447
  );
@@ -157249,7 +157453,7 @@ function walkValueSegments(walk, startId, segments, path, subject, fail2) {
157249
157453
  const direct = directBody && typeof bodyId === "string" && (walk.registry.pendingValues.has(bodyId) || storedChild?.recordKind === "value" && storedChild.recordId === bodyId && isObjectRecord(storedChild.data));
157250
157454
  const next = direct ? bodyId : walk.placements().childrenByParentValueId.get(cursor)?.get(segment)?.childValueId;
157251
157455
  if (typeof next !== "string") {
157252
- if (walk.isComputed?.(cursor, segment, walk) === true) {
157456
+ if (isComputedMember(walk, cursor, segment)) {
157253
157457
  fail2(
157254
157458
  `\`${path}\` names a computed member, which has no row to reference.`
157255
157459
  );
@@ -157277,6 +157481,66 @@ function walkValueSegments(walk, startId, segments, path, subject, fail2) {
157277
157481
  }
157278
157482
  return cursor;
157279
157483
  }
157484
+ function constructedSlotId(walk, rootId, segments, path, subject, fail2) {
157485
+ const schema = walk.schema();
157486
+ const placement = walk.placements().placementByChildValueId.get(rootId);
157487
+ if (placement === void 0) {
157488
+ fail2(
157489
+ `${subject} ${path} reaches init-built row ${rootId}, which no row places.`
157490
+ );
157491
+ return null;
157492
+ }
157493
+ const rootMemberId = placement.memberId;
157494
+ if (rootMemberId === null) {
157495
+ fail2(
157496
+ `${subject} ${path} reaches init-built row ${rootId}, which its parent's class declares no member for.`
157497
+ );
157498
+ return null;
157499
+ }
157500
+ let member = schema.member(rootMemberId);
157501
+ const steps = [];
157502
+ for (const segment of segments) {
157503
+ if (member?.kind !== "class") {
157504
+ fail2(
157505
+ `${subject} ${path} stops before segment ${segment}: the row an init block builds there stores no single-valued members.`
157506
+ );
157507
+ return null;
157508
+ }
157509
+ const slot = schema.schemaMember(member.classId, segment);
157510
+ if (slot === void 0) {
157511
+ fail2(
157512
+ `${subject} ${path} has no value at segment ${segment}: class ${member.classId} declares no such member.`
157513
+ );
157514
+ return null;
157515
+ }
157516
+ if (slot.kind === "computed") {
157517
+ fail2(
157518
+ `\`${path}\` names a computed member, which has no row to reference.`
157519
+ );
157520
+ return null;
157521
+ }
157522
+ steps.push({ schemaKey: segment, memberId: slot.id });
157523
+ member = slot;
157524
+ }
157525
+ if (member !== void 0 && hasRowTargetKind(member)) {
157526
+ fail2(
157527
+ `${subject} ${path} names a ${member.kind} an init block builds, which has no row to check against until the push stores it.`
157528
+ );
157529
+ return null;
157530
+ }
157531
+ return constructedSlotValueId(rootId, steps);
157532
+ }
157533
+ function hasRowTargetKind(member) {
157534
+ switch (member.kind) {
157535
+ case "class":
157536
+ case "list":
157537
+ case "set":
157538
+ case "dictionary":
157539
+ return true;
157540
+ default:
157541
+ return false;
157542
+ }
157543
+ }
157280
157544
  function prospectiveStoredValuePlacements(state, registry, manifest) {
157281
157545
  const records3 = new Map(
157282
157546
  Object.values(state).map((record7) => [
@@ -157341,6 +157605,7 @@ var init_root_source = __esm({
157341
157605
  init_project_root();
157342
157606
  init_value_comparison();
157343
157607
  init_members();
157608
+ init_virtual_instance_graph();
157344
157609
  init_value_sources();
157345
157610
  init_source_format();
157346
157611
  init_stored_value_placements();
@@ -160640,7 +160905,8 @@ function computeStatus(workspace, options, conflictedFiles, parseErrors, parseWa
160640
160905
  state: rootPathResolutionState,
160641
160906
  resolveVirtualPath,
160642
160907
  unavailableSlots: rootValues.unavailableSlots,
160643
- registry: valueLowerRegistry
160908
+ registry: valueLowerRegistry,
160909
+ initBuiltSlots: "derive"
160644
160910
  });
160645
160911
  const resolvedDefaultKeys = resolveKeyReferenceMemberDefaultsV4({
160646
160912
  manifest,
@@ -160995,7 +161261,8 @@ function computeStatus(workspace, options, conflictedFiles, parseErrors, parseWa
160995
161261
  state: rootPathResolutionState,
160996
161262
  resolveVirtualPath,
160997
161263
  unavailableSlots: rootValues.unavailableSlots,
160998
- registry: valueLowerRegistry
161264
+ registry: valueLowerRegistry,
161265
+ initBuiltSlots: "refuse"
160999
161266
  })
161000
161267
  }
161001
161268
  );
@@ -186416,16 +186683,17 @@ function generateInheritedPropertyInterfaceAdapters(ctx, classDef, genericEnv) {
186416
186683
  continue;
186417
186684
  }
186418
186685
  const source = `((${receiverType})this).${memberName}`;
186419
- const getter = isMemberWithEntries(member) && interfaceValueType.startsWith("NeoReadOnly") ? readExpression(
186686
+ const getter = isMemberWithEntries(member) ? collectionReadExpression(
186420
186687
  ctx,
186421
186688
  member,
186689
+ `node.Get<${neoMemberNodeType(member)}>("${escapeCSharpString(schemaKey)}")`,
186422
186690
  schemaKey,
186423
- neoMemberNodeType(member),
186424
- false,
186425
- receiverType,
186691
+ resolveMemberById(ctx, member.entryMemberId, "entryMemberId"),
186692
+ memberSavedForStorage(ctx, memberId, false, declarationClass.id),
186426
186693
  null,
186427
186694
  genericEnv,
186428
- declarationClass.id
186695
+ interfaceValueType,
186696
+ false
186429
186697
  ) : [`return (${interfaceValueType})(object)${source}!;`];
186430
186698
  const hasSetter = isMemberNSPropertyBase(member) && typeof member.setterCode === "string";
186431
186699
  const adapter = [
@@ -190947,12 +191215,12 @@ function collectionGuardArguments(member, writeGuardMemberName) {
190947
191215
  const name = escapeCSharpString(writeGuardMemberName);
190948
191216
  return isReadOnlyMember(member) ? `, () => ThrowReadOnlyMembership("${name}"), () => true` : `, () => ThrowIfReadOnly("${name}"), () => IsReadOnly`;
190949
191217
  }
190950
- function collectionReadExpression(ctx, member, getNode, schemaKey, entryMember, saved, writeGuardMemberName, genericEnv, collectionTypeOverride) {
191218
+ function collectionReadExpression(ctx, member, getNode, schemaKey, entryMember, saved, writeGuardMemberName, genericEnv, collectionTypeOverride, genericBindingSaved = saved) {
190951
191219
  const keyCodecArguments = dictionaryKeyCodecArguments(ctx, member);
190952
191220
  if (saved) {
190953
191221
  const entrySaved = collectionEntrySaved(member, entryMember, true);
190954
191222
  const writableNodeType = isMemberDictionaryBase(member) ? "NeoMemberDictionaryWritable" : "NeoMemberListWritable";
190955
- const collectionType2 = collectionTypeOverride ?? csharpValueType(ctx, member, true, genericEnv);
191223
+ const collectionType2 = collectionTypeOverride ?? csharpValueType(ctx, member, true, genericEnv, genericBindingSaved);
190956
191224
  const keyLiteral = `"${escapeCSharpString(schemaKey)}"`;
190957
191225
  const readNode = `writableNode.Get<${writableNodeType}>(${keyLiteral})`;
190958
191226
  const guardArguments = collectionGuardArguments(
@@ -190964,13 +191232,14 @@ function collectionReadExpression(ctx, member, getNode, schemaKey, entryMember,
190964
191232
  entryMember,
190965
191233
  readNode,
190966
191234
  member.name,
190967
- genericEnv
191235
+ genericEnv,
191236
+ genericBindingSaved
190968
191237
  );
190969
191238
  return cachedStoredWrapper(
190970
191239
  schemaKey,
190971
191240
  readNode,
190972
191241
  collectionType2 ?? "object",
190973
- `new ${collectionType2}(client, memberNode, () => writableNode.GetOrCreateCollection<${writableNodeType}>(${keyLiteral}), (client, child) => ${childConverter(ctx, entryMember, entrySaved, entrySaved && writeGuardMemberName != null, genericEnv)}, item => ${serializeExpression}${keyCodecArguments}${guardArguments})`
191242
+ `new ${collectionType2}(client, memberNode, () => writableNode.GetOrCreateCollection<${writableNodeType}>(${keyLiteral}), (client, child) => ${childConverter(ctx, entryMember, entrySaved, entrySaved && writeGuardMemberName != null, genericEnv, genericBindingSaved)}, item => ${serializeExpression}${keyCodecArguments}${guardArguments})`
190974
191243
  );
190975
191244
  }
190976
191245
  const collectionType = collectionTypeOverride ?? csharpValueType(ctx, member, false, genericEnv);
@@ -191092,9 +191361,9 @@ function interfaceValueRead(ctx, member, nodeExpression, readOnly, genericEnv) {
191092
191361
  if (!isRequiredMember(member)) return read;
191093
191362
  return `${read} ?? throw new InvalidOperationException("Required '${escapeCSharpString(member.name)}' holds no class value.")`;
191094
191363
  }
191095
- function entrySerializeExpression(ctx, entryMember, collectionNode, slotLabel2, genericEnv) {
191364
+ function entrySerializeExpression(ctx, entryMember, collectionNode, slotLabel2, genericEnv, genericBindingSaved = true) {
191096
191365
  const throughCodec = entryMember !== null && (isMemberGenericBase(entryMember) || isMemberLookupBase(entryMember) && lookupProjection(ctx, entryMember) !== "class" /* Class */);
191097
- return throughCodec ? `NeoGenericBindings.Resolve<${csharpValueType(ctx, entryMember, true, genericEnv) ?? "object"}>(client, ${collectionNode}).Serialize(item)` : serializeItemExpression(ctx, entryMember, "item", slotLabel2);
191366
+ return throughCodec ? `NeoGenericBindings.Resolve<${csharpValueType(ctx, entryMember, true, genericEnv, genericBindingSaved) ?? "object"}>(client, ${collectionNode}).Serialize(item)` : serializeItemExpression(ctx, entryMember, "item", slotLabel2);
191098
191367
  }
191099
191368
  function lookupSelectionFactory(ctx, member, selection2, saved, writeGuardMemberName, genericEnv) {
191100
191369
  const targetSaved = lookupTargetSaved(ctx, member) ?? saved;
@@ -191210,7 +191479,7 @@ function dialogueLookupReadExpression(member, getNode, saved, writeGuardMemberNa
191210
191479
  "return selected is null ? null : new NeoDialogueReference(client, selected);"
191211
191480
  ];
191212
191481
  }
191213
- function childConverter(ctx, member, saved = false, branchOnReadOnly = false, genericEnv) {
191482
+ function childConverter(ctx, member, saved = false, branchOnReadOnly = false, genericEnv, genericBindingSaved = saved) {
191214
191483
  if (member === null) return "throw new NotSupportedException()";
191215
191484
  if (isMemberDelegateBase(member)) {
191216
191485
  const delegateType = csharpDelegateType(ctx, member, saved, genericEnv) ?? "NeoDelegate<object?>";
@@ -191232,7 +191501,13 @@ function childConverter(ctx, member, saved = false, branchOnReadOnly = false, ge
191232
191501
  return `((NeoMemberAction)child).Bind${actionBindTypeArguments(actionType)}()`;
191233
191502
  }
191234
191503
  if (isMemberGenericBase(member)) {
191235
- const paramType = csharpValueType(ctx, member, saved, genericEnv);
191504
+ const paramType = csharpValueType(
191505
+ ctx,
191506
+ member,
191507
+ saved,
191508
+ genericEnv,
191509
+ genericBindingSaved
191510
+ );
191236
191511
  if (paramType === null) return "throw new NotSupportedException()";
191237
191512
  return `NeoGenericBindings.Resolve<${paramType}>(client, (NeoMember)child).Read((NeoMember)child)`;
191238
191513
  }
@@ -194863,7 +195138,7 @@ var UNITY_CODEGEN_REVISION;
194863
195138
  var init_unity_codegen_revision = __esm({
194864
195139
  "../src/models/exports/unity-codegen-revision.ts"() {
194865
195140
  "use strict";
194866
- UNITY_CODEGEN_REVISION = "231557c5a40a20ab9e630415d45556845d7561d54e335a4d92c1cdbc1024a705";
195141
+ UNITY_CODEGEN_REVISION = "e875228ee779f868c2c818eb9e245604cd074598712ffd3f8394f460317b1a28";
194867
195142
  }
194868
195143
  });
194869
195144
 
@@ -216001,7 +216276,7 @@ var releaseWorkspaceLock = () => void 0;
216001
216276
  async function main() {
216002
216277
  const args = parseArgs(process.argv.slice(2));
216003
216278
  if (args.command === "--version") {
216004
- console.log("0.84.2");
216279
+ console.log("0.84.3");
216005
216280
  return;
216006
216281
  }
216007
216282
  if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {