@almadar/core 10.55.0 → 10.57.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 { 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-DxD-XTI8.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-0C1bXRFm.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-WnYkvPdZ.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-D-_fm4No.js';
2
+ import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, b as ExpectDeclaration, P as PageRef, c as Page, d as PageRefObject } from './schema-CrUFqWXN.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-A4_OlY_l.js';
4
4
  import { S as SExpr } from './expression-Fk8bQWef.js';
5
5
  import 'zod';
6
6
 
@@ -480,6 +480,18 @@ interface MakeOrbitalWithUsesOpts {
480
480
  uses: UseDeclaration[];
481
481
  /** Entity (inline or reference form). */
482
482
  entity: EntityRef;
483
+ /**
484
+ * Derived `expects` declarations (consumer-side requirements). Threaded
485
+ * verbatim — derivation lives in `deriveExpectations`; builders never
486
+ * compute it. Omitted from the result when not provided.
487
+ */
488
+ expects?: ExpectDeclaration[];
489
+ /**
490
+ * Auxiliary entities (name-resolution side channel for un-rebound atom
491
+ * imports — see {@link OrbitalDefinition.auxiliaryEntities}). Threaded
492
+ * verbatim; omitted from the result when not provided.
493
+ */
494
+ auxiliaryEntities?: EntityRef[];
483
495
  /** Trait references. */
484
496
  traits: TraitRef[];
485
497
  /** Optional page references (omitted entirely when not provided). */
package/dist/builders.js CHANGED
@@ -138,6 +138,7 @@ var EntityFieldSchema = z.lazy(() => {
138
138
  const baseFieldShape = {
139
139
  name: z.string().min(1, "Field name is required").optional(),
140
140
  required: z.boolean().optional(),
141
+ primaryKey: z.boolean().optional(),
141
142
  default: JsonValueSchema.optional(),
142
143
  min: z.number().optional(),
143
144
  max: z.number().optional(),
@@ -542,7 +543,10 @@ var TraitEntityFieldSchema = z.object({
542
543
  "url",
543
544
  "phone",
544
545
  "uuid",
545
- "image"
546
+ "image",
547
+ "trait",
548
+ "slot",
549
+ "pattern"
546
550
  ]),
547
551
  required: z.boolean().optional(),
548
552
  default: TraitConfigValueSchema.optional(),
@@ -652,7 +656,7 @@ var TraitEventListenerSchema = z.object({
652
656
  });
653
657
  var RequiredFieldSchema = z.object({
654
658
  name: z.string().min(1),
655
- type: z.enum(["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum", "email", "url", "phone", "uuid", "image"]),
659
+ type: z.enum(["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum", "email", "url", "phone", "uuid", "image", "trait", "slot", "pattern"]),
656
660
  description: z.string().optional()
657
661
  });
658
662
  var TraitReferenceSchema = z.object({
@@ -1274,6 +1278,23 @@ var UseDeclarationSchema = z.object({
1274
1278
  'Alias must be PascalCase (e.g., "Health", "GameCore")'
1275
1279
  )
1276
1280
  });
1281
+ var ExpectDeclarationSchema = z.discriminatedUnion("kind", [
1282
+ z.object({
1283
+ kind: z.literal("identity"),
1284
+ name: z.string().optional(),
1285
+ shape: z.array(EntityFieldSchema).optional()
1286
+ }),
1287
+ z.object({
1288
+ kind: z.literal("entity"),
1289
+ name: z.string().min(1, "Expected entity name is required"),
1290
+ shape: z.array(EntityFieldSchema).optional()
1291
+ }),
1292
+ z.object({
1293
+ kind: z.literal("event"),
1294
+ traitName: z.string().min(1, "Expected event trait name is required"),
1295
+ event: z.string().min(1, "Expected event name is required")
1296
+ })
1297
+ ]);
1277
1298
  function isEntityReference(entity) {
1278
1299
  return typeof entity === "string";
1279
1300
  }
@@ -1374,6 +1395,8 @@ z.object({
1374
1395
  visual_prompt: z.string().optional(),
1375
1396
  // Import system
1376
1397
  uses: z.array(UseDeclarationSchema).optional(),
1398
+ // Consumer-side requirement declarations (`.lolo` `expects ...`)
1399
+ expects: z.array(ExpectDeclarationSchema).optional(),
1377
1400
  // Theme & Services
1378
1401
  theme: ThemeRefSchema.optional(),
1379
1402
  services: z.array(ServiceRefSchema).optional(),
@@ -1821,7 +1844,9 @@ function makeOrbitalWithUses(opts) {
1821
1844
  const orbital = {
1822
1845
  name: opts.name,
1823
1846
  uses: opts.uses,
1847
+ ...opts.expects !== void 0 ? { expects: opts.expects } : {},
1824
1848
  entity: opts.entity,
1849
+ ...opts.auxiliaryEntities !== void 0 ? { auxiliaryEntities: opts.auxiliaryEntities } : {},
1825
1850
  traits: opts.traits,
1826
1851
  pages: opts.pages ?? []
1827
1852
  };