@almadar/core 10.53.0 → 10.55.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.
Files changed (33) hide show
  1. package/dist/builders.d.ts +4 -4
  2. package/dist/builders.js +6 -2
  3. package/dist/builders.js.map +1 -1
  4. package/dist/{effect-CqTo1gAF.d.ts → effect-DxD-XTI8.d.ts} +2 -2
  5. package/dist/{entityAccess-3QD5qbqw.d.ts → entityAccess-JTWGFDja.d.ts} +2 -2
  6. package/dist/{expression-Yf7qvvOs.d.ts → expression-Fk8bQWef.d.ts} +6 -1
  7. package/dist/factory/index.d.ts +5 -5
  8. package/dist/factory/index.js +6 -0
  9. package/dist/factory/index.js.map +1 -1
  10. package/dist/factory-runtime/index.d.ts +4 -4
  11. package/dist/factory-runtime/index.js +6 -2
  12. package/dist/factory-runtime/index.js.map +1 -1
  13. package/dist/index.d.ts +10 -10
  14. package/dist/index.js +34 -7
  15. package/dist/index.js.map +1 -1
  16. package/dist/mock/index.d.ts +5 -5
  17. package/dist/mock/index.js.map +1 -1
  18. package/dist/patterns/component-mapping.json +1 -1
  19. package/dist/patterns/event-contracts.json +8 -1
  20. package/dist/patterns/index.d.ts +13 -6
  21. package/dist/patterns/index.js +10 -3
  22. package/dist/patterns/index.js.map +1 -1
  23. package/dist/patterns/patterns-registry.json +1 -1
  24. package/dist/patterns/registry.json +1 -1
  25. package/dist/{schema-h6xcymfn.d.ts → schema-0C1bXRFm.d.ts} +172 -80
  26. package/dist/state-machine/index.d.ts +1 -1
  27. package/dist/{trait-CnbGhs6A.d.ts → trait-WnYkvPdZ.d.ts} +16 -16
  28. package/dist/types/index.d.ts +20 -10
  29. package/dist/types/index.js +18 -4
  30. package/dist/types/index.js.map +1 -1
  31. package/dist/{types-DJquF4Ot.d.ts → types-C4YztU2N.d.ts} +33 -3
  32. package/package.json +1 -1
  33. package/src/types/bindings.ts +13 -1
@@ -1,6 +1,6 @@
1
- import { E as EntityField, a as EntityPersistence, R as RelationConfig } from './effect-CqTo1gAF.js';
2
- import { T as TraitEventListener, a as TraitReference } from './trait-CnbGhs6A.js';
3
- import { J as JsonValue } from './expression-Yf7qvvOs.js';
1
+ import { E as EntityField, a as EntityPersistence, R as RelationConfig } from './effect-DxD-XTI8.js';
2
+ import { T as TraitEventListener, a as TraitReference } from './trait-WnYkvPdZ.js';
3
+ import { J as JsonValue } from './expression-Fk8bQWef.js';
4
4
 
5
5
  /**
6
6
  * Cross-cutting presentation knobs that don't live per orbital
@@ -284,6 +284,13 @@ interface FactoryTraitSignature {
284
284
  * header annotations. Free-form strings — the translator overlay
285
285
  * matches rules to traits by exact set membership. */
286
286
  capabilities: ReadonlyArray<string>;
287
+ /** The entity this trait is bound to at THIS call site — the `.orb`
288
+ * `TraitReference.linkedEntity` / inline `Trait.linkedEntity` (the same
289
+ * field a `traitOverrides.<name>.linkedEntity` rebind ultimately writes).
290
+ * Absent for a bare string ref, whose binding lives on the referenced
291
+ * atom's own signature entry in the same catalog. Read directly off the
292
+ * trait node — no inference. */
293
+ linkedEntity?: string;
287
294
  /** `true` when the source trait's entity binding was authored
288
295
  * `-> @rebindable Entity`. Only then may a consumer rebind it via
289
296
  * `traitOverrides.<name>.linkedEntity`; rabit enum-constrains that
@@ -301,6 +308,19 @@ interface FactoryTraitSignature {
301
308
  * fed to catalog prose + knob-embeddings for binding-discovery. */
302
309
  entityBindingDescription?: string;
303
310
  entityBindingSynonyms?: string;
