@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.
@@ -2427,7 +2427,7 @@ type EntityData = Record<string, EntityRow[]>;
2427
2427
  *
2428
2428
  * DO NOT EDIT MANUALLY — regenerated by almadar-pattern-sync `patterns` command.
2429
2429
  *
2430
- * Generated: 2026-08-02T09:00:22.611Z
2430
+ * Generated: 2026-08-05T01:21:57.577Z
2431
2431
  * Pattern count: 269
2432
2432
  */
2433
2433
 
@@ -1,4 +1,4 @@
1
- import { O as OrbitalSchema } from './schema-BPC1Wuxb.js';
1
+ import { O as OrbitalSchema } from './schema-Nk1usPv6.js';
2
2
  import { S as SExpr } from './expression-Fk8bQWef.js';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
- import { h as FactoryParamValue, c as FactoryConfigTier, b as FactoryConfigParam, F as FactoryCallSite, j as FactorySignature, R as RuleOverlay, p as RuleOverlayEntry, o as PresentationOverlay, T as TraitOverlay } from '../types-8b5zy8ts.js';
2
- export { a as FactoryCallSiteParams, d as FactoryEntitySignature, e as FactoryEventSignature, f as FactoryExposure, g as FactoryPageSignature, i as FactoryProvenance, k as FactorySignatureCatalog, l as FactorySignatureEntityField, m as FactoryTraitSignature, J as JsonSchema, n as JsonSchemaType, O as OwnershipOverlayEntry, P as PresentationNavItem, S as SchemaFieldType, q as TraitOverlayEntry, r as TraitOverlayListener } from '../types-8b5zy8ts.js';
3
- import { a as EntityPersistence, E as EntityField } from '../effect-BlFO53UR.js';
4
- import { a as TraitReference } from '../trait-RzDL-lSo.js';
1
+ import { h as FactoryParamValue, c as FactoryConfigTier, b as FactoryConfigParam, F as FactoryCallSite, j as FactorySignature, R as RuleOverlay, p as RuleOverlayEntry, o as PresentationOverlay, T as TraitOverlay } from '../types-C4YztU2N.js';
2
+ export { a as FactoryCallSiteParams, d as FactoryEntitySignature, e as FactoryEventSignature, f as FactoryExposure, g as FactoryPageSignature, i as FactoryProvenance, k as FactorySignatureCatalog, l as FactorySignatureEntityField, m as FactoryTraitSignature, J as JsonSchema, n as JsonSchemaType, O as OwnershipOverlayEntry, P as PresentationNavItem, S as SchemaFieldType, q as TraitOverlayEntry, r as TraitOverlayListener } from '../types-C4YztU2N.js';
3
+ import { a as EntityPersistence, E as EntityField } from '../effect-DxD-XTI8.js';
4
+ import { a as TraitReference } from '../trait-WnYkvPdZ.js';
5
5
  export { J as JsonValue } from '../expression-Fk8bQWef.js';
6
6
  import 'zod';
7
7
 
@@ -1,6 +1,6 @@
1
- import { O as OrbitalSchema, a as OrbitalDefinition } from '../schema-BPC1Wuxb.js';
2
- import { h as CallSiteConfig, i as CallSiteConfigEntry, g as Trait } from '../trait-RzDL-lSo.js';
3
- import { E as EntityField, a as EntityPersistence } from '../effect-BlFO53UR.js';
1
+ import { O as OrbitalSchema, a as OrbitalDefinition } from '../schema-Nk1usPv6.js';
2
+ import { h as CallSiteConfig, i as CallSiteConfigEntry, g as Trait } from '../trait-WnYkvPdZ.js';
3
+ import { E as EntityField, a as EntityPersistence } from '../effect-DxD-XTI8.js';
4
4
  import { MakeTraitRefOpts } from '../builders.js';
5
5
  import '../expression-Fk8bQWef.js';
6
6
  import 'zod';
@@ -210,6 +210,24 @@ declare function applyDeclarationEntityRename(schema: OrbitalSchema, rename: Ent
210
210
  * declaration disagrees with `curName` → `ORB_ID_NAME_MISMATCH`.
211
211
  */
212
212
  at: string): OrbitalSchema;
