@neocompose/cli 0.89.3 → 0.89.4

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.89.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 6136cce: Fix missing compiled child initializer bodies during offline status and export.
8
+ Refresh lazy compiler indexes after replacing initializer bodies, and compile
9
+ historical and edited constructor arguments in their respective document contexts.
10
+ Report remaining initialization failures at the authored child location.
11
+
12
+ Allow constructor initializers to use newly added local images and audio files
13
+ before upload while retaining local binary validation.
14
+
3
15
  ## 0.89.3
4
16
 
5
17
  ### Patch Changes
@@ -19377,7 +19377,7 @@ var init_registry = __esm({
19377
19377
  "../packages/manifest/schema-contract/registry.mjs"() {
19378
19378
  "use strict";
19379
19379
  PROJECT_SCHEMA_CONTRACT = Object.freeze({
19380
- cliVersion: "0.89.3",
19380
+ cliVersion: "0.89.4",
19381
19381
  projectFileUploadBatchSize: 32,
19382
19382
  documentRecords: {
19383
19383
  member: {
@@ -133886,6 +133886,10 @@ function documentInitializerCompiler(document, compilationProject) {
133886
133886
  );
133887
133887
  };
133888
133888
  }
133889
+ function invalidateDocumentInitializerCompilationSites(document) {
133890
+ documentMemberCompilationIndexes.delete(document);
133891
+ documentValueInitializerCompilationSites.delete(document);
133892
+ }
133889
133893
  function valueInitializerCompilationSites(document) {
133890
133894
  const cached = documentValueInitializerCompilationSites.get(document);
133891
133895
  if (cached !== void 0) return cached;
@@ -158927,6 +158931,7 @@ function compilePulledProjectDocumentForEvaluationV4(document, compilationProjec
158927
158931
  throw error;
158928
158932
  }
158929
158933
  }
158934
+ invalidateDocumentInitializerCompilationSites(document);
158930
158935
  return compiled;
158931
158936
  }
158932
158937
  function withoutMaterializedInstanceFields(row) {
@@ -159341,6 +159346,20 @@ var init_source_base_cache = __esm({
159341
159346
  }
159342
159347
  });
159343
159348
 
159349
+ // src/local-project-file-storage.ts
159350
+ function localStagedProjectFileStorage(recordId) {
159351
+ return {
159352
+ status: "uploaded",
159353
+ storageKey: `local-candidate/${recordId}`,
159354
+ storageETag: "local-candidate"
159355
+ };
159356
+ }
159357
+ var init_local_project_file_storage = __esm({
159358
+ "src/local-project-file-storage.ts"() {
159359
+ "use strict";
159360
+ }
159361
+ });
159362
+
159344
159363
  // src/project-source/listener-emission.ts
159345
159364
  function emitListenerPositions(args) {
159346
159365
  const root = args.rows.get(args.rootId);
@@ -171074,6 +171093,8 @@ var init_value_sources = __esm({
171074
171093
 
171075
171094
  // src/project-source/runtime-diagnostic.ts
171076
171095
  function initializerErrorValueId(error) {
171096
+ if (error instanceof UncompiledInitializerRuntimeError)
171097
+ return error.valueId ?? error.initializerValueId;
171077
171098
  if (error instanceof NSGetterRuntimeError) return error.initializerValueId;
171078
171099
  if (error instanceof StoredClosureCaptureError) return error.valueId;
171079
171100
  if (error instanceof NeoScriptBodyCompileError)
@@ -171081,6 +171102,8 @@ function initializerErrorValueId(error) {
171081
171102
  return void 0;
171082
171103
  }
171083
171104
  function initializerErrorOwnerId(error) {
171105
+ if (error instanceof UncompiledInitializerRuntimeError)
171106
+ return error.sourceOwnerId ?? error.memberId ?? void 0;
171084
171107
  if (error instanceof NSGetterRuntimeError) return error.sourceOwnerId;
171085
171108
  if (error instanceof NeoScriptBodyCompileError && error.valueId === null)
171086
171109
  return error.memberId;
@@ -171090,8 +171113,15 @@ function initializerErrorSiteIds(error, recordId = (id2) => id2) {
171090
171113
  const ownerId = initializerErrorOwnerId(error);
171091
171114
  const valueId = initializerErrorValueId(error);
171092
171115
  const ids = [];
171116
+ if (error instanceof UncompiledInitializerRuntimeError && valueId !== void 0)
171117
+ ids.push(recordId(valueId));
171093
171118
  if (ownerId !== void 0) ids.push(recordId(ownerId));
171094
171119
  if (valueId === void 0) return ids;
171120
+ if (error instanceof UncompiledInitializerRuntimeError) {
171121
+ if (error.initializerValueId !== void 0)
171122
+ ids.push(recordId(error.initializerValueId));
171123
+ return ids;
171124
+ }
171095
171125
  if (error instanceof NeoScriptBodyCompileError && error.argument !== null)
171096
171126
  ids.push(constructorArgumentSiteId(recordId(valueId), error.argument.key));
171097
171127
  ids.push(recordId(valueId));
@@ -171978,6 +172008,87 @@ function reconcileMaterializedInitializersV4(args) {
171978
172008
  }
171979
172009
  replayRows.set(id2, row);
171980
172010
  }
172011
+ assertPulledConstructorsCompiled(replayDocument, replayContext);
172012
+ currentRows ??= new Map(
172013
+ currentState().document.values.map((row) => [row.id, row])
172014
+ );
172015
+ if (compareConstruction === void 0) {
172016
+ const storedDocument = currentState().document;
172017
+ compilePulledUncompiledConstructorsV4(storedDocument);
172018
+ assertPulledConstructorsCompiled(storedDocument);
172019
+ compareConstruction = createConstructionReplayComparer(
172020
+ new EffectiveValueReader({
172021
+ ...storedDocument,
172022
+ initializerCompiler: documentInitializerCompiler(storedDocument)
172023
+ }),
172024
+ (root, member) => {
172025
+ return storedOwnedValues().collect({
172026
+ rootIds: [root.id],
172027
+ rootMembers: /* @__PURE__ */ new Map([[root.id, member]])
172028
+ });
172029
+ },
172030
+ new EffectiveValueReader({
172031
+ ...replayDocument,
172032
+ initializerCompiler: documentInitializerCompiler(
172033
+ replayDocument,
172034
+ compilationProject
172035
+ )
172036
+ })
172037
+ );
172038
+ }
172039
+ const replay = replayRows.get(reconciliation.valueId);
172040
+ if (replay === void 0) {
172041
+ throw new Error(
172042
+ `Construction replay for value "${reconciliation.valueId}" produced no root row.`
172043
+ );
172044
+ }
172045
+ const currentRoot = currentRows.get(reconciliation.valueId);
172046
+ if (currentRoot === void 0) {
172047
+ throw new Error(
172048
+ `Cannot reconcile stored construction for value "${reconciliation.valueId}": its stored row is missing.`
172049
+ );
172050
+ }
172051
+ if (replay.classId !== currentRoot.classId) {
172052
+ const position = composeReferenceSitePosition(
172053
+ reconciliation.site,
172054
+ args.sourceTextByUri
172055
+ );
172056
+ failures.push(
172057
+ new SchemaSourceError(
172058
+ `construction-arguments-conflict: Value "${reconciliation.valueId}" is already materialized as another class. Delete and recreate the value to change its class.`,
172059
+ position.file,
172060
+ position.line,
172061
+ position.column,
172062
+ "construction-arguments-conflict"
172063
+ )
172064
+ );
172065
+ continue;
172066
+ }
172067
+ if (reconciliation.kind === "storedArguments" && compareConstruction({
172068
+ currentRoot,
172069
+ currentArguments: reconciliation.storedConstructorArgs,
172070
+ replayRoot: replay,
172071
+ replayRows,
172072
+ rootMember: owner
172073
+ })) {
172074
+ continue;
172075
+ }
172076
+ const stored = currentState().records.get(
172077
+ `value:${reconciliation.valueId}`
172078
+ )?.data;
172079
+ if (!isObjectRecord(stored)) {
172080
+ throw new Error(
172081
+ `Cannot rebuild construction for value "${reconciliation.valueId}": its pulled row is missing.`
172082
+ );
172083
+ }
172084
+ rebuilds.push({
172085
+ valueId: reconciliation.valueId,
172086
+ row: rebuiltConstructionRow(stored, reconciliation.code),
172087
+ ownedValueIds: storedOwnedValues().collect({
172088
+ rootIds: [reconciliation.valueId],
172089
+ rootMembers: /* @__PURE__ */ new Map([[reconciliation.valueId, owner]])
172090
+ })
172091
+ });
171981
172092
  } catch (error) {
171982
172093
  if (error instanceof NSGetterRuntimeError && error.source === void 0 && args.forceRecompile !== true) {
171983
172094
  return reconcileMaterializedInitializersV4({
@@ -171990,85 +172101,13 @@ function reconcileMaterializedInitializersV4(args) {
171990
172101
  failures.push(
171991
172102
  initializerRuntimeDiagnostic(
171992
172103
  error,
171993
- /* @__PURE__ */ new Map([[reconciliation.valueId, reconciliation.site]]),
172104
+ args.initializerSites ?? /* @__PURE__ */ new Map([[reconciliation.valueId, reconciliation.site]]),
171994
172105
  args.sourceTextByUri,
171995
172106
  args.analysis
171996
172107
  )
171997
172108
  );
171998
172109
  continue;
171999
172110
  }
172000
- assertPulledConstructorsCompiled(replayDocument, replayContext);
172001
- currentRows ??= new Map(
172002
- currentState().document.values.map((row) => [row.id, row])
172003
- );
172004
- if (compareConstruction === void 0) {
172005
- const storedDocument = currentState().document;
172006
- compilePulledUncompiledConstructorsV4(storedDocument);
172007
- assertPulledConstructorsCompiled(storedDocument);
172008
- compareConstruction = createConstructionReplayComparer(
172009
- new EffectiveValueReader(storedDocument),
172010
- (root, member) => {
172011
- return storedOwnedValues().collect({
172012
- rootIds: [root.id],
172013
- rootMembers: /* @__PURE__ */ new Map([[root.id, member]])
172014
- });
172015
- },
172016
- new EffectiveValueReader(replayDocument)
172017
- );
172018
- }
172019
- const replay = replayRows.get(reconciliation.valueId);
172020
- if (replay === void 0) {
172021
- throw new Error(
172022
- `Construction replay for value "${reconciliation.valueId}" produced no root row.`
172023
- );
172024
- }
172025
- const currentRoot = currentRows.get(reconciliation.valueId);
172026
- if (currentRoot === void 0) {
172027
- throw new Error(
172028
- `Cannot reconcile stored construction for value "${reconciliation.valueId}": its stored row is missing.`
172029
- );
172030
- }
172031
- if (replay.classId !== currentRoot.classId) {
172032
- const position = composeReferenceSitePosition(
172033
- reconciliation.site,
172034
- args.sourceTextByUri
172035
- );
172036
- failures.push(
172037
- new SchemaSourceError(
172038
- `construction-arguments-conflict: Value "${reconciliation.valueId}" is already materialized as another class. Delete and recreate the value to change its class.`,
172039
- position.file,
172040
- position.line,
172041
- position.column,
172042
- "construction-arguments-conflict"
172043
- )
172044
- );
172045
- continue;
172046
- }
172047
- if (reconciliation.kind === "storedArguments" && compareConstruction({
172048
- currentRoot,
172049
- currentArguments: reconciliation.storedConstructorArgs,
172050
- replayRoot: replay,
172051
- replayRows,
172052
- rootMember: owner
172053
- })) {
172054
- continue;
172055
- }
172056
- const stored = currentState().records.get(
172057
- `value:${reconciliation.valueId}`
172058
- )?.data;
172059
- if (!isObjectRecord(stored)) {
172060
- throw new Error(
172061
- `Cannot rebuild construction for value "${reconciliation.valueId}": its pulled row is missing.`
172062
- );
172063
- }
172064
- rebuilds.push({
172065
- valueId: reconciliation.valueId,
172066
- row: rebuiltConstructionRow(stored, reconciliation.code),
172067
- ownedValueIds: storedOwnedValues().collect({
172068
- rootIds: [reconciliation.valueId],
172069
- rootMembers: /* @__PURE__ */ new Map([[reconciliation.valueId, owner]])
172070
- })
172071
- });
172072
172111
  }
172073
172112
  return { failures, rebuilds };
172074
172113
  }
@@ -172541,6 +172580,7 @@ function prospectiveInitializerRecordsV4(args) {
172541
172580
  deleted: false,
172542
172581
  data: change.operation === "create" && isObjectRecord(change.nextData) ? {
172543
172582
  ...change.nextData,
172583
+ ...change.recordKind === "project-file" && change.nextData.status === "pending-upload" ? localStagedProjectFileStorage(change.recordId) : {},
172544
172584
  projectId: args.workspace.config.projectId,
172545
172585
  createdAt: 0,
172546
172586
  updatedAt: 0
@@ -172644,6 +172684,7 @@ var cleanRetainedCode, pulledStateDocuments;
172644
172684
  var init_local_initializer_materialization = __esm({
172645
172685
  "src/project-source/local-initializer-materialization.ts"() {
172646
172686
  "use strict";
172687
+ init_local_project_file_storage();
172647
172688
  init_immutable_json3();
172648
172689
  init_lexer();
172649
172690
  init_init_source();
@@ -180232,6 +180273,7 @@ function computeStatus(workspace, options, conflictedFiles, parseErrors, parseWa
180232
180273
  changes,
180233
180274
  authoredValueSeeds,
180234
180275
  reconciliations: valueLowerRegistry.initializerReconciliations,
180276
+ initializerSites: valueLowerRegistry.initializerSites,
180235
180277
  canonicalConstructions: valueLowerRegistry.materializedConstructorExpressions,
180236
180278
  localizedTextDependencies,
180237
180279
  manifest,
@@ -180251,11 +180293,11 @@ function computeStatus(workspace, options, conflictedFiles, parseErrors, parseWa
180251
180293
  });
180252
180294
  } catch (error) {
180253
180295
  parseErrors.push(
180254
- error instanceof SchemaSourceError ? error : new SchemaSourceError(
180255
- error instanceof Error ? error.message : String(error),
180256
- "<initializer-materialization>",
180257
- 1,
180258
- 1
180296
+ initializerRuntimeDiagnostic(
180297
+ error,
180298
+ valueLowerRegistry.initializerSites,
180299
+ new Map(sourceEntries.map((entry) => [entry.relPath, entry.source])),
180300
+ projectAnalysisV4
180259
180301
  )
180260
180302
  );
180261
180303
  }
@@ -221322,13 +221364,6 @@ function completeLocallyStagedProjectFileChanges(args) {
221322
221364
  return completed;
221323
221365
  });
221324
221366
  }
221325
- function localStagedProjectFileStorage(recordId) {
221326
- return {
221327
- status: "uploaded",
221328
- storageKey: `local-candidate/${recordId}`,
221329
- storageETag: "local-candidate"
221330
- };
221331
- }
221332
221367
  function transportChangesForStatus(status) {
221333
221368
  return status.changes.map((change) => ({
221334
221369
  recordKind: change.recordKind,
@@ -223178,6 +223213,7 @@ var compileNSVoidBody2, compileNSFunction2, compileNSGetter2, compileNSSetter2,
223178
223213
  var init_push = __esm({
223179
223214
  "src/commands/push.ts"() {
223180
223215
  "use strict";
223216
+ init_local_project_file_storage();
223181
223217
  init_extension_source_preservation();
223182
223218
  init_workspace_lock();
223183
223219
  init_export_state();
@@ -238663,7 +238699,7 @@ var releaseWorkspaceLock = () => void 0;
238663
238699
  async function main() {
238664
238700
  const args = parseArgs(process.argv.slice(2));
238665
238701
  if (args.command === "--version") {
238666
- console.log("0.89.3");
238702
+ console.log("0.89.4");
238667
238703
  return;
238668
238704
  }
238669
238705
  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.89.3",
3
+ "version": "0.89.4",
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.89.3 -->
12
+ <!-- reviewed-through-cli: 0.89.4 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -109,7 +109,7 @@ The marker near the top of `SKILL.md` must exactly match the package version,
109
109
  and this quoted copy is checked too:
110
110
 
111
111
  ```html
112
- <!-- reviewed-through-cli: 0.89.3 -->
112
+ <!-- reviewed-through-cli: 0.89.4 -->
113
113
  ```
114
114
 
115
115
  Keep this skill on current behavior. Upgrade steps, rollout prerequisites,
@@ -20,6 +20,8 @@ Immutable construction, and edits to stored constructions.
20
20
  - Editing a header constructor recompiles dependent child initializers in the
21
21
  new scope, including unchanged children with explicit IDs. Keep those IDs
22
22
  when adding an optional parameter and updating the child expression.
23
+ Status and export compile these dependencies locally, including children
24
+ reached while comparing stored constructor arguments.
23
25
  - Omitted constructor fields use their defaults. Writable collection defaults
24
26
  belong to each instance. Fields without defaults stay absent, and `null`
25
27
  arguments to generated member-wise constructors mean omission.
@@ -57,6 +57,8 @@ AudioClipRegistry AudioClips = new() {
57
57
  create a pending file with a provisional symbol. Status, diff, and dry-run
58
58
  don't rewrite the registry; a successful push creates the record, uploads
59
59
  verified bytes, and writes its declaration and ID.
60
+ Initializers may use these local files during status and offline export before
61
+ upload. Missing local bytes still block validation.
60
62
  - Remove the declaration to delete a file. A declaration whose binary is
61
63
  missing is an error.
62
64
  - Pull keeps unchanged entries, comments, and order; new remote entries