@almadar/core 7.0.0 → 7.3.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,5 +1,7 @@
1
- import { e as EntityRow, aU as FieldValue, S as SExpr, b as TraitConfig, az as EventPayload } from '../schema-BmRZkOwH.js';
2
- export { A as AGENT_DOMAIN_CATEGORIES, n as ALLOWED_CUSTOM_COMPONENTS, o as AgentDomainCategory, p as AgentDomainCategorySchema, q as AgentEffect, r as AllowedCustomComponent, s as AnimationDef, t as AnimationDefInput, u as AnimationDefSchema, h as AppSchema, v as AssetMap, w as AssetMapInput, x as AssetMapSchema, y as AssetMapping, z as AssetMappingInput, B as AssetMappingSchema, C as AtomicEffect, D as CORE_BINDINGS, F as CallServiceConfig, G as CallServiceEffect, H as ComputedEventContract, I as ComputedEventContractSchema, J as ComputedEventListener, K as ComputedEventListenerSchema, L as CoreBinding, M as CustomPatternDefinition, N as CustomPatternDefinitionInput, Q as CustomPatternDefinitionSchema, R as CustomPatternMap, V as CustomPatternMapInput, W as CustomPatternMapSchema, X as DerefEffect, Y as DesignPreferences, Z as DesignPreferencesInput, _ as DesignPreferencesSchema, $ as DesignTokens, a0 as DesignTokensInput, a1 as DesignTokensSchema, a2 as DespawnEffect, a3 as DoEffect, a4 as DomainCategory, a5 as DomainCategorySchema, a6 as DomainContext, a7 as DomainContextInput, a8 as DomainContextSchema, a9 as DomainVocabulary, aa as DomainVocabularySchema, ab as ENTITY_ROLES, ac as Effect, ad as EffectInput, ae as EffectSchema, af as EmitConfig, ag as EmitEffect, E as Entity, ah as EntityCall, ai as EntityCallSchema, aj as EntityData, c as EntityField, ak as EntityFieldInput, al as EntityFieldSchema, d as EntityPersistence, am as EntityPersistenceSchema, f as EntityRef, an as EntityRefSchema, ao as EntityRefStringSchema, ap as EntityRole, aq as EntityRoleSchema, ar as EntitySchema, as as EntitySemanticRole, at as EntitySemanticRoleSchema, au as EvalContext, av as Event, aw as EventInput, ax as EventListener, ay as EventListenerSchema, aA as EventPayloadField, aB as EventPayloadFieldSchema, aC as EventPayloadValue, aD as EventSchema, aE as EventScope, aF as EventScopeSchema, aG as EventSemanticRole, aH as EventSemanticRoleSchema, aI as EventSource, aJ as EventSourceSchema, aK as Expression, aL as ExpressionInput, aM as ExpressionSchema, aN as FetchEffect, aO as Field, aP as FieldFormat, aQ as FieldFormatSchema, aR as FieldSchema, aS as FieldType, aT as FieldTypeSchema, aV as FullOrbitalUnit, aW as GAME_TYPES, aX as GameSubCategory, aY as GameSubCategorySchema, aZ as GameType, a_ as GameTypeSchema, a$ as Guard, b0 as GuardInput, b1 as GuardSchema, b2 as ListenSource, b3 as ListenSourceSchema, b4 as LogEffect, b5 as LogMeta, b6 as McpServiceDef, b7 as McpServiceDefSchema, b8 as NavigateEffect, b9 as NodeClassification, ba as NodeClassificationSchema, bb as NotifyEffect, aV as Orbital, bc as OrbitalConfig, bd as OrbitalConfigInput, be as OrbitalConfigSchema, O as OrbitalDefinition, bf as OrbitalDefinitionSchema, bg as OrbitalEntity, bh as OrbitalEntityInput, bi as OrbitalEntitySchema, bj as OrbitalInput, bk as OrbitalPage, bl as OrbitalPageInput, bm as OrbitalPageSchema, bn as OrbitalPageStrictInput, bo as OrbitalPageStrictSchema, h as OrbitalSchema, bp as OrbitalSchemaInput, bq as OrbitalSchemaSchema, br as OrbitalTraitRef, bs as OrbitalTraitRefSchema, bt as OrbitalUnit, bu as OrbitalUnitSchema, bv as OrbitalZodSchema, j as Page, P as PageRef, k as PageRefObject, bw as PageRefObjectSchema, bx as PageRefSchema, by as PageRefStringSchema, bz as PageSchema, bA as PageTraitRef, bB as PageTraitRefSchema, bC as ParsedBinding, bD as PayloadField, bE as PayloadFieldSchema, bF as PersistEffect, bG as PresentationType, bH as RefEffect, bI as RelatedLink, bJ as RelatedLinkSchema, bK as RelationConfig, bL as RelationConfigSchema, bM as RenderItemLambda, bN as RenderUIConfig, bO as RenderUIEffect, bP as RenderUINode, bQ as RequiredField, bR as RequiredFieldSchema, bS as ResolvedAsset, bT as ResolvedAssetInput, bU as ResolvedAssetSchema, bV as ResolvedPatternProps, bW as RestAuthConfig, bX as RestAuthConfigSchema, bY as RestServiceDef, bZ as RestServiceDefSchema, b_ as SERVICE_TYPES, b$ as SExprAtom, c0 as SExprAtomSchema, c1 as SExprInput, c2 as SExprSchema, c3 as SemanticAssetRef, c4 as SemanticAssetRefInput, c5 as SemanticAssetRefSchema, c6 as ServiceDefinition, c7 as ServiceDefinitionSchema, c8 as ServiceParams, c9 as ServiceRef, ca as ServiceRefObject, cb as ServiceRefObjectSchema, cc as ServiceRefSchema, cd as ServiceRefStringSchema, ce as ServiceType, cf as ServiceTypeSchema, cg as SetEffect, ch as SocketEvents, ci as SocketEventsSchema, cj as SocketServiceDef, ck as SocketServiceDefSchema, cl as SpawnEffect, m as State, cm as StateInput, cn as StateMachine, co as StateMachineInput, cp as StateMachineSchema, cq as StateSchema, cr as StateSemanticRole, cs as StateSemanticRoleSchema, ct as SuggestedGuard, cu as SuggestedGuardSchema, cv as SwapEffect, cw as ThemeDefinition, cx as ThemeDefinitionSchema, cy as ThemeRef, cz as ThemeRefSchema, cA as ThemeRefStringSchema, cB as ThemeTokens, cC as ThemeTokensSchema, cD as ThemeVariant, cE as ThemeVariantSchema, i as Trait, cF as TraitCategory, cG as TraitCategorySchema, cH as TraitConfigObject, cI as TraitConfigSchema, cJ as TraitConfigValue, cK as TraitConfigValueSchema, cL as TraitDataEntity, cM as TraitDataEntitySchema, cN as TraitEntityField, cO as TraitEntityFieldSchema, T as TraitEventContract, cP as TraitEventContractSchema, a as TraitEventListener, cQ as TraitEventListenerSchema, cR as TraitInput, g as TraitRef, cS as TraitRefSchema, l as TraitReference, cT as TraitReferenceInput, cU as TraitReferenceSchema, cV as TraitSchema, cW as TraitTick, cX as TraitTickSchema, cY as TraitUIBinding, cZ as Transition, c_ as TransitionInput, c$ as TransitionSchema, d0 as TypedEffect, d1 as UISlot, d2 as UISlotSchema, d3 as UI_SLOTS, d4 as UXHints, d5 as UXHintsSchema, U as UseDeclaration, d6 as UseDeclarationSchema, d7 as UserPersona, d8 as UserPersonaInput, d9 as UserPersonaSchema, da as VISUAL_STYLES, db as ViewType, dc as ViewTypeSchema, dd as VisualStyle, de as VisualStyleSchema, df as WatchEffect, dg as WatchOptions, dh as atomic, di as callService, dj as collectBindings, dk as createAssetKey, dl as deref, dm as deriveCollection, dn as despawn, dp as doEffects, dq as emit, dr as findService, ds as getArgs, dt as getDefaultAnimationsForRole, du as getOperator, dv as getServiceNames, dw as getTraitConfig, dx as getTraitName, dy as hasService, dz as isBinding, dA as isCircuitEvent, dB as isEffect, dC as isEntityCall, dD as isEntityReference, dE as isEntityReferenceAny, dF as isImportedTraitRef, dG as isInlineTrait, dH as isMcpService, dI as isOrbitalDefinition, dJ as isPageReference, dK as isPageReferenceObject, dL as isPageReferenceString, dM as isRestService, dN as isRuntimeEntity, dO as isSExpr, dP as isSExprAtom, dQ as isSExprCall, dR as isSExprEffect, dS as isServiceReference, dT as isServiceReferenceObject, dU as isSingletonEntity, dV as isSocketService, dW as isThemeReference, dX as isValidBinding, dY as navigate, dZ as normalizeTraitRef, d_ as notify, d$ as parseAssetKey, e0 as parseBinding, e1 as parseEntityRef, e2 as parseImportedTraitRef, e3 as parseOrbitalSchema, e4 as parsePageRef, e5 as parseServiceRef, e6 as persist, e7 as ref, e8 as renderUI, e9 as safeParseOrbitalSchema, ea as set, eb as sexpr, ec as spawn, ed as swap, ee as validateAssetAnimations, ef as walkSExpr, eg as watch } from '../schema-BmRZkOwH.js';
1
+ import { e as EntityRow, aL as FieldValue, b as TraitConfig } from '../schema-OhIbVaYu.js';
2
+ export { A as AGENT_DOMAIN_CATEGORIES, m as ALLOWED_CUSTOM_COMPONENTS, n as AgentDomainCategory, o as AgentDomainCategorySchema, p as AgentEffect, q as AllowedCustomComponent, r as AnimationDef, s as AnimationDefInput, t as AnimationDefSchema, h as AppSchema, u as AssetMap, v as AssetMapInput, w as AssetMapSchema, x as AssetMapping, y as AssetMappingInput, z as AssetMappingSchema, B as AtomicEffect, C as CallServiceConfig, D as CallServiceEffect, F as ComputedEventContract, G as ComputedEventContractSchema, H as ComputedEventListener, I as ComputedEventListenerSchema, J as CustomPatternDefinition, K as CustomPatternDefinitionInput, L as CustomPatternDefinitionSchema, M as CustomPatternMap, N as CustomPatternMapInput, Q as CustomPatternMapSchema, R as DerefEffect, V as DesignPreferences, W as DesignPreferencesInput, X as DesignPreferencesSchema, Y as DesignTokens, Z as DesignTokensInput, _ as DesignTokensSchema, $ as DespawnEffect, a0 as DoEffect, a1 as DomainCategory, a2 as DomainCategorySchema, a3 as DomainContext, a4 as DomainContextInput, a5 as DomainContextSchema, a6 as DomainVocabulary, a7 as DomainVocabularySchema, a8 as ENTITY_ROLES, a9 as Effect, aa as EffectInput, ab as EffectSchema, ac as EmitConfig, ad as EmitEffect, E as Entity, ae as EntityCall, af as EntityCallSchema, ag as EntityData, c as EntityField, ah as EntityFieldInput, ai as EntityFieldSchema, d as EntityPersistence, aj as EntityPersistenceSchema, f as EntityRef, ak as EntityRefSchema, al as EntityRefStringSchema, am as EntityRole, an as EntityRoleSchema, ao as EntitySchema, ap as EntitySemanticRole, aq as EntitySemanticRoleSchema, ar as Event, as as EventInput, at as EventListener, au as EventListenerSchema, av as EventPayloadField, aw as EventPayloadFieldSchema, ax as EventSchema, ay as EventScope, az as EventScopeSchema, aA as EventSemanticRole, aB as EventSemanticRoleSchema, aC as EventSource, aD as EventSourceSchema, aE as FetchEffect, aF as Field, aG as FieldFormat, aH as FieldFormatSchema, aI as FieldSchema, aJ as FieldType, aK as FieldTypeSchema, aM as FullOrbitalUnit, aN as GAME_TYPES, aO as GameSubCategory, aP as GameSubCategorySchema, aQ as GameType, aR as GameTypeSchema, aS as Guard, aT as GuardInput, aU as GuardSchema, aV as ListenSource, aW as ListenSourceSchema, aX as LogEffect, aY as McpServiceDef, aZ as McpServiceDefSchema, a_ as NavigateEffect, a$ as NodeClassification, b0 as NodeClassificationSchema, b1 as NotifyEffect, aM as Orbital, b2 as OrbitalConfig, b3 as OrbitalConfigInput, b4 as OrbitalConfigSchema, O as OrbitalDefinition, b5 as OrbitalDefinitionSchema, b6 as OrbitalEntity, b7 as OrbitalEntityInput, b8 as OrbitalEntitySchema, b9 as OrbitalInput, ba as OrbitalPage, bb as OrbitalPageInput, bc as OrbitalPageSchema, bd as OrbitalPageStrictInput, be as OrbitalPageStrictSchema, h as OrbitalSchema, bf as OrbitalSchemaInput, bg as OrbitalSchemaSchema, bh as OrbitalTraitRef, bi as OrbitalTraitRefSchema, bj as OrbitalUnit, bk as OrbitalUnitSchema, bl as OrbitalZodSchema, j as Page, P as PageRef, k as PageRefObject, bm as PageRefObjectSchema, bn as PageRefSchema, bo as PageRefStringSchema, bp as PageSchema, bq as PageTraitRef, br as PageTraitRefSchema, bs as PayloadField, bt as PayloadFieldSchema, bu as PersistEffect, bv as PresentationType, bw as RefEffect, bx as RelatedLink, by as RelatedLinkSchema, bz as RelationConfig, bA as RelationConfigSchema, bB as RenderItemLambda, bC as RenderUIConfig, bD as RenderUIEffect, bE as RenderUINode, bF as RequiredField, bG as RequiredFieldSchema, bH as ResolvedAsset, bI as ResolvedAssetInput, bJ as ResolvedAssetSchema, bK as ResolvedPatternProps, bL as RestAuthConfig, bM as RestAuthConfigSchema, bN as RestServiceDef, bO as RestServiceDefSchema, bP as SERVICE_TYPES, bQ as SemanticAssetRef, bR as SemanticAssetRefInput, bS as SemanticAssetRefSchema, bT as ServiceDefinition, bU as ServiceDefinitionSchema, bV as ServiceParams, bW as ServiceRef, bX as ServiceRefObject, bY as ServiceRefObjectSchema, bZ as ServiceRefSchema, b_ as ServiceRefStringSchema, b$ as ServiceType, c0 as ServiceTypeSchema, c1 as SetEffect, c2 as SocketEvents, c3 as SocketEventsSchema, c4 as SocketServiceDef, c5 as SocketServiceDefSchema, c6 as SpawnEffect, S as State, c7 as StateInput, c8 as StateMachine, c9 as StateMachineInput, ca as StateMachineSchema, cb as StateSchema, cc as StateSemanticRole, cd as StateSemanticRoleSchema, ce as SuggestedGuard, cf as SuggestedGuardSchema, cg as SwapEffect, ch as ThemeDefinition, ci as ThemeDefinitionSchema, cj as ThemeRef, ck as ThemeRefSchema, cl as ThemeRefStringSchema, cm as ThemeTokens, cn as ThemeTokensSchema, co as ThemeVariant, cp as ThemeVariantSchema, i as Trait, cq as TraitCategory, cr as TraitCategorySchema, cs as TraitConfigObject, ct as TraitConfigSchema, cu as TraitConfigValue, cv as TraitConfigValueSchema, cw as TraitDataEntity, cx as TraitDataEntitySchema, cy as TraitEntityField, cz as TraitEntityFieldSchema, T as TraitEventContract, cA as TraitEventContractSchema, a as TraitEventListener, cB as TraitEventListenerSchema, cC as TraitInput, g as TraitRef, cD as TraitRefSchema, l as TraitReference, cE as TraitReferenceInput, cF as TraitReferenceSchema, cG as TraitSchema, cH as TraitTick, cI as TraitTickSchema, cJ as TraitUIBinding, cK as Transition, cL as TransitionInput, cM as TransitionSchema, cN as TypedEffect, cO as UISlot, cP as UISlotSchema, cQ as UI_SLOTS, cR as UXHints, cS as UXHintsSchema, U as UseDeclaration, cT as UseDeclarationSchema, cU as UserPersona, cV as UserPersonaInput, cW as UserPersonaSchema, cX as VISUAL_STYLES, cY as ViewType, cZ as ViewTypeSchema, c_ as VisualStyle, c$ as VisualStyleSchema, d0 as WatchEffect, d1 as WatchOptions, d2 as atomic, d3 as callService, d4 as createAssetKey, d5 as deref, d6 as deriveCollection, d7 as despawn, d8 as doEffects, d9 as emit, da as findService, db as getDefaultAnimationsForRole, dc as getServiceNames, dd as getTraitConfig, de as getTraitName, df as hasService, dg as isCircuitEvent, dh as isEffect, di as isEntityCall, dj as isEntityReference, dk as isEntityReferenceAny, dl as isImportedTraitRef, dm as isInlineTrait, dn as isMcpService, dp as isOrbitalDefinition, dq as isPageReference, dr as isPageReferenceObject, ds as isPageReferenceString, dt as isRestService, du as isRuntimeEntity, dv as isSExprEffect, dw as isServiceReference, dx as isServiceReferenceObject, dy as isSingletonEntity, dz as isSocketService, dA as isThemeReference, dB as navigate, dC as normalizeTraitRef, dD as notify, dE as parseAssetKey, dF as parseEntityRef, dG as parseImportedTraitRef, dH as parseOrbitalSchema, dI as parsePageRef, dJ as parseServiceRef, dK as persist, dL as ref, dM as renderUI, dN as safeParseOrbitalSchema, dO as set, dP as spawn, dQ as swap, dR as validateAssetAnimations, dS as watch } from '../schema-OhIbVaYu.js';
3
+ import { S as SExpr, b as EventPayload } from '../expression-eBO9-SQM.js';
4
+ export { C as CORE_BINDINGS, a as CoreBinding, E as EvalContext, c as EventPayloadValue, d as Expression, e as ExpressionInput, f as ExpressionSchema, L as LogMeta, P as ParsedBinding, g as SExprAtom, h as SExprAtomSchema, i as SExprInput, j as SExprSchema, k as collectBindings, l as getArgs, m as getOperator, n as isBinding, o as isSExpr, p as isSExprAtom, q as isSExprCall, r as isValidBinding, s as parseBinding, t as sexpr, w as walkSExpr } from '../expression-eBO9-SQM.js';
3
5
  import { z } from 'zod';