213
+ /**
214
+ * Ledger/declaration agreement heal for the factory build path: every entity
215
+ * declaration carrying an id must find its ledger row naming the SAME name
216
+ * the declaration carries. A re-instantiate adopts the prior `.orb`'s ledger
217
+ * via `orb stamp --prior` — including rename rows an earlier build recorded —
218
+ * while the factory re-emits the entity at its baked/requested name, so a
219
+ * stale `curName` would survive a corrective rebuild unchanged and
220
+ * manufacture an `ORB_ID_NAME_MISMATCH` no repair pass can edit away
221
+ * (battery 2026-08-06 domain-rule: param-fill renamed MarketplaceUserOrbital's
222
+ * entity to `Product`; the corrective re-instantiate at `entityName:
223
+ * "MarketplaceUser"` applies NO rename — from === to — and the adopted row
224
+ * kept `curName: "Product"` against a `MarketplaceUser` declaration).
225
+ *
226
+ * Sound on this path only: the factory always re-emits the declaration at the
227
+ * requested/baked name, so the declaration is the build's truth and the
228
+ * adopted row carries identity (the id) forward. No-op when they agree.
229
+ */
230
+ declare function healEntityLedgerRows(schema: OrbitalSchema, at: string): OrbitalSchema;
213
231
  /**
214
232
  * The overlay. Resolves the effective entity name + collection, calls
215
233
  * `makeOrbitalWithUses` with the rewritten data, then applies the params'
@@ -233,4 +251,4 @@ declare function applyParamsToOrb(orb: OrbitalSchema, orbitalName: string, _mani
233
251
 
234
252
  declare function applyParamsToWholeOrb(orb: OrbitalSchema, manifests: readonly OrbitalParamsManifest[], params: OrbitalFactoryParams): OrbitalSchema;
235
253
 
236
- export { type EntityDeclarationRename, type OrbitalFactoryParams, type OrbitalParamsManifest, type OrbitalTraitOverride, type ParamFieldDescriptor, type ParamValidationError, type ParamValidationResult, applyDeclarationEntityRename, applyDeclarationTraitRenames, applyParamsToOrb, applyParamsToWholeOrb, extractManifest, mergeCallSiteConfigOverrides, rebindInlineTraitEntity, rewriteEntityInInlineTrait, validateOrbitalFactoryParams };
254
+ export { type EntityDeclarationRename, type OrbitalFactoryParams, type OrbitalParamsManifest, type OrbitalTraitOverride, type ParamFieldDescriptor, type ParamValidationError, type ParamValidationResult, applyDeclarationEntityRename, applyDeclarationTraitRenames, applyParamsToOrb, applyParamsToWholeOrb, extractManifest, healEntityLedgerRows, mergeCallSiteConfigOverrides, rebindInlineTraitEntity, rewriteEntityInInlineTrait, validateOrbitalFactoryParams };
@@ -801,7 +801,9 @@ z.object({
801
801
  path: z.string().min(1, "Page path is required").startsWith("/", "Path must start with /"),
802
802
  primaryEntity: z.string().min(1, "Primary entity is required"),
803
803
  traits: z.array(PageTraitRefSchema).min(1, "Page must have at least one trait"),
804
- title: z.string().optional()
804
+ title: z.string().optional(),
805
+ icon: z.string().optional(),
806
+ label: z.string().optional()
805
807
  }).strict();
806
808
  var OrbitalPageSchema = z.object({
807
809
  id: PageIdSchema.optional(),
@@ -811,7 +813,9 @@ var OrbitalPageSchema = z.object({
811
813
  title: z.string().optional(),
812
814
  primaryEntity: z.string().optional(),
813
815
  traits: z.array(PageTraitRefSchema).optional(),
814
- isInitial: z.boolean().optional()
816
+ isInitial: z.boolean().optional(),
817
+ icon: z.string().optional(),
818
+ label: z.string().optional()
815
819
  }).strict();
816
820
  var PageSchema = OrbitalPageSchema;
817
821
  z.enum([
@@ -1280,6 +1284,23 @@ var UseDeclarationSchema = z.object({
1280
1284
  'Alias must be PascalCase (e.g., "Health", "GameCore")'
1281
1285
  )
1282
1286
  });
1287
+ var ExpectDeclarationSchema = z.discriminatedUnion("kind", [
1288
+ z.object({
1289
+ kind: z.literal("identity"),
1290
+ name: z.string().optional(),
1291
+ shape: z.array(EntityFieldSchema).optional()
1292
+ }),
1293
+ z.object({
1294
+ kind: z.literal("entity"),
1295
+ name: z.string().min(1, "Expected entity name is required"),
1296
+ shape: z.array(EntityFieldSchema).optional()
1297
+ }),
1298
+ z.object({
1299
+ kind: z.literal("event"),
1300
+ traitName: z.string().min(1, "Expected event trait name is required"),
1301
+ event: z.string().min(1, "Expected event name is required")
1302
+ })
1303
+ ]);
1283
1304
  var EntityRefStringSchema = z.string().regex(
1284
1305
  /^[A-Z][a-zA-Z0-9]*\.entity$/,
1285
1306
  'Entity reference must be in format "Alias.entity" (e.g., "Goblin.entity")'
@@ -1369,6 +1390,8 @@ var OrbitalDefinitionSchema = z.object({
1369
1390
  visual_prompt: z.string().optional(),
1370
1391
  // Import system
1371
1392
  uses: z.array(UseDeclarationSchema).optional(),
1393
+ // Consumer-side requirement declarations (`.lolo` `expects ...`)
1394
+ expects: z.array(ExpectDeclarationSchema).optional(),
1372
1395
  // Theme & Services
1373
1396
  theme: ThemeRefSchema.optional(),
1374
1397
  services: z.array(ServiceRefSchema).optional(),
@@ -1567,6 +1590,7 @@ function makeOrbitalWithUses(opts) {
1567
1590
  const orbital = {
1568
1591
  name: opts.name,
1569
1592
  uses: opts.uses,
1593
+ ...opts.expects !== void 0 ? { expects: opts.expects } : {},
1570
1594
  entity: opts.entity,
1571
1595
  traits: opts.traits,
1572
1596
  pages: opts.pages ?? []
@@ -1917,6 +1941,21 @@ function applyDeclarationEntityRename(schema, rename, at) {
1917
1941
  }
1918
1942
  return { ...schema, orbitals, ...ledger !== schema.ledger ? { ledger } : {} };
1919
1943
  }
1944
+ function healEntityLedgerRows(schema, at) {
1945
+ let ledger = schema.ledger;
1946
+ if (ledger === void 0) return schema;
1947
+ for (const orbital of schema.orbitals) {
1948
+ const entity = orbital.entity;
1949
+ if (typeof entity !== "object" || entity === null) continue;
1950
+ const id = entity.id;
1951
+ const name = entity.name;
1952
+ if (typeof id !== "string" || typeof name !== "string") continue;
1953
+ const entry = ledger.entries[id];
1954
+ if (entry === void 0 || entry.kind !== "entity" || entry.curName === name) continue;
1955
+ ledger = ledgerRename(ledger, id, name, at);
1956
+ }
1957
+ return ledger !== schema.ledger ? { ...schema, ledger } : schema;
1958
+ }
1920
1959
  function applyParamsToOrb(orb, orbitalName, _manifest, params) {
1921
1960
  const orbital = findOrbitalOrThrow(orb, orbitalName);
1922
1961
  const canonicalEntity = assertResolvedEntity(orbital.entity, orbitalName, orb.name);
@@ -1926,6 +1965,10 @@ function applyParamsToOrb(orb, orbitalName, _manifest, params) {
1926
1965
  const built = makeOrbitalWithUses({
1927
1966
  name: orbital.name,
1928
1967
  uses: orbital.uses ?? [],
1968
+ // Derived `expects` declarations ride the overlay untouched — they name
1969
+ // SIBLING entities (never the orbital's own), so the entityName rename
1970
+ // below cannot affect them.
1971
+ ...orbital.expects !== void 0 ? { expects: orbital.expects } : {},
1929
1972
  entity: buildEntity(ctx, canonicalEntityName, effectiveCollection, params),
1930
1973
  traits: rebuildTraits(orbital.traits),
1931
1974
  pages: rebuildPages(orbital.pages)
@@ -1987,6 +2030,6 @@ function applyParamsToWholeOrb(orb, manifests, params) {
1987
2030
  return { ...orb, orbitals: rebuilt };
1988
2031
  }
1989
2032
 
1990
- export { applyDeclarationEntityRename, applyDeclarationTraitRenames, applyParamsToOrb, applyParamsToWholeOrb, extractManifest, mergeCallSiteConfigOverrides, rebindInlineTraitEntity, rewriteEntityInInlineTrait, validateOrbitalFactoryParams };
2033
+ export { applyDeclarationEntityRename, applyDeclarationTraitRenames, applyParamsToOrb, applyParamsToWholeOrb, extractManifest, healEntityLedgerRows, mergeCallSiteConfigOverrides, rebindInlineTraitEntity, rewriteEntityInInlineTrait, validateOrbitalFactoryParams };
1991
2034
  //# sourceMappingURL=index.js.map
1992
2035
  //# sourceMappingURL=index.js.map