@almadar/core 10.52.0 → 10.54.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 { 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-BlFO53UR.js';
2
+ import { T as TraitEventListener, a as TraitReference } from './trait-RzDL-lSo.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
@@ -154,11 +154,6 @@ interface FactoryEntitySignature {
154
154
  * the source `.lolo` `config { }` block (which carries typed
155
155
  * declarations + defaults). Consumers (the questionnaire generator,
156
156
  * the studio) pick a widget from `type` and pre-fill from `default`.
157
- *
158
- * `label` is reserved for a future `.lolo` grammar extension that
159
- * lets atom authors author a human-friendly question prompt; today
160
- * it's always undefined and the questionnaire derives a fallback
161
- * from the key name.
162
157
  */
163
158
  interface FactoryConfigParam {
164
159
  /** Key name as advertised by the trait. Matches the override path
@@ -180,8 +175,14 @@ interface FactoryConfigParam {
180
175
  * supplied. Pre-fills the form widget so users see what they're
181
176
  * about to change. */
182
177
  default?: FactoryParamValue;
183
- /** Optional human-friendly question prompt. Lifted from the source
184
- * `.lolo` `@label "..."` annotation. */
178
+ /** Human-friendly question prompt, lifted verbatim from the source
179
+ * `.lolo` `@label "..."` annotation. Contract: `@label` IS the
180
+ * rendered string — the questionnaire never manipulates it (no
181
+ * appended punctuation, no humanization, no fallback logic layered
182
+ * on top of an authored value). Undefined only when the atom author
183
+ * did not tag the knob; `buildConfigKeyQuestion` then falls back to
184
+ * `humanizeKey(key)` as a type guard, not user-facing inference — a
185
+ * domain-tier knob reaching that fallback is a source defect. */
185
186
  label?: string;
186
187
  /** Optional help-text. Lifted from `.lolo` `@description "..."`. */
187
188
  description?: string;
@@ -283,6 +284,13 @@ interface FactoryTraitSignature {
283
284
  * header annotations. Free-form strings — the translator overlay
284
285
  * matches rules to traits by exact set membership. */
285
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;
286
294
  /** `true` when the source trait's entity binding was authored
287
295
  * `-> @rebindable Entity`. Only then may a consumer rebind it via
288
296
  * `traitOverrides.<name>.linkedEntity`; rabit enum-constrains that
@@ -465,6 +473,16 @@ interface FactoryCallSiteParams {
465
473
  collection?: string;
466
474
  /** Per-page path overrides keyed by `signature.pages[i].name`. */
467
475
  pagePaths?: Readonly<Record<string, string>>;
476
+ /**
477
+ * Theme name (a `data-theme` key from the built-in `@almadar-ui/themes/`
478
+ * registry) stamped onto `Orbital.theme` post-factory. Plan-level and
479
+ * uniform — the coordinator decides it once and threads the same value
480
+ * to every orbital; the per-orbital subagent does not independently pick.
481
+ * Applied post-`dispatchOrbitalFactoryMerged` via `applyOrbitalTheme`,
482
+ * exactly as `pagePaths`/`pages` are applied post-factory, so the factory's
483
+ * typed guard never sees it.
484
+ */
485
+ theme?: string;
468
486
  /** Trait-level overrides keyed by `signature.traits[i].name`. Each value
469
487
  * is a {@link TraitOverlayEntry} — the canonical override surface that
470
488
  * 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.52.0",
3
+ "version": "10.54.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
  },