@neocompose/cli 0.19.1 → 0.19.2

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.
Files changed (2) hide show
  1. package/dist/neo.mjs +220 -35
  2. package/package.json +1 -1
package/dist/neo.mjs CHANGED
@@ -36559,33 +36559,33 @@ var MemberKind;
36559
36559
  var init_member_kind_enum = __esm({
36560
36560
  "../src/models/members/member-kind-enum.ts"() {
36561
36561
  "use strict";
36562
- MemberKind = /* @__PURE__ */ ((MemberKind10) => {
36563
- MemberKind10[MemberKind10["Null"] = 0] = "Null";
36564
- MemberKind10[MemberKind10["Bool"] = 1] = "Bool";
36565
- MemberKind10[MemberKind10["Int"] = 2] = "Int";
36566
- MemberKind10[MemberKind10["String"] = 3] = "String";
36567
- MemberKind10[MemberKind10["Float"] = 4] = "Float";
36568
- MemberKind10[MemberKind10["Dictionary"] = 5] = "Dictionary";
36569
- MemberKind10[MemberKind10["List"] = 6] = "List";
36570
- MemberKind10[MemberKind10["Class"] = 7] = "Class";
36571
- MemberKind10[MemberKind10["Enum"] = 8] = "Enum";
36572
- MemberKind10[MemberKind10["Lookup"] = 9] = "Lookup";
36573
- MemberKind10[MemberKind10["NSProperty"] = 10] = "NSProperty";
36574
- MemberKind10[MemberKind10["Sprite"] = 11] = "Sprite";
36575
- MemberKind10[MemberKind10["Audio"] = 12] = "Audio";
36576
- MemberKind10[MemberKind10["Function"] = 13] = "Function";
36577
- MemberKind10[MemberKind10["Vector2"] = 14] = "Vector2";
36578
- MemberKind10[MemberKind10["Vector2Int"] = 15] = "Vector2Int";
36579
- MemberKind10[MemberKind10["Vector3"] = 16] = "Vector3";
36580
- MemberKind10[MemberKind10["Vector3Int"] = 17] = "Vector3Int";
36581
- MemberKind10[MemberKind10["DialogueLookup"] = 18] = "DialogueLookup";
36582
- MemberKind10[MemberKind10["Color"] = 19] = "Color";
36583
- MemberKind10[MemberKind10["Decimal"] = 20] = "Decimal";
36584
- MemberKind10[MemberKind10["Generic"] = 21] = "Generic";
36585
- MemberKind10[MemberKind10["Interface"] = 22] = "Interface";
36586
- MemberKind10[MemberKind10["NSFunction"] = 23] = "NSFunction";
36587
- MemberKind10[MemberKind10["FunctionRef"] = 24] = "FunctionRef";
36588
- return MemberKind10;
36562
+ MemberKind = /* @__PURE__ */ ((MemberKind11) => {
36563
+ MemberKind11[MemberKind11["Null"] = 0] = "Null";
36564
+ MemberKind11[MemberKind11["Bool"] = 1] = "Bool";
36565
+ MemberKind11[MemberKind11["Int"] = 2] = "Int";
36566
+ MemberKind11[MemberKind11["String"] = 3] = "String";
36567
+ MemberKind11[MemberKind11["Float"] = 4] = "Float";
36568
+ MemberKind11[MemberKind11["Dictionary"] = 5] = "Dictionary";
36569
+ MemberKind11[MemberKind11["List"] = 6] = "List";
36570
+ MemberKind11[MemberKind11["Class"] = 7] = "Class";
36571
+ MemberKind11[MemberKind11["Enum"] = 8] = "Enum";
36572
+ MemberKind11[MemberKind11["Lookup"] = 9] = "Lookup";
36573
+ MemberKind11[MemberKind11["NSProperty"] = 10] = "NSProperty";
36574
+ MemberKind11[MemberKind11["Sprite"] = 11] = "Sprite";
36575
+ MemberKind11[MemberKind11["Audio"] = 12] = "Audio";
36576
+ MemberKind11[MemberKind11["Function"] = 13] = "Function";
36577
+ MemberKind11[MemberKind11["Vector2"] = 14] = "Vector2";
36578
+ MemberKind11[MemberKind11["Vector2Int"] = 15] = "Vector2Int";
36579
+ MemberKind11[MemberKind11["Vector3"] = 16] = "Vector3";
36580
+ MemberKind11[MemberKind11["Vector3Int"] = 17] = "Vector3Int";
36581
+ MemberKind11[MemberKind11["DialogueLookup"] = 18] = "DialogueLookup";
36582
+ MemberKind11[MemberKind11["Color"] = 19] = "Color";
36583
+ MemberKind11[MemberKind11["Decimal"] = 20] = "Decimal";
36584
+ MemberKind11[MemberKind11["Generic"] = 21] = "Generic";
36585
+ MemberKind11[MemberKind11["Interface"] = 22] = "Interface";
36586
+ MemberKind11[MemberKind11["NSFunction"] = 23] = "NSFunction";
36587
+ MemberKind11[MemberKind11["FunctionRef"] = 24] = "FunctionRef";
36588
+ return MemberKind11;
36589
36589
  })(MemberKind || {});
36590
36590
  }
36591
36591
  });
@@ -40457,14 +40457,18 @@ function isEnumOptionsRecord(value) {
40457
40457
  }
40458
40458
  return true;
40459
40459
  }
40460
+ function isOptionalOptionKeyOrder(value) {
40461
+ if (value === void 0) return true;
40462
+ if (!Array.isArray(value)) return false;
40463
+ return value.every((key) => typeof key === "string");
40464
+ }
40460
40465
  function isEnumBase(value) {
40461
40466
  const v = value;
40462
40467
  if (!v) return false;
40463
40468
  if (typeof v.name !== "string") return false;
40464
40469
  if (!isValidDocsText(v.docsText)) return false;
40465
40470
  if (!isEnumOptionsRecord(v.options)) return false;
40466
- if (!Array.isArray(v.optionKeyOrder)) return false;
40467
- if (!v.optionKeyOrder.every((key) => typeof key === "string")) return false;
40471
+ if (!isOptionalOptionKeyOrder(v.optionKeyOrder)) return false;
40468
40472
  if (v.system !== void 0 && v.system !== null) {
40469
40473
  return isSystemMetadata(v.system);
40470
40474
  }
@@ -40473,7 +40477,7 @@ function isEnumBase(value) {
40473
40477
  function getEnumOptionKeyOrder(enumDef) {
40474
40478
  const seen = /* @__PURE__ */ new Set();
40475
40479
  const result = [];
40476
- for (const optionId of enumDef.optionKeyOrder) {
40480
+ for (const optionId of enumDef.optionKeyOrder ?? []) {
40477
40481
  if (!Object.prototype.hasOwnProperty.call(enumDef.options, optionId)) {
40478
40482
  continue;
40479
40483
  }
@@ -64563,7 +64567,7 @@ function createNeoScriptProject(context) {
64563
64567
  enumHeader,
64564
64568
  enumDefinition.name
64565
64569
  ),
64566
- members: safeEnumOptionOrder(enumDefinition).map((optionId, index) => {
64570
+ members: getEnumOptionKeyOrder(enumDefinition).map((optionId, index) => {
64567
64571
  const option = enumDefinition.options[optionId];
64568
64572
  const optionName = option?.name ?? optionId;
64569
64573
  return {
@@ -64615,9 +64619,6 @@ function virtualCSharpIdentifier(value) {
64615
64619
  const prefixed = /^[A-Za-z_]/.test(replaced) ? replaced : `_${replaced}`;
64616
64620
  return prefixed.length > 0 ? prefixed : "_";
64617
64621
  }
64618
- function safeEnumOptionOrder(enumDefinition) {
64619
- return Array.isArray(enumDefinition.optionKeyOrder) ? getEnumOptionKeyOrder(enumDefinition) : Object.keys(enumDefinition.options);
64620
- }
64621
64622
  function classToLanguageType(schemaClass2, context) {
64622
64623
  let chain;
64623
64624
  try {
@@ -79236,6 +79237,150 @@ var init_trusted_commit_verification = __esm({
79236
79237
  }
79237
79238
  });
79238
79239
 
79240
+ // ../src/models/classes/world-layer-link-target.ts
79241
+ var init_world_layer_link_target = __esm({
79242
+ "../src/models/classes/world-layer-link-target.ts"() {
79243
+ "use strict";
79244
+ init_classes();
79245
+ init_core();
79246
+ init_project2();
79247
+ }
79248
+ });
79249
+
79250
+ // ../src/models/project/world-content-sidecar-validation.ts
79251
+ var init_world_content_sidecar_validation = __esm({
79252
+ "../src/models/project/world-content-sidecar-validation.ts"() {
79253
+ "use strict";
79254
+ init_classes();
79255
+ init_world_layer_link_target();
79256
+ init_core();
79257
+ init_internal_record_relations();
79258
+ }
79259
+ });
79260
+
79261
+ // ../src/models/project-file-authoring-identifiers.ts
79262
+ function isValidProjectFileAuthoringIdentifier(value) {
79263
+ return isValidProjectSourceIdentifier(value);
79264
+ }
79265
+ function assertProjectFileAuthoringIdentifier(value, label) {
79266
+ if (isValidProjectFileAuthoringIdentifier(value)) return;
79267
+ throw new Error(
79268
+ `${label} ${JSON.stringify(value)} must be a valid Neo identifier. Use letters, digits, and underscores, begin with a letter or underscore, and do not use a reserved Neo name.`
79269
+ );
79270
+ }
79271
+ function assertProjectFileAuthoringRecordIdentifiers(recordKind, data) {
79272
+ if (recordKind !== "unity-texture-template" && recordKind !== "unity-audio-clip-template") {
79273
+ return;
79274
+ }
79275
+ if (!isObjectRecord3(data) || typeof data.name !== "string") return;
79276
+ const label = recordKind === "unity-texture-template" ? "Unity texture template name" : "Unity audio clip template name";
79277
+ assertProjectFileAuthoringIdentifier(data.name, label);
79278
+ }
79279
+ function isObjectRecord3(value) {
79280
+ return typeof value === "object" && value !== null && !Array.isArray(value);
79281
+ }
79282
+ var init_project_file_authoring_identifiers = __esm({
79283
+ "../src/models/project-file-authoring-identifiers.ts"() {
79284
+ "use strict";
79285
+ init_project_source_identifiers();
79286
+ }
79287
+ });
79288
+
79289
+ // ../src/database/project-version-validation.ts
79290
+ function validateProjectRecordByKind(recordKind, data) {
79291
+ if (recordKind === ProjectRecordKind.Project) {
79292
+ if (isProject(data)) return;
79293
+ }
79294
+ if (recordKind === ProjectRecordKind.Member) {
79295
+ if (isAnyMember(data)) return;
79296
+ }
79297
+ if (recordKind === ProjectRecordKind.Value) {
79298
+ if (isMemberValue(data)) return;
79299
+ }
79300
+ if (recordKind === ProjectRecordKind.Class) {
79301
+ if (isNeoSchemaClass(data)) return;
79302
+ }
79303
+ if (recordKind === ProjectRecordKind.Constructor) {
79304
+ if (isNeoClassConstructor(data)) return;
79305
+ if (isNeoClassConstructorBase(data)) return;
79306
+ }
79307
+ if (recordKind === ProjectRecordKind.InternalRecordRelation) {
79308
+ if (isInternalRecordRelation(data)) return;
79309
+ }
79310
+ if (recordKind === ProjectRecordKind.Enum) {
79311
+ if (isEnum(data)) return;
79312
+ }
79313
+ if (recordKind === ProjectRecordKind.Interface) {
79314
+ if (isNeoInterface(data)) return;
79315
+ }
79316
+ if (recordKind === ProjectRecordKind.Dialogue) {
79317
+ if (isDialogueRecord(data)) return;
79318
+ if (isDialogue(data)) return;
79319
+ }
79320
+ if (recordKind === ProjectRecordKind.DialogueNode) {
79321
+ if (isDialogueNodeRecord(data)) return;
79322
+ }
79323
+ if (recordKind === ProjectRecordKind.DialogueGroup) {
79324
+ if (isAnyDialogueGroup(data)) return;
79325
+ }
79326
+ if (recordKind === ProjectRecordKind.PriorityGroup) {
79327
+ if (isPriorityGroup(data)) return;
79328
+ }
79329
+ if (recordKind === ProjectRecordKind.ProjectFile) {
79330
+ if (isProjectFile(data)) return;
79331
+ }
79332
+ if (recordKind === ProjectRecordKind.UnityTextureTemplate) {
79333
+ if (isUnityTexture2DImportSettingsTemplate(data)) {
79334
+ assertProjectFileAuthoringRecordIdentifiers(recordKind, data);
79335
+ return;
79336
+ }
79337
+ }
79338
+ if (recordKind === ProjectRecordKind.UnityAudioClipTemplate) {
79339
+ if (isUnityAudioClipImportSettingsTemplate(data)) {
79340
+ assertProjectFileAuthoringRecordIdentifiers(recordKind, data);
79341
+ return;
79342
+ }
79343
+ }
79344
+ if (recordKind === ProjectRecordKind.LocalizationConfig) {
79345
+ if (isProjectLocalizationConfig(data)) return;
79346
+ }
79347
+ if (recordKind === ProjectRecordKind.LocalizationStatus) {
79348
+ if (isLocalizationStatus(data)) return;
79349
+ }
79350
+ if (recordKind === ProjectRecordKind.LocalizedText) {
79351
+ if (isLocalizedText(data)) return;
79352
+ }
79353
+ if (recordKind === ProjectRecordKind.Migration) {
79354
+ if (isProjectMigration(data)) return;
79355
+ }
79356
+ const shape = typeof data === "object" && data !== null ? `keys [${Object.keys(data).sort().join(", ")}]` : `type ${typeof data}`;
79357
+ throw new Error(
79358
+ `Project record data failed validation for record kind "${recordKind}" (${shape}).`
79359
+ );
79360
+ }
79361
+ var init_project_version_validation = __esm({
79362
+ "../src/database/project-version-validation.ts"() {
79363
+ "use strict";
79364
+ init_project2();
79365
+ init_internal_record_relations();
79366
+ init_world_content_sidecar_validation();
79367
+ init_members();
79368
+ init_classes();
79369
+ init_constructors2();
79370
+ init_inheritance();
79371
+ init_generics();
79372
+ init_enum2();
79373
+ init_interfaces();
79374
+ init_dialogue();
79375
+ init_project2();
79376
+ init_files();
79377
+ init_localization2();
79378
+ init_unity();
79379
+ init_project_file_authoring_identifiers();
79380
+ init_animation_clips();
79381
+ }
79382
+ });
79383
+
79239
79384
  // src/commands/push-change-intent.ts
79240
79385
  function createNeoCliPushIntent(change) {
79241
79386
  const intentType = `${change.recordKind}.${change.kind}`;
@@ -80247,6 +80392,7 @@ async function prepareLocalPushArtifactsV4(workspace, status) {
80247
80392
  binaryChanges: status.binaryChanges ?? [],
80248
80393
  assignedIds: pendingAssignment.assigned
80249
80394
  });
80395
+ assertPushedRecordsPassDomainGuards(status.changes);
80250
80396
  verifyProjectSourceCommitAgainstStateV4({
80251
80397
  projectId: workspace.config.projectId,
80252
80398
  versionId: workspace.config.versionId,
@@ -80266,6 +80412,37 @@ async function prepareLocalPushArtifactsV4(workspace, status) {
80266
80412
  preparedFiles
80267
80413
  };
80268
80414
  }
80415
+ function assertPushedRecordsPassDomainGuards(changes) {
80416
+ for (const change of changes) {
80417
+ if (change.kind === "delete") continue;
80418
+ if (change.nextData === void 0) continue;
80419
+ if (SERVER_MINTED_PUSH_RECORD_KINDS.has(change.recordKind)) continue;
80420
+ if (change.kind === "create" && SERVER_COMPLETED_PUSH_RECORD_CREATE_KINDS.has(change.recordKind)) {
80421
+ continue;
80422
+ }
80423
+ if (!isProjectRecordKind(change.recordKind)) {
80424
+ throw new Error(
80425
+ `Cannot push ${change.recordKind} "${change.recordId}"${describeChangeOrigin(change)}: "${change.recordKind}" is not a project record kind.`
80426
+ );
80427
+ }
80428
+ try {
80429
+ validateProjectRecordByKind(change.recordKind, change.nextData);
80430
+ } catch (error) {
80431
+ const detail = error instanceof Error ? error.message : String(error);
80432
+ throw new Error(
80433
+ `Cannot push ${change.kind} ${change.recordKind} "${change.recordId}"${describeChangeOrigin(change)}: ${detail}`
80434
+ );
80435
+ }
80436
+ }
80437
+ }
80438
+ function describeChangeOrigin(change) {
80439
+ const name = change.nextData?.name;
80440
+ const parts = [];
80441
+ if (typeof name === "string" && name.length > 0) parts.push(name);
80442
+ if (change.file !== null) parts.push(change.file);
80443
+ if (parts.length === 0) return "";
80444
+ return ` (${parts.join(" in ")})`;
80445
+ }
80269
80446
  function cloneStatusForDryRun(status) {
80270
80447
  return {
80271
80448
  ...status,
@@ -81545,7 +81722,7 @@ function compileMigrationAction(schema, migrationData, locator) {
81545
81722
  locator
81546
81723
  );
81547
81724
  }
81548
- var compileNSAction2, compileNSFunction2, compileNSGetter2, compileNSSetter2, ProjectTransactionInterruptedError, ProjectTransactionFailedError, PROJECT_TRANSACTION_POLL_DELAYS_MS;
81725
+ var compileNSAction2, compileNSFunction2, compileNSGetter2, compileNSSetter2, ProjectTransactionInterruptedError, ProjectTransactionFailedError, PROJECT_TRANSACTION_POLL_DELAYS_MS, SERVER_MINTED_PUSH_RECORD_KINDS, SERVER_COMPLETED_PUSH_RECORD_CREATE_KINDS;
81549
81726
  var init_push = __esm({
81550
81727
  "src/commands/push.ts"() {
81551
81728
  "use strict";
@@ -81568,6 +81745,8 @@ var init_push = __esm({
81568
81745
  init_projection();
81569
81746
  init_project_file_push();
81570
81747
  init_trusted_commit_verification();
81748
+ init_project_version_validation();
81749
+ init_project2();
81571
81750
  init_world_system_classes();
81572
81751
  init_project_manifest();
81573
81752
  init_merge();
@@ -81602,6 +81781,12 @@ var init_push = __esm({
81602
81781
  4e3,
81603
81782
  5e3
81604
81783
  ];
81784
+ SERVER_MINTED_PUSH_RECORD_KINDS = /* @__PURE__ */ new Set([
81785
+ "project-file"
81786
+ ]);
81787
+ SERVER_COMPLETED_PUSH_RECORD_CREATE_KINDS = /* @__PURE__ */ new Set([
81788
+ "localized-text"
81789
+ ]);
81605
81790
  }
81606
81791
  });
81607
81792
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neocompose/cli",
3
- "version": "0.19.1",
3
+ "version": "0.19.2",
4
4
  "description": "Neo Compose native project-source CLI with bidirectional sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",