@almadar/core 10.42.0 → 10.44.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,7 +1,7 @@
1
- import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect, h as RenderBinding, i as RenderUIEffect, d as EntityId, e as Entity, E as EntityField, a as EntityPersistence, f as EntityRow } from './effect-D4os99OL.js';
2
- import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, P as PageRef, b as Page, c as PageRefObject } from './schema-C_lv_cta.js';
3
- import { b as TraitConfig, g as Trait, T as TraitEventListener, h as CallSiteConfig, j as TraitEventContract, d as TraitRef, a as TraitReference } from './trait-BQIlqUHC.js';
4
- import { S as SExpr } from './expression-DpAj1RzP.js';
1
+ import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect, h as RenderBinding, i as RenderUIEffect, d as EntityId, e as Entity, E as EntityField, a as EntityPersistence, f as EntityRow } from './effect-NbTgX2yB.js';
2
+ import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, P as PageRef, b as Page, c as PageRefObject } from './schema-DdcBBHkb.js';
3
+ import { b as TraitConfig, g as Trait, T as TraitEventListener, h as CallSiteConfig, j as TraitEventContract, d as TraitRef, a as TraitReference } from './trait-DdBiEffx.js';
4
+ import { S as SExpr } from './expression-Yf7qvvOs.js';
5
5
  import 'zod';
6
6
 
7
7
  /**
package/dist/builders.js CHANGED
@@ -333,7 +333,7 @@ var OrbitalEntitySchema = z.object({
333
333
  identity: z.boolean().optional(),
334
334
  collection: z.string().optional(),
335
335
  fields: z.array(EntityFieldSchema).min(1, "At least one field is required"),
336
- instances: z.array(z.record(z.unknown())).optional(),
336
+ instances: z.array(z.record(JsonValueSchema)).optional(),
337
337
  timestamps: z.boolean().optional(),
338
338
  softDelete: z.boolean().optional(),
339
339
  description: z.string().optional(),
@@ -341,6 +341,29 @@ var OrbitalEntitySchema = z.object({
341
341
  assetRef: SemanticAssetRefSchema.optional()
342
342
  });
343
343
  var EntitySchema = OrbitalEntitySchema;
344
+ var SExprDataSchema = z.lazy(
345
+ () => z.union([SExprAtomSchema, z.array(SExprDataSchema)])
346
+ );
347
+ var SExprAtomSchema = z.union([
348
+ z.string(),
349
+ z.number(),
350
+ z.boolean(),
351
+ z.null(),
352
+ z.record(SExprDataSchema)
353
+ // Objects for payload data
354
+ ]);
355
+ var SExprSchema = z.lazy(
356
+ () => z.union([
357
+ SExprAtomSchema,
358
+ z.array(z.lazy(() => SExprSchema)).min(1).refine(
359
+ (arr) => typeof arr[0] === "string",
360
+ { message: "S-expression array must have a string operator as first element" }
361
+ )
362
+ ])
363
+ );
364
+ var ExpressionSchema = SExprSchema;
365
+
366
+ // src/types/effect.ts
344
367
  var UI_SLOTS = [
345
368
  // App slots
346
369
  "main",
@@ -370,28 +393,10 @@ var UI_SLOTS = [
370
393
  "overlay.pause"
371
394
  ];
372
395
  z.enum(UI_SLOTS);
373
- var EffectSchema = z.array(z.unknown()).min(1).refine(
396
+ var EffectSchema = z.array(SExprDataSchema).min(1).refine(
374
397
  (arr) => typeof arr[0] === "string",
375
398
  { message: "Effect must be an S-expression with a string operator as first element" }
376
399
  );
377
- var SExprAtomSchema = z.union([
378
- z.string(),
379
- z.number(),
380
- z.boolean(),
381
- z.null(),
382
- z.record(z.unknown())
383
- // Objects for payload data
384
- ]);
385
- var SExprSchema = z.lazy(
386
- () => z.union([
387
- SExprAtomSchema,
388
- z.array(z.lazy(() => SExprSchema)).min(1).refine(
389
- (arr) => typeof arr[0] === "string",
390
- { message: "S-expression array must have a string operator as first element" }
391
- )
392
- ])
393
- );
394
- var ExpressionSchema = SExprSchema;
395
400
 
396
401
  // src/types/state-machine.ts
397
402
  var StateSchema = z.object({
@@ -651,12 +656,9 @@ var TraitReferenceSchema = z.object({
651
656
  // through to the recursive TraitConfigValue union.
652
657
  config: z.record(z.union([ConfigFieldDeclarationSchema, TraitConfigValueSchema])).optional(),
653
658
  appliesTo: z.array(z.string()).optional(),
654
- // Phase F.7: zod accepts an array (the inliner validates element
655
- // shape). The full ListenDefinition shape isn't recursively encoded
656
- // here because TraitReference is the call-site form — listen entries
657
- // pasted in are already-resolved structured definitions, not nested
658
- // overrides.
659
- listens: z.array(z.unknown()).optional(),
659
+ // Phase F.7: caller-supplied listen entries are already-resolved
660
+ // structured definitions (see `TraitReference.listens`).
661
+ listens: z.array(TraitEventListenerSchema).optional(),
660
662
  emitsScope: z.enum(["internal", "external"]).optional(),
661
663
  // Phase F.8: per-transition effects override. The keys are event
662
664
  // names (the transition triggers AFTER renames); values are SExpr
@@ -678,6 +680,22 @@ var TraitReferenceSchema = z.object({
678
680
  path: ["events"]
679
681
  }
680
682
  );
683
+ var TraitUIBindingSchema = z.record(
684
+ z.object({
685
+ presentation: z.enum(["modal", "drawer", "popover", "inline", "confirm-dialog"]),
686
+ content: z.union([z.record(JsonValueSchema), z.array(z.record(JsonValueSchema))]),
687
+ props: z.object({
688
+ size: z.enum(["sm", "md", "lg", "xl", "full"]).optional(),
689
+ position: z.enum(["left", "right", "top", "bottom", "center"]).optional(),
690
+ title: z.string().optional(),
691
+ closable: z.boolean().optional(),
692
+ width: z.string().optional(),
693
+ showProgress: z.boolean().optional(),
694
+ step: z.number().optional(),
695
+ totalSteps: z.number().optional()
696
+ }).optional()
697
+ })
698
+ );
681
699
  var TraitScopeSchema = z.enum(["instance", "collection"]);
682
700
  var EntityFieldContractSchema = z.object({
683
701
  requires: z.array(z.string()),
@@ -711,7 +729,7 @@ var TraitSchema = z.object({
711
729
  ticks: z.array(TraitTickSchema).optional(),
712
730
  emits: z.array(TraitEventContractSchema).optional(),
713
731
  listens: z.array(TraitEventListenerSchema).optional(),
714
- ui: z.record(z.unknown()).optional(),
732
+ ui: TraitUIBindingSchema.optional(),
715
733
  config: DeclaredTraitConfigSchema.optional(),
716
734
  sourceBehavior: SourceBehaviorMetadataSchema.optional(),
717
735
  sourceEntityDefinition: EntitySchema.optional()