@almadar/core 10.54.0 → 10.56.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-BlFO53UR.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-BPC1Wuxb.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-RzDL-lSo.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-DxD-XTI8.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-Nk1usPv6.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';
4
4
  import { S as SExpr } from './expression-Fk8bQWef.js';
5
5
  import 'zod';
6
6
 
@@ -480,6 +480,12 @@ 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[];
483
489
  /** Trait references. */
484
490
  traits: TraitRef[];
485
491
  /** Optional page references (omitted entirely when not provided). */
package/dist/builders.js CHANGED
@@ -791,7 +791,9 @@ z.object({
791
791
  path: z.string().min(1, "Page path is required").startsWith("/", "Path must start with /"),
792
792
  primaryEntity: z.string().min(1, "Primary entity is required"),
793
793
  traits: z.array(PageTraitRefSchema).min(1, "Page must have at least one trait"),
794
- title: z.string().optional()
794
+ title: z.string().optional(),
795
+ icon: z.string().optional(),
796
+ label: z.string().optional()
795
797
  }).strict();
796
798
  var OrbitalPageSchema = z.object({
797
799
  id: PageIdSchema.optional(),
@@ -801,7 +803,9 @@ var OrbitalPageSchema = z.object({
801
803
  title: z.string().optional(),
802
804
  primaryEntity: z.string().optional(),
803
805
  traits: z.array(PageTraitRefSchema).optional(),
804
- isInitial: z.boolean().optional()
806
+ isInitial: z.boolean().optional(),
807
+ icon: z.string().optional(),
808
+ label: z.string().optional()
805
809
  }).strict();
806
810
  var PageSchema = OrbitalPageSchema;
807
811
  z.enum([
@@ -1270,6 +1274,23 @@ var UseDeclarationSchema = z.object({
1270
1274
  'Alias must be PascalCase (e.g., "Health", "GameCore")'
1271
1275
  )
1272
1276
  });
1277
+ var ExpectDeclarationSchema = z.discriminatedUnion("kind", [
1278
+ z.object({
1279
+ kind: z.literal("identity"),
1280
+ name: z.string().optional(),
1281
+ shape: z.array(EntityFieldSchema).optional()
1282
+ }),
1283
+ z.object({
1284
+ kind: z.literal("entity"),
1285
+ name: z.string().min(1, "Expected entity name is required"),
1286
+ shape: z.array(EntityFieldSchema).optional()
1287
+ }),
1288
+ z.object({
1289
+ kind: z.literal("event"),
1290
+ traitName: z.string().min(1, "Expected event trait name is required"),
1291
+ event: z.string().min(1, "Expected event name is required")
1292
+ })
1293
+ ]);
1273
1294
  function isEntityReference(entity) {
1274
1295
  return typeof entity === "string";
1275
1296
  }
@@ -1370,6 +1391,8 @@ z.object({
1370
1391
  visual_prompt: z.string().optional(),
1371
1392
  // Import system
1372
1393
  uses: z.array(UseDeclarationSchema).optional(),
1394
+ // Consumer-side requirement declarations (`.lolo` `expects ...`)
1395
+ expects: z.array(ExpectDeclarationSchema).optional(),
1373
1396
  // Theme & Services
1374
1397
  theme: ThemeRefSchema.optional(),
1375
1398
  services: z.array(ServiceRefSchema).optional(),
@@ -1817,6 +1840,7 @@ function makeOrbitalWithUses(opts) {
1817
1840
  const orbital = {
1818
1841
  name: opts.name,
1819
1842
  uses: opts.uses,
1843
+ ...opts.expects !== void 0 ? { expects: opts.expects } : {},
1820
1844
  entity: opts.entity,
1821
1845
  traits: opts.traits,
1822
1846
  pages: opts.pages ?? []