4
6
  export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
5
7
 
@@ -73,16 +75,16 @@ declare const BINDING_DOCS: {
73
75
  */
74
76
  declare const BINDING_CONTEXT_RULES: {
75
77
  readonly guard: {
76
- readonly allowed: readonly ["entity", "payload", "state", "now"];
77
- readonly description: "Guards can access entity fields, event payload, current state, and time";
78
+ readonly allowed: readonly ["entity", "payload", "state", "now", "config"];
79
+ readonly description: "Guards can access entity fields, event payload, current state, time, and the call-site trait config (@config.X). 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.";
78
80
  };
79
81
  readonly effect: {
80
82
  readonly allowed: readonly ["entity", "payload", "state", "now", "trait", "config"];
81
83
  readonly description: "Effects can access and modify entity fields, use payload data, embed another trait's live frame via @trait.X inside render-ui children, and read trait config values (@config.X) for atoms parameterized by their call-site. 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.";
82
84
  };
83
85
  readonly tick: {
84
- readonly allowed: readonly ["entity", "state", "now"];
85
- readonly description: "Ticks can access entity fields, current state, and time (no payload)";
86
+ readonly allowed: readonly ["entity", "state", "now", "config"];
87
+ readonly description: "Ticks can access entity fields, current state, time, and trait config (@config.X) for parameterized atoms. Same substitution semantics as guards/effects.";
86
88
  };
87
89
  };
88
90
  type BindingContext = keyof typeof BINDING_CONTEXT_RULES;
@@ -1349,8 +1351,16 @@ interface OrbitalVerificationAPI {
1349
1351
  * Send an event into the runtime. Requires {@link bindEventBus} (in
1350
1352
  * `@almadar/ui`) to have run at least once. Payload typed as
1351
1353
  * {@link EventPayload} so callers can't slip non-bus-shaped data in.
1354
+ *
1355
+ * `traitScope` is the qualified `Orbital.Trait` (or `App.Trait`)
1356
+ * scope that bus listeners subscribe under. The bridge constructs
1357
+ * `UI:${traitScope}.${event}` and emits that on the bus, matching
1358
+ * the codegen-emitted subscription keys (gap #13). When omitted,
1359
+ * the legacy bare-prefix form `UI:${event}` is used — kept only
1360
+ * for system-scope events like `UI:NOTIFY`; trait-driven dispatch
1361
+ * MUST pass a `traitScope`.
1352
1362
  */
1353
- sendEvent?: (event: string, payload?: EventPayload) => void;
1363
+ sendEvent?: (event: string, payload?: EventPayload, traitScope?: string) => void;
1354
1364
  /** Current state name for a given trait, if known. */
1355
1365
  getTraitState?: (traitName: string) => string | undefined;
1356
1366
  /** Per-trait reducer snapshots (VG4/VG6/VG11a/b/c). */
@@ -1227,16 +1227,16 @@ var BINDING_DOCS = {
1227
1227
  };
1228
1228
  var BINDING_CONTEXT_RULES = {
1229
1229
  guard: {
1230
- allowed: ["entity", "payload", "state", "now"],
1231
- description: "Guards can access entity fields, event payload, current state, and time"
1230
+ allowed: ["entity", "payload", "state", "now", "config"],
1231
+ description: `Guards can access entity fields, event payload, current state, time, and the call-site trait config (@config.X). Config access lets atoms write mode-aware guards \u2014 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.`
1232
1232
  },
1233
1233
  effect: {
1234
1234
  allowed: ["entity", "payload", "state", "now", "trait", "config"],
1235
1235
  description: "Effects can access and modify entity fields, use payload data, embed another trait's live frame via @trait.X inside render-ui children, and read trait config values (@config.X) for atoms parameterized by their call-site. 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."
1236
1236
  },
1237
1237
  tick: {
1238
- allowed: ["entity", "state", "now"],
1239
- description: "Ticks can access entity fields, current state, and time (no payload)"
1238
+ allowed: ["entity", "state", "now", "config"],
1239
+ description: "Ticks can access entity fields, current state, time, and trait config (@config.X) for parameterized atoms. Same substitution semantics as guards/effects."
1240
1240
  }
1241
1241
  };
1242
1242
  function validateBindingInContext(binding, context) {