311
+ /** Entity names this trait's state-machine effects reference
312
+ * (`stateMachine.transitions[].effects[]` — `persist create/update/delete`
313
+ * and `fetch`), deduplicated. Distinct from `linkedEntity` (the trait's
314
+ * OWN binding): this is every OTHER entity an effect reads or writes,
315
+ * e.g. `CheckoutWizard`'s `persist create OrderRecord` names
316
+ * `'OrderRecord'` here even though the trait itself is bound to
317
+ * `Checkout`. `subset_closure` (`packages/almadar-rabit`) uses this to
318
+ * detect a roster subset that would otherwise dangle a persist-effect
319
+ * reference the relation-field/`linkedEntity` walk alone can't see —
320
+ * measured cause of `ORB_EFF_FETCH_INVALID_ENTITY` on a scoped roster
321
+ * (`docs/Almadar_Studio_Failures_2026-08-04.md` §N). Absent = topology
322
+ * unknown (legacy catalogs), same convention as `transitionEvents`. */
323
+ effectEntityRefs?: ReadonlyArray<string>;
304
324
  }
305
325
  /** One event a trait emits or listens for, with its authored annotations — the
306
326
  * per-event analogue of `FactorySignatureEntityField` / `FactoryConfigParam`.
@@ -466,6 +486,16 @@ interface FactoryCallSiteParams {
466
486
  collection?: string;
467
487
  /** Per-page path overrides keyed by `signature.pages[i].name`. */
468
488
  pagePaths?: Readonly<Record<string, string>>;
489
+ /**
490
+ * Theme name (a `data-theme` key from the built-in `@almadar-ui/themes/`
491
+ * registry) stamped onto `Orbital.theme` post-factory. Plan-level and
492
+ * uniform — the coordinator decides it once and threads the same value
493
+ * to every orbital; the per-orbital subagent does not independently pick.
494
+ * Applied post-`dispatchOrbitalFactoryMerged` via `applyOrbitalTheme`,
495
+ * exactly as `pagePaths`/`pages` are applied post-factory, so the factory's
496
+ * typed guard never sees it.
497
+ */
498
+ theme?: string;
469
499
  /** Trait-level overrides keyed by `signature.traits[i].name`. Each value
470
500
  * is a {@link TraitOverlayEntry} — the canonical override surface that
471
501
  * admits the full documented set (`config`, `linkedEntity`, `events`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/core",
3
- "version": "10.53.0",
3
+ "version": "10.55.0",
4
4
  "description": "Core schema types and definitions for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -106,6 +106,18 @@ export const BINDING_DOCS = {
106
106
  examples: ['@callsitePayload.error', '@callsitePayload.row'],
107
107
  requiresPath: true,
108
108
  },
109
+ pages: {
110
+ description:
111
+ 'Render-resolved schema sigil — the host orbital\'s pages as a NavItem[] array (href = page.path, label = page.name). Substituted from the OrbitalSchema before codegen; never survives as a live binding.',
112
+ examples: ['@pages'],
113
+ requiresPath: false,
114
+ },
115
+ currentTheme: {
116
+ description:
117
+ 'Render-resolved schema sigil — the host orbital\'s active data-theme key, derived from Orbital.theme. Substituted from the OrbitalSchema before codegen; never survives as a live binding.',
118
+ examples: ['@currentTheme'],
119
+ requiresPath: false,
120
+ },
109
121
  } as const;
110
122
 
111
123
  /**
@@ -118,7 +130,7 @@ export const BINDING_CONTEXT_RULES = {
118
130
  'Guards can access entity fields, event payload, current state, time, the call-site trait config (@config.X), and the authenticated user context (@user.id, @user.role) for ownership / role gates. Config access lets atoms write mode-aware guards — e.g. std-modal\'s OPEN can require @payload.row only when @config.mode equals "edit", letting create-mode legitimately fire OPEN with no row. Like effects, @config.X is substituted at molecule/organism inline time with the literal call-site value; at atom-scope validate, @config is allowed-but-unresolved.',
119
131
  },
120
132
  effect: {
121
- allowed: ['entity', 'payload', 'state', 'now', 'trait', 'config', 'user', 'callsitePayload'] as const,
133
+ allowed: ['entity', 'payload', 'state', 'now', 'trait', 'config', 'user', 'callsitePayload', 'pages', 'currentTheme'] as const,
122
134
  description:
123
135
  'Effects can access and modify entity fields, use payload data, embed another trait\'s live frame via @trait.X inside render-ui children, read trait config values (@config.X) for atoms parameterized by their call-site, and read the authenticated user context (@user.id, @user.role). At molecule/organism inline time, @config.X is substituted with the literal value from the call-site config block; at atom-scope validate, @config is allowed-but-unresolved. @callsitePayload.X is the call-site-captured event payload emitted by the compiler\'s inline-trait hoisting (a hoisted render block that captured @payload); it is resolved at the composing effect by the runtime BindingResolver.',
124
136
  },