@neocompose/cli 0.21.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.21.1] - 2026-08-03
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- `neo pull --reset` reuses typed project indexes while replaying stored
|
|
8
|
+
constructors instead of rescanning the full value graph for every created
|
|
9
|
+
row. Large projects such as Neowyn now finish canonical regeneration instead
|
|
10
|
+
of pinning one CPU core for many minutes.
|
|
11
|
+
- A reset pull now displays progress immediately and updates its phase while
|
|
12
|
+
downloading files, regenerating sources, and saving pull state.
|
|
13
|
+
|
|
3
14
|
## [0.21.0] - 2026-08-02
|
|
4
15
|
|
|
5
16
|
### Changed
|
package/dist/neo.mjs
CHANGED
|
@@ -42525,7 +42525,7 @@ function cloneDefaultValueForMember(args) {
|
|
|
42525
42525
|
return value;
|
|
42526
42526
|
}
|
|
42527
42527
|
function findValueInDocument(document, valueId, referenceLocation) {
|
|
42528
|
-
const value = document.values.find((candidate) => candidate.id === valueId);
|
|
42528
|
+
const value = document.valueById?.(valueId) ?? document.values.find((candidate) => candidate.id === valueId);
|
|
42529
42529
|
if (value === void 0) {
|
|
42530
42530
|
throw new Error(
|
|
42531
42531
|
`Default value "${valueId}" in ${referenceLocation} does not exist.`
|
|
@@ -42569,9 +42569,7 @@ function isStringRecord(value) {
|
|
|
42569
42569
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
42570
42570
|
}
|
|
42571
42571
|
function findMemberInDocument(document, memberId) {
|
|
42572
|
-
const member = document.members.find(
|
|
42573
|
-
(candidate) => candidate.id === memberId
|
|
42574
|
-
);
|
|
42572
|
+
const member = document.memberById?.(memberId) ?? document.members.find((candidate) => candidate.id === memberId);
|
|
42575
42573
|
if (member === void 0) {
|
|
42576
42574
|
throw new Error(`Member "${memberId}" does not exist.`);
|
|
42577
42575
|
}
|
|
@@ -54614,12 +54612,7 @@ var init_value_row_owner_members = __esm({
|
|
|
54614
54612
|
});
|
|
54615
54613
|
|
|
54616
54614
|
// ../src/database/constructor-argument-ownership.ts
|
|
54617
|
-
function
|
|
54618
|
-
return new MaterializedValueGraphContext(document).constructorParameterTypes(
|
|
54619
|
-
root
|
|
54620
|
-
);
|
|
54621
|
-
}
|
|
54622
|
-
function createTypedValueNormalizer(rows, document, childrenByContainerId = indexChildrenByContainerId(rows), parameterTypesForRow = (root) => requiredConstructorParameterTypes(root, document), memberById = (memberId) => document.members.find((candidate) => candidate.id === memberId), memberTypeInfo = (member, env) => tryMemberTypeInfo(document, member, env)) {
|
|
54615
|
+
function createTypedValueNormalizer(rows, document, childrenByContainerId, parameterTypesForRow, memberById, memberTypeInfo) {
|
|
54623
54616
|
const visiting = /* @__PURE__ */ new Set();
|
|
54624
54617
|
const normalizeLiteral = (value) => {
|
|
54625
54618
|
if (Array.isArray(value)) return value.map(normalizeLiteral);
|
|
@@ -54953,20 +54946,22 @@ var init_constructor_argument_ownership = __esm({
|
|
|
54953
54946
|
constructorParameterTypes(root) {
|
|
54954
54947
|
const cached = this.parameterTypesByValueId.get(root.id);
|
|
54955
54948
|
if (cached !== void 0) return cached;
|
|
54949
|
+
const result = this.resolveConstructorParameterTypes(root);
|
|
54950
|
+
this.parameterTypesByValueId.set(root.id, result);
|
|
54951
|
+
return result;
|
|
54952
|
+
}
|
|
54953
|
+
resolveConstructorParameterTypes(root) {
|
|
54956
54954
|
const result = /* @__PURE__ */ new Map();
|
|
54957
54955
|
if (typeof root.classId !== "string") {
|
|
54958
|
-
this.parameterTypesByValueId.set(root.id, result);
|
|
54959
54956
|
return result;
|
|
54960
54957
|
}
|
|
54961
54958
|
const schemaClass2 = this.classesById.get(root.classId);
|
|
54962
54959
|
const requiredConstructorId2 = schemaClass2?.requiredConstructorId;
|
|
54963
54960
|
if (requiredConstructorId2 === void 0 || requiredConstructorId2 === null) {
|
|
54964
|
-
this.parameterTypesByValueId.set(root.id, result);
|
|
54965
54961
|
return result;
|
|
54966
54962
|
}
|
|
54967
54963
|
const constructor2 = this.constructorsById.get(requiredConstructorId2);
|
|
54968
54964
|
if (constructor2 === void 0 || constructor2.classId !== root.classId) {
|
|
54969
|
-
this.parameterTypesByValueId.set(root.id, result);
|
|
54970
54965
|
return result;
|
|
54971
54966
|
}
|
|
54972
54967
|
const env = rowGenericEnvironment(this.document, root);
|
|
@@ -54977,7 +54972,6 @@ var init_constructor_argument_ownership = __esm({
|
|
|
54977
54972
|
const typeInfo = this.resolveTypeInfo(rawTypeInfo, env);
|
|
54978
54973
|
if (typeInfo !== null) result.set(parameterId, typeInfo);
|
|
54979
54974
|
}
|
|
54980
|
-
this.parameterTypesByValueId.set(root.id, result);
|
|
54981
54975
|
return result;
|
|
54982
54976
|
}
|
|
54983
54977
|
constructorEdges(row) {
|
|
@@ -55005,6 +54999,51 @@ var init_constructor_argument_ownership = __esm({
|
|
|
55005
54999
|
normalizeTypedRow(valueId, typeInfo) {
|
|
55006
55000
|
return this.normalizer().normalizeTypedRow(valueId, typeInfo);
|
|
55007
55001
|
}
|
|
55002
|
+
/**
|
|
55003
|
+
* Build a typed normalizer for a small replay graph over this durable graph.
|
|
55004
|
+
*
|
|
55005
|
+
* Constructor replay replaces only the root and rows it creates. Keeping
|
|
55006
|
+
* those rows as a lazy overlay avoids rescanning every durable value for
|
|
55007
|
+
* every reconstructed instance while preserving references from the replay
|
|
55008
|
+
* into independently owned durable rows.
|
|
55009
|
+
*/
|
|
55010
|
+
withRowOverrides(overrides) {
|
|
55011
|
+
const overrideChildren = indexChildrenByContainerId(overrides);
|
|
55012
|
+
const rows = {
|
|
55013
|
+
get: (valueId) => overrides.get(valueId) ?? this.valuesById.get(valueId)
|
|
55014
|
+
};
|
|
55015
|
+
const children = {
|
|
55016
|
+
get: (containerId) => {
|
|
55017
|
+
if (overrides.has(containerId)) {
|
|
55018
|
+
return overrideChildren.get(containerId) ?? [];
|
|
55019
|
+
}
|
|
55020
|
+
const replayChildren = overrideChildren.get(containerId);
|
|
55021
|
+
if (replayChildren === void 0) {
|
|
55022
|
+
return this.childrenByContainerId.get(containerId);
|
|
55023
|
+
}
|
|
55024
|
+
const durableChildren = this.childrenByContainerId.get(containerId) ?? [];
|
|
55025
|
+
return [
|
|
55026
|
+
...durableChildren.filter((child) => !overrides.has(child.id)),
|
|
55027
|
+
...replayChildren
|
|
55028
|
+
];
|
|
55029
|
+
}
|
|
55030
|
+
};
|
|
55031
|
+
const parameterTypesByRow = /* @__PURE__ */ new WeakMap();
|
|
55032
|
+
return createTypedValueNormalizer(
|
|
55033
|
+
rows,
|
|
55034
|
+
this.document,
|
|
55035
|
+
children,
|
|
55036
|
+
(row) => {
|
|
55037
|
+
const cached = parameterTypesByRow.get(row);
|
|
55038
|
+
if (cached !== void 0) return cached;
|
|
55039
|
+
const resolved = this.resolveConstructorParameterTypes(row);
|
|
55040
|
+
parameterTypesByRow.set(row, resolved);
|
|
55041
|
+
return resolved;
|
|
55042
|
+
},
|
|
55043
|
+
(memberId) => this.membersById.get(memberId),
|
|
55044
|
+
(member, env) => this.memberTypeInfo(member, env)
|
|
55045
|
+
);
|
|
55046
|
+
}
|
|
55008
55047
|
ownerForValue(valueId) {
|
|
55009
55048
|
return this.ownershipFacts().owners.get(valueId);
|
|
55010
55049
|
}
|
|
@@ -56075,15 +56114,22 @@ var init_project2 = __esm({
|
|
|
56075
56114
|
function isCatchableNSRuntimeError(error) {
|
|
56076
56115
|
return error instanceof NSGetterRuntimeError && !(error instanceof NonCatchableNSGetterRuntimeError);
|
|
56077
56116
|
}
|
|
56078
|
-
function makeEvaluatorLookups(members, values) {
|
|
56117
|
+
function makeEvaluatorLookups(members, values, options = {}) {
|
|
56079
56118
|
const attrMap = /* @__PURE__ */ new Map();
|
|
56080
56119
|
for (const a of members) attrMap.set(a.id, a);
|
|
56081
56120
|
const valMap = /* @__PURE__ */ new Map();
|
|
56082
56121
|
for (const v of values) valMap.set(v.id, v);
|
|
56083
|
-
|
|
56122
|
+
const lookups = {
|
|
56084
56123
|
memberById: (id2) => attrMap.get(id2) ?? null,
|
|
56085
56124
|
valueById: (id2) => valMap.get(id2) ?? null
|
|
56086
56125
|
};
|
|
56126
|
+
if (options.includeValueGraphIndexes === true) {
|
|
56127
|
+
return {
|
|
56128
|
+
...lookups,
|
|
56129
|
+
evaluatorIndexes: buildEvaluatorBaseIndexes(members, values, valMap)
|
|
56130
|
+
};
|
|
56131
|
+
}
|
|
56132
|
+
return lookups;
|
|
56087
56133
|
}
|
|
56088
56134
|
function evalMemberById(vm, id2) {
|
|
56089
56135
|
if (vm.databaseVM?.memberById) return vm.databaseVM.memberById(id2);
|
|
@@ -56128,6 +56174,39 @@ function liveListIndexRegistry(ctx) {
|
|
|
56128
56174
|
liveListIndexesByProject.set(projectKey, created);
|
|
56129
56175
|
return created;
|
|
56130
56176
|
}
|
|
56177
|
+
function buildEvaluatorBaseIndexes(members, values, valueById = new Map(
|
|
56178
|
+
values.map((row) => [row.id, row])
|
|
56179
|
+
)) {
|
|
56180
|
+
const indexes = {
|
|
56181
|
+
rowByValueReference: /* @__PURE__ */ new WeakMap(),
|
|
56182
|
+
memberByValueId: /* @__PURE__ */ new Map(),
|
|
56183
|
+
parentLinksByChildId: /* @__PURE__ */ new Map(),
|
|
56184
|
+
indexedRowIds: /* @__PURE__ */ new Set(),
|
|
56185
|
+
indexedOverlayValues: /* @__PURE__ */ new Map(),
|
|
56186
|
+
shadowedBaseRowIds: /* @__PURE__ */ new Set(),
|
|
56187
|
+
listIdentityByArray: /* @__PURE__ */ new WeakMap(),
|
|
56188
|
+
declaredListByArray: /* @__PURE__ */ new WeakMap()
|
|
56189
|
+
};
|
|
56190
|
+
const membersByValueId = /* @__PURE__ */ new Map();
|
|
56191
|
+
for (const member of members) {
|
|
56192
|
+
if (typeof member.valueId === "string") {
|
|
56193
|
+
indexes.memberByValueId.set(member.valueId, member);
|
|
56194
|
+
const bucket = membersByValueId.get(member.valueId) ?? [];
|
|
56195
|
+
bucket.push(member);
|
|
56196
|
+
membersByValueId.set(member.valueId, bucket);
|
|
56197
|
+
}
|
|
56198
|
+
}
|
|
56199
|
+
for (const row of values) indexEvaluatorRow(indexes, row);
|
|
56200
|
+
return {
|
|
56201
|
+
rows: values,
|
|
56202
|
+
valueById,
|
|
56203
|
+
rowByValueReference: indexes.rowByValueReference,
|
|
56204
|
+
memberByValueId: indexes.memberByValueId,
|
|
56205
|
+
membersByValueId,
|
|
56206
|
+
parentLinksByChildId: indexes.parentLinksByChildId,
|
|
56207
|
+
indexedRowIds: indexes.indexedRowIds
|
|
56208
|
+
};
|
|
56209
|
+
}
|
|
56131
56210
|
function evaluatorIndexes(ctx) {
|
|
56132
56211
|
const overlayRevision = ctx.__valueOverlay instanceof LazyValueOverlay ? ctx.__valueOverlay.revision : void 0;
|
|
56133
56212
|
if (ctx.__indexes !== void 0 && ctx.__indexes.overlayRevision === overlayRevision) {
|
|
@@ -56135,22 +56214,38 @@ function evaluatorIndexes(ctx) {
|
|
|
56135
56214
|
return ctx.__indexes;
|
|
56136
56215
|
}
|
|
56137
56216
|
const liveListIndexes = liveListIndexRegistry(ctx);
|
|
56217
|
+
const base = ctx.vm.databaseVM?.evaluatorIndexes;
|
|
56138
56218
|
const indexes = {
|
|
56139
56219
|
rowByValueReference: /* @__PURE__ */ new WeakMap(),
|
|
56140
|
-
|
|
56220
|
+
baseRowByValueReference: base?.rowByValueReference,
|
|
56221
|
+
memberByValueId: base?.memberByValueId ?? /* @__PURE__ */ new Map(),
|
|
56141
56222
|
parentLinksByChildId: /* @__PURE__ */ new Map(),
|
|
56223
|
+
baseParentLinksByChildId: base?.parentLinksByChildId,
|
|
56142
56224
|
indexedRowIds: /* @__PURE__ */ new Set(),
|
|
56225
|
+
baseIndexedRowIds: base?.indexedRowIds,
|
|
56143
56226
|
indexedOverlayValues: /* @__PURE__ */ new Map(),
|
|
56227
|
+
shadowedBaseRowIds: /* @__PURE__ */ new Set(),
|
|
56144
56228
|
overlayRevision,
|
|
56145
56229
|
listIdentityByArray: liveListIndexes?.identity ?? /* @__PURE__ */ new WeakMap(),
|
|
56146
56230
|
declaredListByArray: liveListIndexes?.declared ?? /* @__PURE__ */ new WeakMap()
|
|
56147
56231
|
};
|
|
56148
|
-
|
|
56149
|
-
|
|
56150
|
-
|
|
56232
|
+
if (base === void 0) {
|
|
56233
|
+
for (const member of ctx.vm.members) {
|
|
56234
|
+
if (typeof member.valueId === "string") {
|
|
56235
|
+
indexes.memberByValueId.set(member.valueId, member);
|
|
56236
|
+
}
|
|
56237
|
+
}
|
|
56238
|
+
for (const row of evaluatorValues(ctx)) indexEvaluatorRow(indexes, row);
|
|
56239
|
+
} else {
|
|
56240
|
+
for (const row of ctx.__runtimeSessionValues?.values() ?? []) {
|
|
56241
|
+
indexes.shadowedBaseRowIds.add(row.id);
|
|
56242
|
+
indexEvaluatorRow(indexes, row, true);
|
|
56243
|
+
}
|
|
56244
|
+
for (const row of ctx.__valueOverlay?.values() ?? []) {
|
|
56245
|
+
indexes.shadowedBaseRowIds.add(row.id);
|
|
56246
|
+
indexEvaluatorRow(indexes, row, true);
|
|
56151
56247
|
}
|
|
56152
56248
|
}
|
|
56153
|
-
for (const row of evaluatorValues(ctx)) indexEvaluatorRow(indexes, row);
|
|
56154
56249
|
syncLazyOverlayReferences(indexes, ctx.__valueOverlay);
|
|
56155
56250
|
ctx.__indexes = indexes;
|
|
56156
56251
|
return indexes;
|
|
@@ -56165,8 +56260,10 @@ function syncLazyOverlayReferences(indexes, overlay) {
|
|
|
56165
56260
|
}
|
|
56166
56261
|
}
|
|
56167
56262
|
}
|
|
56168
|
-
function indexEvaluatorRow(indexes, row) {
|
|
56169
|
-
if (indexes.indexedRowIds.has(row.id))
|
|
56263
|
+
function indexEvaluatorRow(indexes, row, allowBaseShadow = false) {
|
|
56264
|
+
if (indexes.indexedRowIds.has(row.id) || !allowBaseShadow && indexes.baseIndexedRowIds?.has(row.id) === true) {
|
|
56265
|
+
return;
|
|
56266
|
+
}
|
|
56170
56267
|
indexes.indexedRowIds.add(row.id);
|
|
56171
56268
|
if (typeof row.value === "object" && row.value !== null) {
|
|
56172
56269
|
indexes.rowByValueReference.set(row.value, row);
|
|
@@ -56191,6 +56288,16 @@ function addEvaluatorParentLink(indexes, childId, parentId, key) {
|
|
|
56191
56288
|
links.push({ parentId, key });
|
|
56192
56289
|
indexes.parentLinksByChildId.set(childId, links);
|
|
56193
56290
|
}
|
|
56291
|
+
function evaluatorParentLinks(indexes, childId) {
|
|
56292
|
+
const unfilteredBase = indexes.baseParentLinksByChildId?.get(childId) ?? [];
|
|
56293
|
+
const base = indexes.shadowedBaseRowIds.size === 0 ? unfilteredBase : unfilteredBase.filter(
|
|
56294
|
+
(link) => !indexes.shadowedBaseRowIds.has(link.parentId)
|
|
56295
|
+
);
|
|
56296
|
+
const local = indexes.parentLinksByChildId.get(childId) ?? [];
|
|
56297
|
+
if (base.length === 0) return local;
|
|
56298
|
+
if (local.length === 0) return base;
|
|
56299
|
+
return [...base, ...local];
|
|
56300
|
+
}
|
|
56194
56301
|
function invalidateEvaluatorIndexes(ctx) {
|
|
56195
56302
|
if (ctx.__valueOverlay instanceof LazyValueOverlay) {
|
|
56196
56303
|
ctx.__valueOverlay.markMutated();
|
|
@@ -56199,7 +56306,8 @@ function invalidateEvaluatorIndexes(ctx) {
|
|
|
56199
56306
|
}
|
|
56200
56307
|
function trackedRowForValueReference(value, ctx) {
|
|
56201
56308
|
if (typeof value !== "object" || value === null) return null;
|
|
56202
|
-
|
|
56309
|
+
const indexes = evaluatorIndexes(ctx);
|
|
56310
|
+
return indexes.rowByValueReference.get(value) ?? indexes.baseRowByValueReference?.get(value) ?? null;
|
|
56203
56311
|
}
|
|
56204
56312
|
function pushConstructionFrame(ctx, label) {
|
|
56205
56313
|
const state = ctx.__executionState;
|
|
@@ -58360,9 +58468,10 @@ function delegateClosureLexicalThis(closure, ctx) {
|
|
|
58360
58468
|
);
|
|
58361
58469
|
}
|
|
58362
58470
|
const owners = /* @__PURE__ */ new Map();
|
|
58363
|
-
for (const link of
|
|
58471
|
+
for (const link of evaluatorParentLinks(
|
|
58472
|
+
evaluatorIndexes(ctx),
|
|
58364
58473
|
closureRow.id
|
|
58365
|
-
)
|
|
58474
|
+
)) {
|
|
58366
58475
|
const parent = evalValueById(
|
|
58367
58476
|
ctx.vm,
|
|
58368
58477
|
link.parentId,
|
|
@@ -58515,7 +58624,7 @@ function runtimeGenericEnvForValueRow(row, ctx, visited) {
|
|
|
58515
58624
|
}
|
|
58516
58625
|
function runtimeParentGenericEnv(row, ctx, visited) {
|
|
58517
58626
|
const result = /* @__PURE__ */ new Map();
|
|
58518
|
-
for (const link of evaluatorIndexes(ctx)
|
|
58627
|
+
for (const link of evaluatorParentLinks(evaluatorIndexes(ctx), row.id)) {
|
|
58519
58628
|
const parent = evalValueById(
|
|
58520
58629
|
ctx.vm,
|
|
58521
58630
|
link.parentId,
|
|
@@ -59251,7 +59360,7 @@ function memberForValueRow(row, ctx, visited = /* @__PURE__ */ new Set()) {
|
|
|
59251
59360
|
if (syntheticMemberId !== null) {
|
|
59252
59361
|
return evalMemberById(ctx.vm, syntheticMemberId);
|
|
59253
59362
|
}
|
|
59254
|
-
for (const link of indexes
|
|
59363
|
+
for (const link of evaluatorParentLinks(indexes, row.id)) {
|
|
59255
59364
|
const parent = evalValueById(
|
|
59256
59365
|
ctx.vm,
|
|
59257
59366
|
link.parentId,
|
|
@@ -60359,7 +60468,12 @@ function constructClassValueWithinFrame(descriptor, scope, ctx) {
|
|
|
60359
60468
|
members: ctx.vm.members,
|
|
60360
60469
|
classes: ctx.vm.classes,
|
|
60361
60470
|
enums: ctx.vm.enums,
|
|
60362
|
-
|
|
60471
|
+
// Declaration defaults only reference durable rows. Supplying the
|
|
60472
|
+
// immutable base plus its indexes avoids copying and linearly scanning
|
|
60473
|
+
// the entire project for every constructor replay.
|
|
60474
|
+
values: ctx.vm.values,
|
|
60475
|
+
memberById: ctx.vm.databaseVM?.memberById,
|
|
60476
|
+
valueById: ctx.vm.databaseVM?.valueById,
|
|
60363
60477
|
projectFiles: ctx.vm.projectFiles ?? [],
|
|
60364
60478
|
textureTemplates: ctx.vm.textureTemplates ?? []
|
|
60365
60479
|
},
|
|
@@ -60936,7 +61050,9 @@ function constructDeclaredClassValueWithinFrame(descriptor, record3, info, scope
|
|
|
60936
61050
|
members: ctx.vm.members,
|
|
60937
61051
|
classes: ctx.vm.classes,
|
|
60938
61052
|
enums: ctx.vm.enums,
|
|
60939
|
-
values:
|
|
61053
|
+
values: ctx.vm.values,
|
|
61054
|
+
memberById: ctx.vm.databaseVM?.memberById,
|
|
61055
|
+
valueById: ctx.vm.databaseVM?.valueById,
|
|
60940
61056
|
projectFiles: ctx.vm.projectFiles ?? [],
|
|
60941
61057
|
textureTemplates: ctx.vm.textureTemplates ?? []
|
|
60942
61058
|
},
|
|
@@ -61133,8 +61249,8 @@ function currentOwnedValueAttachments(valueId, ctx) {
|
|
|
61133
61249
|
label: `static:${activeStaticRoot.member.id}`
|
|
61134
61250
|
});
|
|
61135
61251
|
}
|
|
61136
|
-
|
|
61137
|
-
|
|
61252
|
+
const directlyBoundMembers = ctx.vm.databaseVM?.evaluatorIndexes?.membersByValueId.get(valueId) ?? ctx.vm.members.filter((member) => member.valueId === valueId);
|
|
61253
|
+
for (const member of directlyBoundMembers) {
|
|
61138
61254
|
const identity2 = member.isStatic ? `static:${member.id}` : `member:${member.id}`;
|
|
61139
61255
|
add({ identity: identity2, label: identity2 });
|
|
61140
61256
|
}
|
|
@@ -61147,7 +61263,19 @@ function currentOwnedValueAttachments(valueId, ctx) {
|
|
|
61147
61263
|
});
|
|
61148
61264
|
}
|
|
61149
61265
|
}
|
|
61150
|
-
|
|
61266
|
+
const parentIds = new Set(
|
|
61267
|
+
evaluatorParentLinks(evaluatorIndexes(ctx), valueId).map(
|
|
61268
|
+
(link) => link.parentId
|
|
61269
|
+
)
|
|
61270
|
+
);
|
|
61271
|
+
for (const parentId of parentIds) {
|
|
61272
|
+
const parent = evalValueById(
|
|
61273
|
+
ctx.vm,
|
|
61274
|
+
parentId,
|
|
61275
|
+
ctx.__runtimeSessionValues,
|
|
61276
|
+
ctx.__valueOverlay
|
|
61277
|
+
);
|
|
61278
|
+
if (parent === null) continue;
|
|
61151
61279
|
if (parent.id === valueId) continue;
|
|
61152
61280
|
let member = activeStaticBindingRoot(parent.id, ctx)?.member ?? memberForValueRow(parent, ctx);
|
|
61153
61281
|
if (member !== null) {
|
|
@@ -62096,6 +62224,16 @@ var init_evaluateNSGetter = __esm({
|
|
|
62096
62224
|
}
|
|
62097
62225
|
ensureSourceIndexes() {
|
|
62098
62226
|
if (this.sourceIndexes !== void 0) return this.sourceIndexes;
|
|
62227
|
+
const evaluatorIndexes2 = this.vm.databaseVM?.evaluatorIndexes;
|
|
62228
|
+
if (evaluatorIndexes2 !== void 0) {
|
|
62229
|
+
const indexes2 = {
|
|
62230
|
+
rows: evaluatorIndexes2.rows,
|
|
62231
|
+
byId: evaluatorIndexes2.valueById,
|
|
62232
|
+
byReference: evaluatorIndexes2.rowByValueReference
|
|
62233
|
+
};
|
|
62234
|
+
this.sourceIndexes = indexes2;
|
|
62235
|
+
return indexes2;
|
|
62236
|
+
}
|
|
62099
62237
|
const rows = [];
|
|
62100
62238
|
const byId = /* @__PURE__ */ new Map();
|
|
62101
62239
|
const byReference = /* @__PURE__ */ new WeakMap();
|
|
@@ -62118,6 +62256,22 @@ var init_evaluateNSGetter = __esm({
|
|
|
62118
62256
|
});
|
|
62119
62257
|
|
|
62120
62258
|
// ../src/view-models/neoscript-evaluator/evaluateInitializer.ts
|
|
62259
|
+
function initializerEvaluatorLookups(document) {
|
|
62260
|
+
const key = document;
|
|
62261
|
+
const cached = evaluatorLookupsByDocument.get(key);
|
|
62262
|
+
if (cached !== void 0 && cached.members === document.members && cached.values === document.values) {
|
|
62263
|
+
return cached.lookups;
|
|
62264
|
+
}
|
|
62265
|
+
const lookups = makeEvaluatorLookups(document.members, document.values, {
|
|
62266
|
+
includeValueGraphIndexes: true
|
|
62267
|
+
});
|
|
62268
|
+
evaluatorLookupsByDocument.set(key, {
|
|
62269
|
+
members: document.members,
|
|
62270
|
+
values: document.values,
|
|
62271
|
+
lookups
|
|
62272
|
+
});
|
|
62273
|
+
return lookups;
|
|
62274
|
+
}
|
|
62121
62275
|
function buildInitializerRootValue(document) {
|
|
62122
62276
|
const rootValue = {};
|
|
62123
62277
|
const memberById = new Map(
|
|
@@ -62154,7 +62308,8 @@ function evaluateMemberInitializer(args) {
|
|
|
62154
62308
|
textureTemplates: args.document.textureTemplates,
|
|
62155
62309
|
constructors: args.document.constructors,
|
|
62156
62310
|
interfaces: args.document.interfaces,
|
|
62157
|
-
localizedTexts: args.document.localizedTexts
|
|
62311
|
+
localizedTexts: args.document.localizedTexts,
|
|
62312
|
+
databaseVM: initializerEvaluatorLookups(args.document)
|
|
62158
62313
|
},
|
|
62159
62314
|
thisValue: null,
|
|
62160
62315
|
rootValue: buildInitializerRootValue(args.document),
|
|
@@ -62178,12 +62333,14 @@ function evaluateMemberInitializer(args) {
|
|
|
62178
62333
|
...constructorArgs === void 0 ? {} : { constructorArgs: structuredClone(constructorArgs) }
|
|
62179
62334
|
};
|
|
62180
62335
|
}
|
|
62336
|
+
var evaluatorLookupsByDocument;
|
|
62181
62337
|
var init_evaluateInitializer = __esm({
|
|
62182
62338
|
"../src/view-models/neoscript-evaluator/evaluateInitializer.ts"() {
|
|
62183
62339
|
"use strict";
|
|
62184
62340
|
init_project2();
|
|
62185
62341
|
init_NSGetterRuntimeError();
|
|
62186
62342
|
init_evaluateNSGetter();
|
|
62343
|
+
evaluatorLookupsByDocument = /* @__PURE__ */ new WeakMap();
|
|
62187
62344
|
}
|
|
62188
62345
|
});
|
|
62189
62346
|
|
|
@@ -75204,10 +75361,14 @@ function buildValueEmitContext(records2, manifest) {
|
|
|
75204
75361
|
return {
|
|
75205
75362
|
records: records2,
|
|
75206
75363
|
readDocument,
|
|
75207
|
-
readMaterializedGraph: () =>
|
|
75208
|
-
|
|
75209
|
-
|
|
75210
|
-
|
|
75364
|
+
readMaterializedGraph: () => {
|
|
75365
|
+
if (materializedGraph !== void 0) return materializedGraph;
|
|
75366
|
+
materializedGraph = new MaterializedValueGraphContext(
|
|
75367
|
+
readDocument(),
|
|
75368
|
+
memberValueRowMap(values, "stored value graph")
|
|
75369
|
+
);
|
|
75370
|
+
return materializedGraph;
|
|
75371
|
+
},
|
|
75211
75372
|
members,
|
|
75212
75373
|
classes,
|
|
75213
75374
|
manifestMembers: new Map(
|
|
@@ -79010,16 +79171,28 @@ function classValue(context, member, value, visited, targetTyped, outerEnvironme
|
|
|
79010
79171
|
visited,
|
|
79011
79172
|
targetTyped
|
|
79012
79173
|
);
|
|
79013
|
-
const
|
|
79174
|
+
const replayConstruction = storedConstruction === null ? null : storedConstructorCallSource(
|
|
79175
|
+
context,
|
|
79176
|
+
schemaClass2,
|
|
79177
|
+
value,
|
|
79178
|
+
name,
|
|
79179
|
+
environment,
|
|
79180
|
+
visited,
|
|
79181
|
+
targetTyped,
|
|
79182
|
+
true
|
|
79183
|
+
);
|
|
79184
|
+
const replayRows = replayConstruction === null || typeof value.id !== "string" || Object.keys(value.value).length === 0 ? null : storedConstructionReplayRows(
|
|
79014
79185
|
context,
|
|
79015
79186
|
value.id,
|
|
79016
|
-
|
|
79187
|
+
replayConstruction,
|
|
79017
79188
|
member
|
|
79018
79189
|
);
|
|
79019
79190
|
const replayRoot = replayRows === null || typeof value.id !== "string" ? void 0 : replayRows.get(value.id);
|
|
79020
|
-
const replayGraph = replayRows === null || typeof value.id !== "string" ? null :
|
|
79021
|
-
|
|
79022
|
-
|
|
79191
|
+
const replayGraph = replayRows === null || typeof value.id !== "string" ? null : context.readMaterializedGraph().withRowOverrides(
|
|
79192
|
+
memberValueRowMap(
|
|
79193
|
+
replayRows,
|
|
79194
|
+
`construction replay for ${value.id}`
|
|
79195
|
+
)
|
|
79023
79196
|
);
|
|
79024
79197
|
const replayBody = isObjectRecord2(replayRoot?.value) ? replayRoot.value : {};
|
|
79025
79198
|
const order = Array.isArray(schemaClass2.schemaKeyOrder) ? schemaClass2.schemaKeyOrder.filter(
|
|
@@ -79092,14 +79265,13 @@ function storedConstructionReplayRows(context, valueId, code, member) {
|
|
|
79092
79265
|
if (cached !== void 0) return cached;
|
|
79093
79266
|
const replay = replayStoredConstructionV4({
|
|
79094
79267
|
records: context.records,
|
|
79268
|
+
document: context.readDocument(),
|
|
79095
79269
|
valueId,
|
|
79096
79270
|
code,
|
|
79097
79271
|
member
|
|
79098
79272
|
});
|
|
79099
|
-
|
|
79100
|
-
|
|
79101
|
-
context.constructionReplays.set(valueId, combined);
|
|
79102
|
-
return combined;
|
|
79273
|
+
context.constructionReplays.set(valueId, replay);
|
|
79274
|
+
return replay;
|
|
79103
79275
|
}
|
|
79104
79276
|
function materializedValueSubgraphsEqual(context, currentGraph, replayGraph, currentId, replayId, member, environment) {
|
|
79105
79277
|
const resolvedMember = resolveGenericValueMember(
|
|
@@ -79122,7 +79294,7 @@ function materializedValueSubgraphsEqual(context, currentGraph, replayGraph, cur
|
|
|
79122
79294
|
replayGraph.normalizeTypedRow(replayId, typeInfo)
|
|
79123
79295
|
);
|
|
79124
79296
|
}
|
|
79125
|
-
function storedConstructorCallSource(context, schemaClass2, value, className, environment, visited, targetTyped) {
|
|
79297
|
+
function storedConstructorCallSource(context, schemaClass2, value, className, environment, visited, targetTyped, cloneAggregateArguments = false) {
|
|
79126
79298
|
const constructorArgs = value.constructorArgs;
|
|
79127
79299
|
if (!isObjectRecord2(constructorArgs)) return null;
|
|
79128
79300
|
const manifestClass = context.manifestClasses.get(
|
|
@@ -79146,7 +79318,8 @@ function storedConstructorCallSource(context, schemaClass2, value, className, en
|
|
|
79146
79318
|
argument2.type,
|
|
79147
79319
|
constructorArgs[key],
|
|
79148
79320
|
environment,
|
|
79149
|
-
visited
|
|
79321
|
+
visited,
|
|
79322
|
+
cloneAggregateArguments
|
|
79150
79323
|
)}`;
|
|
79151
79324
|
});
|
|
79152
79325
|
return argumentsValue.length === 0 && targetTyped ? "new()" : `new ${className}(${argumentsValue.join(", ")})`;
|
|
@@ -79179,7 +79352,7 @@ function storedValueConstructor(context, schemaClass2, constructorArgs) {
|
|
|
79179
79352
|
}
|
|
79180
79353
|
return selected2;
|
|
79181
79354
|
}
|
|
79182
|
-
function storedConstructorArgumentSource(context, type, value, environment, visited) {
|
|
79355
|
+
function storedConstructorArgumentSource(context, type, value, environment, visited, cloneAggregateArguments = false) {
|
|
79183
79356
|
if (value === null) return "null";
|
|
79184
79357
|
switch (type.kind) {
|
|
79185
79358
|
case "null":
|
|
@@ -79243,6 +79416,9 @@ function storedConstructorArgumentSource(context, type, value, environment, visi
|
|
|
79243
79416
|
`Stored Class constructor argument for ${type.classId} is not a value-row reference.`
|
|
79244
79417
|
);
|
|
79245
79418
|
}
|
|
79419
|
+
if (cloneAggregateArguments) {
|
|
79420
|
+
return storedAggregateCloneSource(context, type, value, environment);
|
|
79421
|
+
}
|
|
79246
79422
|
return storedTypedRowSource(context, type, value, environment, visited);
|
|
79247
79423
|
}
|
|
79248
79424
|
case "interface":
|
|
@@ -79254,6 +79430,9 @@ function storedConstructorArgumentSource(context, type, value, environment, visi
|
|
|
79254
79430
|
`Stored ${type.kind} constructor argument is not a value-row reference.`
|
|
79255
79431
|
);
|
|
79256
79432
|
}
|
|
79433
|
+
if (cloneAggregateArguments) {
|
|
79434
|
+
return storedAggregateCloneSource(context, type, value, environment);
|
|
79435
|
+
}
|
|
79257
79436
|
return storedTypedRowSource(context, type, value, environment, visited);
|
|
79258
79437
|
case "lookup":
|
|
79259
79438
|
return referenceValue(
|
|
@@ -79287,6 +79466,92 @@ function storedConstructorArgumentSource(context, type, value, environment, visi
|
|
|
79287
79466
|
);
|
|
79288
79467
|
}
|
|
79289
79468
|
}
|
|
79469
|
+
function storedAggregateCloneSource(context, type, valueId, environment) {
|
|
79470
|
+
if (!context.values.has(valueId)) {
|
|
79471
|
+
throw new Error(
|
|
79472
|
+
`Stored ${type.kind} constructor argument references missing value row ${valueId}.`
|
|
79473
|
+
);
|
|
79474
|
+
}
|
|
79475
|
+
const typeName = storedSchemaTypeName(context, type, environment, valueId);
|
|
79476
|
+
return `Reference<${typeName}>(id: ${quote4(valueId)}).Clone()`;
|
|
79477
|
+
}
|
|
79478
|
+
function storedSchemaTypeName(context, type, environment, valueId) {
|
|
79479
|
+
switch (type.kind) {
|
|
79480
|
+
case "unknown":
|
|
79481
|
+
return "object";
|
|
79482
|
+
case "class": {
|
|
79483
|
+
const schemaClass2 = context.manifestClasses.get(type.classId);
|
|
79484
|
+
if (schemaClass2 === void 0) {
|
|
79485
|
+
throw new Error(`Stored Class type ${type.classId} was not pulled.`);
|
|
79486
|
+
}
|
|
79487
|
+
const argumentsValue = schemaClass2.genericParameters.flatMap(
|
|
79488
|
+
(parameter3) => {
|
|
79489
|
+
const argument2 = type.classArguments[parameter3.id];
|
|
79490
|
+
return argument2 === void 0 ? [] : [storedSchemaTypeName(context, argument2, environment)];
|
|
79491
|
+
}
|
|
79492
|
+
);
|
|
79493
|
+
return `${schemaClass2.name}${argumentsValue.length === 0 ? "" : `<${argumentsValue.join(", ")}>`}`;
|
|
79494
|
+
}
|
|
79495
|
+
case "interface": {
|
|
79496
|
+
const row = valueId === void 0 ? void 0 : context.values.get(valueId);
|
|
79497
|
+
if (typeof row?.classId === "string") {
|
|
79498
|
+
const schemaClass2 = context.manifestClasses.get(row.classId);
|
|
79499
|
+
if (schemaClass2 !== void 0) return schemaClass2.name;
|
|
79500
|
+
}
|
|
79501
|
+
const record3 = context.records.get(`interface:${type.interfaceId}`);
|
|
79502
|
+
return stringField3(
|
|
79503
|
+
isObjectRecord2(record3?.data) ? record3.data : {},
|
|
79504
|
+
"name"
|
|
79505
|
+
);
|
|
79506
|
+
}
|
|
79507
|
+
case "generic": {
|
|
79508
|
+
const memberId = environment.get(type.genericParamId);
|
|
79509
|
+
const member = memberId === void 0 ? void 0 : context.manifestMembers.get(memberId);
|
|
79510
|
+
if (member === void 0) {
|
|
79511
|
+
throw new Error(
|
|
79512
|
+
`Stored Generic constructor argument has no concrete binding for ${type.genericParamId}.`
|
|
79513
|
+
);
|
|
79514
|
+
}
|
|
79515
|
+
return manifestMemberTypeName(context, member);
|
|
79516
|
+
}
|
|
79517
|
+
case "list":
|
|
79518
|
+
return `List<${storedSchemaTypeName(context, type.entryType, environment)}>`;
|
|
79519
|
+
case "dictionary": {
|
|
79520
|
+
const keyType = type.keyEnumId === null ? "string" : stringField3(context.enums.get(type.keyEnumId) ?? {}, "name");
|
|
79521
|
+
return `Dictionary<${keyType}, ${storedSchemaTypeName(context, type.entryType, environment)}>`;
|
|
79522
|
+
}
|
|
79523
|
+
case "bool":
|
|
79524
|
+
case "int":
|
|
79525
|
+
case "string":
|
|
79526
|
+
case "float":
|
|
79527
|
+
case "decimal":
|
|
79528
|
+
return type.kind;
|
|
79529
|
+
case "sprite":
|
|
79530
|
+
return "SpriteInfo";
|
|
79531
|
+
case "audio":
|
|
79532
|
+
return "AudioClipInfo";
|
|
79533
|
+
case "vector2":
|
|
79534
|
+
return "Vector2";
|
|
79535
|
+
case "vector2Int":
|
|
79536
|
+
return "Vector2Int";
|
|
79537
|
+
case "vector3":
|
|
79538
|
+
return "Vector3";
|
|
79539
|
+
case "vector3Int":
|
|
79540
|
+
return "Vector3Int";
|
|
79541
|
+
case "color":
|
|
79542
|
+
return "Color";
|
|
79543
|
+
case "enum":
|
|
79544
|
+
return stringField3(context.enums.get(type.enumId) ?? {}, "name");
|
|
79545
|
+
case "lookup":
|
|
79546
|
+
return storedSchemaTypeName(context, type.entryType, environment);
|
|
79547
|
+
case "dialogueLookup":
|
|
79548
|
+
return "Dialogue";
|
|
79549
|
+
case "delegate":
|
|
79550
|
+
return "object";
|
|
79551
|
+
case "null":
|
|
79552
|
+
return "null";
|
|
79553
|
+
}
|
|
79554
|
+
}
|
|
79290
79555
|
function storedTypedRowSource(context, type, valueId, environment, visited) {
|
|
79291
79556
|
const symbol = context.symbolsByValueId.get(valueId);
|
|
79292
79557
|
if (symbol !== void 0) return symbol;
|
|
@@ -85113,7 +85378,11 @@ import {
|
|
|
85113
85378
|
} from "node:fs";
|
|
85114
85379
|
import { dirname as dirname5, join as join9 } from "node:path";
|
|
85115
85380
|
async function runPull(workspace, options) {
|
|
85116
|
-
|
|
85381
|
+
if (options.reset) {
|
|
85382
|
+
await runResetPull(workspace);
|
|
85383
|
+
return;
|
|
85384
|
+
}
|
|
85385
|
+
const destructive = options.force;
|
|
85117
85386
|
const hasBaseline = Object.keys(workspace.state.records).length > 0;
|
|
85118
85387
|
let localByKey = /* @__PURE__ */ new Map();
|
|
85119
85388
|
let localStatus = null;
|
|
@@ -85160,37 +85429,6 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
|
|
|
85160
85429
|
}
|
|
85161
85430
|
}
|
|
85162
85431
|
const document = await fetchProjectDocument(workspace);
|
|
85163
|
-
if (options.reset) {
|
|
85164
|
-
const previousRecords = workspace.state.records;
|
|
85165
|
-
const binaries = await pullProjectBinariesV4({
|
|
85166
|
-
workspace,
|
|
85167
|
-
document,
|
|
85168
|
-
previousRecords,
|
|
85169
|
-
destructive: true
|
|
85170
|
-
});
|
|
85171
|
-
const reset = resetWorkspaceToProjectSourcesV4(workspace, document, {
|
|
85172
|
-
regenerateSourceNames: true
|
|
85173
|
-
});
|
|
85174
|
-
for (const [key, state] of binaries.states) {
|
|
85175
|
-
const record3 = workspace.state.records[key];
|
|
85176
|
-
if (record3) record3.projectBinary = state;
|
|
85177
|
-
}
|
|
85178
|
-
try {
|
|
85179
|
-
const convex = await createConvexClient(workspace);
|
|
85180
|
-
const signal = await convex.query(api2.projectExportData.schemaSignal, {
|
|
85181
|
-
projectId: workspace.config.projectId,
|
|
85182
|
-
versionId: workspace.config.versionId
|
|
85183
|
-
});
|
|
85184
|
-
workspace.state.headTransactionHash = signal?.transactionHash ?? null;
|
|
85185
|
-
} catch {
|
|
85186
|
-
workspace.state.headTransactionHash = null;
|
|
85187
|
-
}
|
|
85188
|
-
writeWorkspaceState(workspace.root, workspace.state);
|
|
85189
|
-
console.log(
|
|
85190
|
-
`Pulled ${document.records.size} records \u2014 ${reset.written} file(s) updated \u2014 ${reset.removed} removed.`
|
|
85191
|
-
);
|
|
85192
|
-
return;
|
|
85193
|
-
}
|
|
85194
85432
|
const plans = /* @__PURE__ */ new Map();
|
|
85195
85433
|
let mergedCount = 0;
|
|
85196
85434
|
let conflictCount = 0;
|
|
@@ -85313,6 +85551,46 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
|
|
|
85313
85551
|
regenerateSourceNames: destructive || options.regenerateSourceNames
|
|
85314
85552
|
});
|
|
85315
85553
|
}
|
|
85554
|
+
async function runResetPull(workspace) {
|
|
85555
|
+
const progress = spinner("Pulling project snapshot\u2026");
|
|
85556
|
+
try {
|
|
85557
|
+
const document = await fetchProjectDocument(workspace);
|
|
85558
|
+
progress.update("Downloading project files\u2026");
|
|
85559
|
+
const previousRecords = workspace.state.records;
|
|
85560
|
+
const binaries = await pullProjectBinariesV4({
|
|
85561
|
+
workspace,
|
|
85562
|
+
document,
|
|
85563
|
+
previousRecords,
|
|
85564
|
+
destructive: true
|
|
85565
|
+
});
|
|
85566
|
+
progress.update("Regenerating Neo sources\u2026");
|
|
85567
|
+
const reset = resetWorkspaceToProjectSourcesV4(workspace, document, {
|
|
85568
|
+
regenerateSourceNames: true
|
|
85569
|
+
});
|
|
85570
|
+
for (const [key, state] of binaries.states) {
|
|
85571
|
+
const record3 = workspace.state.records[key];
|
|
85572
|
+
if (record3) record3.projectBinary = state;
|
|
85573
|
+
}
|
|
85574
|
+
progress.update("Finalizing pull state\u2026");
|
|
85575
|
+
try {
|
|
85576
|
+
const convex = await createConvexClient(workspace);
|
|
85577
|
+
const signal = await convex.query(api2.projectExportData.schemaSignal, {
|
|
85578
|
+
projectId: workspace.config.projectId,
|
|
85579
|
+
versionId: workspace.config.versionId
|
|
85580
|
+
});
|
|
85581
|
+
workspace.state.headTransactionHash = signal?.transactionHash ?? null;
|
|
85582
|
+
} catch {
|
|
85583
|
+
workspace.state.headTransactionHash = null;
|
|
85584
|
+
}
|
|
85585
|
+
writeWorkspaceState(workspace.root, workspace.state);
|
|
85586
|
+
progress.succeed(
|
|
85587
|
+
`Pulled ${document.records.size} records \u2014 ${reset.written} file(s) updated \u2014 ${reset.removed} removed.`
|
|
85588
|
+
);
|
|
85589
|
+
} catch (error) {
|
|
85590
|
+
progress.fail("Pull failed.");
|
|
85591
|
+
throw error;
|
|
85592
|
+
}
|
|
85593
|
+
}
|
|
85316
85594
|
async function finishFormat4Pull(args) {
|
|
85317
85595
|
const {
|
|
85318
85596
|
workspace,
|
package/package.json
CHANGED
|
@@ -73,7 +73,7 @@ wrappers.
|
|
|
73
73
|
The marker near the top of `SKILL.md` must exactly match the package version:
|
|
74
74
|
|
|
75
75
|
```html
|
|
76
|
-
<!-- reviewed-through-cli: 0.21.
|
|
76
|
+
<!-- reviewed-through-cli: 0.21.1 -->
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
The quoted version above is checked too, so this instruction cannot go stale
|