@almadar/core 10.77.0 → 10.79.0

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.
@@ -1,6 +1,6 @@
1
- import { O as OrbitalSchema, a as OrbitalDefinition } from '../schema-Czlrw3bA.js';
2
- import { h as CallSiteConfig, i as CallSiteConfigEntry, g as Trait } from '../trait-DCmf5iRN.js';
3
- import { E as EntityField, a as EntityPersistence } from '../effect-BHaHSAvM.js';
1
+ import { O as OrbitalSchema, a as OrbitalDefinition } from '../schema-CkTuSx6F.js';
2
+ import { i as CallSiteConfig, j as CallSiteConfigEntry, h as Trait } from '../trait-B1fI0lTU.js';
3
+ import { E as EntityField, a as EntityPersistence } from '../effect-Mx_niZdY.js';
4
4
  import { MakeTraitRefOpts } from '../builders.js';
5
5
  import '../expression-Fk8bQWef.js';
6
6
  import 'zod';
@@ -112,7 +112,9 @@ var FIELD_TYPES = [
112
112
  "slot",
113
113
  "pattern",
114
114
  "node",
115
- "event"
115
+ "event",
116
+ "scalar",
117
+ "union"
116
118
  ];
117
119
  z.enum(FIELD_TYPES);
118
120
  var RelationCardinalitySchema = z.enum([
@@ -208,12 +210,20 @@ var EntityFieldSchema = z.lazy(() => {
208
210
  scalarVariant("event"),
209
211
  scalarVariant("money"),
210
212
  scalarVariant("file"),
213
+ scalarVariant("scalar"),
211
214
  // Enum variant — REQUIRES non-empty values.
212
215
  z.object({
213
216
  ...baseFieldShape,
214
217
  type: z.literal("enum"),
215
218
  values: z.array(z.string()).min(1, "Enum field requires a non-empty `values` array")
216
219
  }),
220
+ // Union variant — tagged struct union; values = variant names,
221
+ // per-variant shapes in `properties` (absent on named recursion).
222
+ z.object({
223
+ ...baseFieldShape,
224
+ type: z.literal("union"),
225
+ values: z.array(z.string()).min(1, "Union field requires a non-empty `values` array")
226
+ }),
217
227
  // Relation variant — REQUIRES relation config.
218
228
  z.object({
219
229
  ...baseFieldShape,
@@ -256,8 +266,8 @@ var ASSET_DIMENSIONS = ["2d", "3d"];
256
266
  var AssetDimensionSchema = z.enum(ASSET_DIMENSIONS);
257
267
  var ASSET_ASPECTS = ["1:1", "16:9", "5:7", "8:1"];
258
268
  var AssetAspectSchema = z.enum(ASSET_ASPECTS);
259
- var ANIMATION_NAMES = ["idle", "walk", "attack", "hit", "death"];
260
- var AnimationNameSchema = z.enum(ANIMATION_NAMES);
269
+ var ANIMATION_NAMES = ["idle", "walk", "skate", "jump", "fall", "attack", "hit", "death"];
270
+ z.enum(ANIMATION_NAMES);
261
271
  var SPRITE_DIRECTIONS = ["se", "sw", "ne", "nw"];
262
272
  var SpriteDirectionSchema = z.enum(SPRITE_DIRECTIONS);
263
273
  var SHEET_PROJECTIONS = ["iso", "front", "back", "top", "perspective"];
@@ -277,7 +287,7 @@ z.object({
277
287
  rows: z.number().int().positive(),
278
288
  directions: z.array(SpriteDirectionSchema),
279
289
  sheets: z.record(SpriteDirectionSchema, z.string()),
280
- animations: z.record(AnimationNameSchema, AnimationDefSchema),
290
+ animations: z.record(z.string(), AnimationDefSchema),
281
291
  projections: z.object({
282
292
  iso: z.record(SpriteDirectionSchema, z.string()).optional(),
283
293
  front: z.string().optional(),
@@ -655,6 +665,8 @@ var TraitEventContractSchema = z.object({
655
665
  description: z.string().optional(),
656
666
  synonyms: z.string().optional(),
657
667
  tier: z.string().optional(),
668
+ definerKnob: z.string().optional(),
669
+ scopeOverridden: z.boolean().optional(),
658
670
  payloadSchema: z.array(EventPayloadFieldSchema).optional(),
659
671
  scope: EventScopeSchema.optional()
660
672
  });
@@ -708,6 +720,11 @@ var TraitReferenceSchema = z.object({
708
720
  z.string().min(1, "events value (caller event name) must be non-empty")
709
721
  ).optional(),
710
722
  eventIds: z.record(z.string().min(1), EventIdSchema).optional(),
723
+ // 3-II type-parameter arguments (see `TraitReference.typeArgs`).
724
+ typeArgs: z.record(
725
+ z.string().min(1, "typeArgs key (declared param name) must be non-empty"),
726
+ z.string().min(1, "typeArgs value (type name) must be non-empty")
727
+ ).optional(),
711
728
  fields: z.record(
712
729
  z.string().min(1, "fields key (canonical field name) must be non-empty"),
713
730
  z.string().min(1, "fields value (consumer field name) must be non-empty")
@@ -768,6 +785,11 @@ var SourceBehaviorMetadataSchema = z.object({
768
785
  alias: z.string().min(1),
769
786
  originalName: z.string().min(1)
770
787
  });
788
+ var TraitTypeParamDefSchema = z.object({
789
+ name: z.string().min(1),
790
+ kind: z.string().min(1),
791
+ default: z.string().optional()
792
+ });
771
793
  var TraitSchema = z.object({
772
794
  id: TraitIdSchema.optional(),
773
795
  name: z.string().min(1),
@@ -794,7 +816,8 @@ var TraitSchema = z.object({
794
816
  ui: TraitUIBindingSchema.optional(),
795
817
  config: DeclaredTraitConfigSchema.optional(),
796
818
  sourceBehavior: SourceBehaviorMetadataSchema.optional(),
797
- sourceEntityDefinition: EntitySchema.optional()
819
+ sourceEntityDefinition: EntitySchema.optional(),
820
+ typeParams: z.array(TraitTypeParamDefSchema).optional()
798
821
  });
799
822
  var TraitRefSchema = z.union([
800
823
  z.string().min(1),
@@ -1435,7 +1458,8 @@ var OrbitalDefinitionSchema = z.object({
1435
1458
  // Context fields - persisted throughout orbital lifecycle
1436
1459
  domainContext: DomainContextSchema.optional(),
1437
1460
  design: DesignPreferencesSchema.optional(),
1438
- suggestedGuards: z.array(SuggestedGuardSchema).optional()
1461
+ suggestedGuards: z.array(SuggestedGuardSchema).optional(),
1462
+ types: z.record(z.string(), z.array(EventPayloadFieldSchema)).optional()
1439
1463
  });
1440
1464
  var OrbitalSchema = OrbitalDefinitionSchema;
1441
1465
  var OrbitalConfigSchema = z.object({
@@ -1600,6 +1624,7 @@ function makeTraitRef(opts) {
1600
1624
  if (opts.linkedEntity !== void 0) ref2.linkedEntity = opts.linkedEntity;
1601
1625
  if (opts.linkedEntityId !== void 0) ref2.linkedEntityId = opts.linkedEntityId;
1602
1626
  if (opts.events !== void 0) ref2.events = opts.events;
1627
+ if (opts.typeArgs !== void 0) ref2.typeArgs = opts.typeArgs;
1603
1628
  if (opts.fields !== void 0) ref2.fields = opts.fields;
1604
1629
  if (opts.effects !== void 0) ref2.effects = opts.effects;
1605
1630
  if (opts.listens !== void 0) ref2.listens = opts.listens;