@almadar/core 1.0.1 → 1.0.9

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,7 +1,7 @@
1
- export { CATEGORIES, CategoryMeta, OPERATORS, OPERATORS_SCHEMA, OPERATOR_NAMES, OperatorCategory, OperatorMeta, OperatorStats, OperatorsSchema, TargetPlatform, getOperatorMeta, getOperatorStats, getOperatorsByCategory, getOperatorsForTarget, isEffectOperator, isGuardOperator, isKnownOperator, validateOperatorArity } from '@almadar/operators';
1
+ import { z } from 'zod';
2
2
  import { AnyPatternConfig } from '@almadar/patterns';
3
3
  export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
4
- import { z } from 'zod';
4
+ export { CATEGORIES, CategoryMeta, OPERATORS, OPERATORS_SCHEMA, OPERATOR_NAMES, OperatorCategory, OperatorMeta, OperatorStats, OperatorsSchema, TargetPlatform, getOperatorMeta, getOperatorStats, getOperatorsByCategory, getOperatorsForTarget, isEffectOperator, isGuardOperator, isKnownOperator, validateOperatorArity } from '@almadar/operators';
5
5
 
6
6
  /**
7
7
  * S-Expression Types
@@ -585,6 +585,8 @@ interface OrbitalEntity {
585
585
  collection?: string;
586
586
  /** Entity fields */
587
587
  fields: EntityField[];
588
+ /** Pre-authored instances (seed data or static reference data) */
589
+ instances?: Record<string, unknown>[];
588
590
  /** Auto-add createdAt/updatedAt timestamps */
589
591
  timestamps?: boolean;
590
592
  /** Soft delete support */
@@ -601,6 +603,7 @@ declare const OrbitalEntitySchema: z.ZodObject<{
601
603
  persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime", "singleton", "instance"]>>;
602
604
  collection: z.ZodOptional<z.ZodString>;
603
605
  fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, EntityField>, "many">;
606
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
604
607
  timestamps: z.ZodOptional<z.ZodBoolean>;
605
608
  softDelete: z.ZodOptional<z.ZodBoolean>;
606
609
  description: z.ZodOptional<z.ZodString>;
@@ -629,6 +632,7 @@ declare const OrbitalEntitySchema: z.ZodObject<{
629
632
  persistence: "persistent" | "runtime" | "singleton" | "instance";
630
633
  fields: EntityField[];
631
634
  collection?: string | undefined;
635
+ instances?: Record<string, unknown>[] | undefined;
632
636
  timestamps?: boolean | undefined;
633
637
  softDelete?: boolean | undefined;
634
638
  description?: string | undefined;
@@ -645,6 +649,7 @@ declare const OrbitalEntitySchema: z.ZodObject<{
645
649
  fields: EntityField[];
646
650
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
647
651
  collection?: string | undefined;
652
+ instances?: Record<string, unknown>[] | undefined;
648
653
  timestamps?: boolean | undefined;
649
654
  softDelete?: boolean | undefined;
650
655
  description?: string | undefined;
@@ -666,6 +671,7 @@ declare const EntitySchema: z.ZodObject<{
666
671
  persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime", "singleton", "instance"]>>;
667
672
  collection: z.ZodOptional<z.ZodString>;
668
673
  fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, EntityField>, "many">;
674
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
669
675
  timestamps: z.ZodOptional<z.ZodBoolean>;
670
676
  softDelete: z.ZodOptional<z.ZodBoolean>;
671
677
  description: z.ZodOptional<z.ZodString>;
@@ -694,6 +700,7 @@ declare const EntitySchema: z.ZodObject<{
694
700
  persistence: "persistent" | "runtime" | "singleton" | "instance";
695
701
  fields: EntityField[];
696
702
  collection?: string | undefined;
703
+ instances?: Record<string, unknown>[] | undefined;
697
704
  timestamps?: boolean | undefined;
698
705
  softDelete?: boolean | undefined;
699
706
  description?: string | undefined;
@@ -710,6 +717,7 @@ declare const EntitySchema: z.ZodObject<{
710
717
  fields: EntityField[];
711
718
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
712
719
  collection?: string | undefined;
720
+ instances?: Record<string, unknown>[] | undefined;
713
721
  timestamps?: boolean | undefined;
714
722
  softDelete?: boolean | undefined;
715
723
  description?: string | undefined;
@@ -961,6 +969,22 @@ declare const UI_SLOTS: readonly ["main", "sidebar", "modal", "drawer", "overlay
961
969
  type UISlot = (typeof UI_SLOTS)[number];
962
970
  declare const UISlotSchema: z.ZodEnum<["main", "sidebar", "modal", "drawer", "overlay", "center", "toast", "floating", "system", "content", "screen", "hud", "hud-top", "hud-bottom", "hud.health", "hud.score", "hud.inventory", "hud.stamina", "overlay.inventory", "overlay.dialogue", "overlay.menu", "overlay.pause"]>;
963
971
 
972
+ /**
973
+ * Configuration for render-ui effect.
974
+ * Used in runtime to specify which slot and pattern to render.
975
+ */
976
+ interface RenderUIConfig {
977
+ /** Target UI slot */
978
+ slot: UISlot;
979
+ /** Pattern configuration (null clears the slot) */
980
+ pattern: AnyPatternConfig | null;
981
+ /** Target element (trait name or entity ID) */
982
+ target?: string;
983
+ /** Additional props for the pattern */
984
+ props?: Record<string, unknown>;
985
+ /** Optional priority for slot ordering */
986
+ priority?: number;
987
+ }
964
988
  /**
965
989
  * Configuration extracted from call-service effects
966
990
  */
@@ -1596,6 +1620,21 @@ type EventInput = z.input<typeof EventSchema>;
1596
1620
  type GuardInput = z.input<typeof GuardSchema>;
1597
1621
  type TransitionInput = z.input<typeof TransitionSchema>;
1598
1622
  type StateMachineInput = z.input<typeof StateMachineSchema>;
1623
+ /**
1624
+ * Check if an event is a circuit event (not internal/system event).
1625
+ * Circuit events are user-defined events that participate in the closed circuit pattern.
1626
+ * Internal/system events start with underscore (e.g., _INIT, _TICK, _TIMER).
1627
+ *
1628
+ * @param event - Event name to check
1629
+ * @returns true if event is a circuit event (doesn't start with underscore)
1630
+ *
1631
+ * @example
1632
+ * isCircuitEvent('CREATE') // true
1633
+ * isCircuitEvent('SAVE') // true
1634
+ * isCircuitEvent('_INIT') // false (internal)
1635
+ * isCircuitEvent('_TICK') // false (internal)
1636
+ */
1637
+ declare function isCircuitEvent(event: string): boolean;
1599
1638
 
1600
1639
  /**
1601
1640
  * Categories for organizing traits
@@ -5036,6 +5075,7 @@ declare const EntityRefSchema: z.ZodUnion<[z.ZodObject<{
5036
5075
  persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime", "singleton", "instance"]>>;
5037
5076
  collection: z.ZodOptional<z.ZodString>;
5038
5077
  fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, EntityField>, "many">;
5078
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
5039
5079
  timestamps: z.ZodOptional<z.ZodBoolean>;
5040
5080
  softDelete: z.ZodOptional<z.ZodBoolean>;
5041
5081
  description: z.ZodOptional<z.ZodString>;
@@ -5064,6 +5104,7 @@ declare const EntityRefSchema: z.ZodUnion<[z.ZodObject<{
5064
5104
  persistence: "persistent" | "runtime" | "singleton" | "instance";
5065
5105
  fields: EntityField[];
5066
5106
  collection?: string | undefined;
5107
+ instances?: Record<string, unknown>[] | undefined;
5067
5108
  timestamps?: boolean | undefined;
5068
5109
  softDelete?: boolean | undefined;
5069
5110
  description?: string | undefined;
@@ -5080,6 +5121,7 @@ declare const EntityRefSchema: z.ZodUnion<[z.ZodObject<{
5080
5121
  fields: EntityField[];
5081
5122
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
5082
5123
  collection?: string | undefined;
5124
+ instances?: Record<string, unknown>[] | undefined;
5083
5125
  timestamps?: boolean | undefined;
5084
5126
  softDelete?: boolean | undefined;
5085
5127
  description?: string | undefined;
@@ -5767,6 +5809,7 @@ declare const OrbitalDefinitionSchema: z.ZodObject<{
5767
5809
  persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime", "singleton", "instance"]>>;
5768
5810
  collection: z.ZodOptional<z.ZodString>;
5769
5811
  fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, EntityField>, "many">;
5812
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
5770
5813
  timestamps: z.ZodOptional<z.ZodBoolean>;
5771
5814
  softDelete: z.ZodOptional<z.ZodBoolean>;
5772
5815
  description: z.ZodOptional<z.ZodString>;
@@ -5795,6 +5838,7 @@ declare const OrbitalDefinitionSchema: z.ZodObject<{
5795
5838
  persistence: "persistent" | "runtime" | "singleton" | "instance";
5796
5839
  fields: EntityField[];
5797
5840
  collection?: string | undefined;
5841
+ instances?: Record<string, unknown>[] | undefined;
5798
5842
  timestamps?: boolean | undefined;
5799
5843
  softDelete?: boolean | undefined;
5800
5844
  description?: string | undefined;
@@ -5811,6 +5855,7 @@ declare const OrbitalDefinitionSchema: z.ZodObject<{
5811
5855
  fields: EntityField[];
5812
5856
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
5813
5857
  collection?: string | undefined;
5858
+ instances?: Record<string, unknown>[] | undefined;
5814
5859
  timestamps?: boolean | undefined;
5815
5860
  softDelete?: boolean | undefined;
5816
5861
  description?: string | undefined;
@@ -6676,6 +6721,7 @@ declare const OrbitalDefinitionSchema: z.ZodObject<{
6676
6721
  persistence: "persistent" | "runtime" | "singleton" | "instance";
6677
6722
  fields: EntityField[];
6678
6723
  collection?: string | undefined;
6724
+ instances?: Record<string, unknown>[] | undefined;
6679
6725
  timestamps?: boolean | undefined;
6680
6726
  softDelete?: boolean | undefined;
6681
6727
  description?: string | undefined;
@@ -6932,6 +6978,7 @@ declare const OrbitalDefinitionSchema: z.ZodObject<{
6932
6978
  fields: EntityField[];
6933
6979
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
6934
6980
  collection?: string | undefined;
6981
+ instances?: Record<string, unknown>[] | undefined;
6935
6982
  timestamps?: boolean | undefined;
6936
6983
  softDelete?: boolean | undefined;
6937
6984
  description?: string | undefined;
@@ -7402,6 +7449,7 @@ declare const OrbitalSchema$1: z.ZodObject<{
7402
7449
  persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime", "singleton", "instance"]>>;
7403
7450
  collection: z.ZodOptional<z.ZodString>;
7404
7451
  fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, EntityField>, "many">;
7452
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
7405
7453
  timestamps: z.ZodOptional<z.ZodBoolean>;
7406
7454
  softDelete: z.ZodOptional<z.ZodBoolean>;
7407
7455
  description: z.ZodOptional<z.ZodString>;
@@ -7430,6 +7478,7 @@ declare const OrbitalSchema$1: z.ZodObject<{
7430
7478
  persistence: "persistent" | "runtime" | "singleton" | "instance";
7431
7479
  fields: EntityField[];
7432
7480
  collection?: string | undefined;
7481
+ instances?: Record<string, unknown>[] | undefined;
7433
7482
  timestamps?: boolean | undefined;
7434
7483
  softDelete?: boolean | undefined;
7435
7484
  description?: string | undefined;
@@ -7446,6 +7495,7 @@ declare const OrbitalSchema$1: z.ZodObject<{
7446
7495
  fields: EntityField[];
7447
7496
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
7448
7497
  collection?: string | undefined;
7498
+ instances?: Record<string, unknown>[] | undefined;
7449
7499
  timestamps?: boolean | undefined;
7450
7500
  softDelete?: boolean | undefined;
7451
7501
  description?: string | undefined;
@@ -8311,6 +8361,7 @@ declare const OrbitalSchema$1: z.ZodObject<{
8311
8361
  persistence: "persistent" | "runtime" | "singleton" | "instance";
8312
8362
  fields: EntityField[];
8313
8363
  collection?: string | undefined;
8364
+ instances?: Record<string, unknown>[] | undefined;
8314
8365
  timestamps?: boolean | undefined;
8315
8366
  softDelete?: boolean | undefined;
8316
8367
  description?: string | undefined;
@@ -8567,6 +8618,7 @@ declare const OrbitalSchema$1: z.ZodObject<{
8567
8618
  fields: EntityField[];
8568
8619
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
8569
8620
  collection?: string | undefined;
8621
+ instances?: Record<string, unknown>[] | undefined;
8570
8622
  timestamps?: boolean | undefined;
8571
8623
  softDelete?: boolean | undefined;
8572
8624
  description?: string | undefined;
@@ -9044,6 +9096,7 @@ declare const OrbitalUnitSchema: z.ZodObject<{
9044
9096
  persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime", "singleton", "instance"]>>;
9045
9097
  collection: z.ZodOptional<z.ZodString>;
9046
9098
  fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, EntityField>, "many">;
9099
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
9047
9100
  timestamps: z.ZodOptional<z.ZodBoolean>;
9048
9101
  softDelete: z.ZodOptional<z.ZodBoolean>;
9049
9102
  description: z.ZodOptional<z.ZodString>;
@@ -9072,6 +9125,7 @@ declare const OrbitalUnitSchema: z.ZodObject<{
9072
9125
  persistence: "persistent" | "runtime" | "singleton" | "instance";
9073
9126
  fields: EntityField[];
9074
9127
  collection?: string | undefined;
9128
+ instances?: Record<string, unknown>[] | undefined;
9075
9129
  timestamps?: boolean | undefined;
9076
9130
  softDelete?: boolean | undefined;
9077
9131
  description?: string | undefined;
@@ -9088,6 +9142,7 @@ declare const OrbitalUnitSchema: z.ZodObject<{
9088
9142
  fields: EntityField[];
9089
9143
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
9090
9144
  collection?: string | undefined;
9145
+ instances?: Record<string, unknown>[] | undefined;
9091
9146
  timestamps?: boolean | undefined;
9092
9147
  softDelete?: boolean | undefined;
9093
9148
  description?: string | undefined;
@@ -9953,6 +10008,7 @@ declare const OrbitalUnitSchema: z.ZodObject<{
9953
10008
  persistence: "persistent" | "runtime" | "singleton" | "instance";
9954
10009
  fields: EntityField[];
9955
10010
  collection?: string | undefined;
10011
+ instances?: Record<string, unknown>[] | undefined;
9956
10012
  timestamps?: boolean | undefined;
9957
10013
  softDelete?: boolean | undefined;
9958
10014
  description?: string | undefined;
@@ -10209,6 +10265,7 @@ declare const OrbitalUnitSchema: z.ZodObject<{
10209
10265
  fields: EntityField[];
10210
10266
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
10211
10267
  collection?: string | undefined;
10268
+ instances?: Record<string, unknown>[] | undefined;
10212
10269
  timestamps?: boolean | undefined;
10213
10270
  softDelete?: boolean | undefined;
10214
10271
  description?: string | undefined;
@@ -10927,6 +10984,7 @@ declare const OrbitalSchemaSchema: z.ZodObject<{
10927
10984
  persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime", "singleton", "instance"]>>;
10928
10985
  collection: z.ZodOptional<z.ZodString>;
10929
10986
  fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, EntityField>, "many">;
10987
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
10930
10988
  timestamps: z.ZodOptional<z.ZodBoolean>;
10931
10989
  softDelete: z.ZodOptional<z.ZodBoolean>;
10932
10990
  description: z.ZodOptional<z.ZodString>;
@@ -10955,6 +11013,7 @@ declare const OrbitalSchemaSchema: z.ZodObject<{
10955
11013
  persistence: "persistent" | "runtime" | "singleton" | "instance";
10956
11014
  fields: EntityField[];
10957
11015
  collection?: string | undefined;
11016
+ instances?: Record<string, unknown>[] | undefined;
10958
11017
  timestamps?: boolean | undefined;
10959
11018
  softDelete?: boolean | undefined;
10960
11019
  description?: string | undefined;
@@ -10971,6 +11030,7 @@ declare const OrbitalSchemaSchema: z.ZodObject<{
10971
11030
  fields: EntityField[];
10972
11031
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
10973
11032
  collection?: string | undefined;
11033
+ instances?: Record<string, unknown>[] | undefined;
10974
11034
  timestamps?: boolean | undefined;
10975
11035
  softDelete?: boolean | undefined;
10976
11036
  description?: string | undefined;
@@ -11836,6 +11896,7 @@ declare const OrbitalSchemaSchema: z.ZodObject<{
11836
11896
  persistence: "persistent" | "runtime" | "singleton" | "instance";
11837
11897
  fields: EntityField[];
11838
11898
  collection?: string | undefined;
11899
+ instances?: Record<string, unknown>[] | undefined;
11839
11900
  timestamps?: boolean | undefined;
11840
11901
  softDelete?: boolean | undefined;
11841
11902
  description?: string | undefined;
@@ -12092,6 +12153,7 @@ declare const OrbitalSchemaSchema: z.ZodObject<{
12092
12153
  fields: EntityField[];
12093
12154
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
12094
12155
  collection?: string | undefined;
12156
+ instances?: Record<string, unknown>[] | undefined;
12095
12157
  timestamps?: boolean | undefined;
12096
12158
  softDelete?: boolean | undefined;
12097
12159
  description?: string | undefined;
@@ -12526,6 +12588,7 @@ declare const OrbitalSchemaSchema: z.ZodObject<{
12526
12588
  persistence: "persistent" | "runtime" | "singleton" | "instance";
12527
12589
  fields: EntityField[];
12528
12590
  collection?: string | undefined;
12591
+ instances?: Record<string, unknown>[] | undefined;
12529
12592
  timestamps?: boolean | undefined;
12530
12593
  softDelete?: boolean | undefined;
12531
12594
  description?: string | undefined;
@@ -12871,6 +12934,7 @@ declare const OrbitalSchemaSchema: z.ZodObject<{
12871
12934
  fields: EntityField[];
12872
12935
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
12873
12936
  collection?: string | undefined;
12937
+ instances?: Record<string, unknown>[] | undefined;
12874
12938
  timestamps?: boolean | undefined;
12875
12939
  softDelete?: boolean | undefined;
12876
12940
  description?: string | undefined;
@@ -13224,6 +13288,7 @@ declare function safeParseOrbitalSchema(data: unknown): z.SafeParseReturnType<{
13224
13288
  fields: EntityField[];
13225
13289
  persistence?: "persistent" | "runtime" | "singleton" | "instance" | undefined;
13226
13290
  collection?: string | undefined;
13291
+ instances?: Record<string, unknown>[] | undefined;
13227
13292
  timestamps?: boolean | undefined;
13228
13293
  softDelete?: boolean | undefined;
13229
13294
  description?: string | undefined;
@@ -13569,6 +13634,7 @@ declare function safeParseOrbitalSchema(data: unknown): z.SafeParseReturnType<{
13569
13634
  persistence: "persistent" | "runtime" | "singleton" | "instance";
13570
13635
  fields: EntityField[];
13571
13636
  collection?: string | undefined;
13637
+ instances?: Record<string, unknown>[] | undefined;
13572
13638
  timestamps?: boolean | undefined;
13573
13639
  softDelete?: boolean | undefined;
13574
13640
  description?: string | undefined;
@@ -14162,6 +14228,8 @@ interface ResolvedEntity {
14162
14228
  singleton?: boolean;
14163
14229
  /** Whether this entity has pre-authored instances in the schema */
14164
14230
  hasInstances?: boolean;
14231
+ /** Pre-authored instances from the schema (seed data or static reference data) */
14232
+ instances?: Record<string, unknown>[];
14165
14233
  /** Default field values from schema (for spawning singletons) */
14166
14234
  defaults?: Record<string, unknown>;
14167
14235
  usedByTraits: string[];
@@ -14381,4 +14449,4 @@ declare function createResolvedField(field: {
14381
14449
  }): ResolvedField;
14382
14450
  declare function isResolvedIR(ir: unknown): ir is ResolvedIR;
14383
14451
 
14384
- export { ALLOWED_CUSTOM_COMPONENTS, type AllowedCustomComponent, type AnimationDef, type AnimationDefInput, AnimationDefSchema, type OrbitalSchema as AppSchema, type AssetMap, type AssetMapInput, AssetMapSchema, type AssetMapping, type AssetMappingInput, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, type BindingContext, BindingSchema, CORE_BINDINGS, type CallServiceConfig, type ComputedEventContract, ComputedEventContractSchema, type ComputedEventListener, ComputedEventListenerSchema, type CoreBinding, type CreateFlow, type CustomPatternDefinition, type CustomPatternDefinitionInput, CustomPatternDefinitionSchema, type CustomPatternMap, type CustomPatternMapInput, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, type DeleteFlow, type DesignPreferences, type DesignPreferencesInput, DesignPreferencesSchema, type DesignTokens, type DesignTokensInput, DesignTokensSchema, type DomainCategory, DomainCategorySchema, type DomainContext, type DomainContextInput, DomainContextSchema, type DomainVocabulary, DomainVocabularySchema, ENTITY_ROLES, type EditFlow, type Effect, type EffectInput, EffectSchema, type Entity, type EntityField, type EntityFieldInput, EntityFieldSchema, type EntityPersistence, EntityPersistenceSchema, type EntityRef, EntityRefSchema, EntityRefStringSchema, type EntityRole, EntityRoleSchema, EntitySchema, type EntitySemanticRole, EntitySemanticRoleSchema, type Event, type EventInput, type EventListener, EventListenerSchema, type EventPayloadField, EventPayloadFieldSchema, EventSchema, type EventScope, EventScopeSchema, type EventSemanticRole, EventSemanticRoleSchema, type EventSource, EventSourceSchema, type Expression, type ExpressionInput, ExpressionSchema, type Field, type FieldFormat, FieldFormatSchema, FieldSchema, type FieldType, FieldTypeSchema, type Orbital as FullOrbitalUnit, GAME_TYPES, type GameSubCategory, GameSubCategorySchema, type GameType, GameTypeSchema, type Guard, type GuardInput, GuardSchema, type InteractionModel, type InteractionModelInput, InteractionModelSchema, type ListInteraction, type McpServiceDef, McpServiceDefSchema, type NodeClassification, NodeClassificationSchema, type OperatorName, type Orbital, type OrbitalConfig, type OrbitalConfigInput, OrbitalConfigSchema, type OrbitalDefinition, OrbitalDefinitionSchema, type OrbitalEntity, type OrbitalEntityInput, OrbitalEntitySchema, type OrbitalInput, type OrbitalPage, type OrbitalPageInput, OrbitalPageSchema, type OrbitalPageStrictInput, OrbitalPageStrictSchema, type OrbitalSchema, type OrbitalSchemaInput, OrbitalSchemaSchema, type OrbitalTraitRef, OrbitalTraitRefSchema, type OrbitalUnit, OrbitalUnitSchema, OrbitalSchema$1 as OrbitalZodSchema, type Page, type PageRef, type PageRefObject, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, type PageTraitRef, PageTraitRefSchema, type ParsedBinding, PatternTypeSchema, type PayloadField, PayloadFieldSchema, type PresentationType, type RelatedLink, RelatedLinkSchema, type RelationConfig, RelationConfigSchema, type RequiredField, RequiredFieldSchema, type ResolvedAsset, type ResolvedAssetInput, ResolvedAssetSchema, type ResolvedEntity, type ResolvedEntityBinding, type ResolvedField, type ResolvedIR, type ResolvedNavigation, type ResolvedPage, type ResolvedPattern, type ResolvedSection, type ResolvedSectionEvent, type ResolvedTrait, type ResolvedTraitBinding, type ResolvedTraitDataEntity, type ResolvedTraitEvent, type ResolvedTraitGuard, type ResolvedTraitListener, type ResolvedTraitState, type ResolvedTraitTick, type ResolvedTraitTransition, type ResolvedTraitUIBinding, type RestAuthConfig, RestAuthConfigSchema, type RestServiceDef, RestServiceDefSchema, SERVICE_TYPES, type SExpr, type SExprAtom, SExprAtomSchema, type SExprInput, SExprSchema, type SemanticAssetRef, type SemanticAssetRefInput, SemanticAssetRefSchema, type ServiceDefinition, ServiceDefinitionSchema, type ServiceRef, ServiceRefSchema, ServiceRefStringSchema, type ServiceType, ServiceTypeSchema, type SocketEvents, SocketEventsSchema, type SocketServiceDef, SocketServiceDefSchema, type State, type StateInput, type StateMachine, type StateMachineInput, StateMachineSchema, StateSchema, type StateSemanticRole, StateSemanticRoleSchema, type SuggestedGuard, SuggestedGuardSchema, type ThemeDefinition, ThemeDefinitionSchema, type ThemeRef, ThemeRefSchema, ThemeRefStringSchema, type ThemeTokens, ThemeTokensSchema, type ThemeVariant, ThemeVariantSchema, type Trait, type TraitCategory, TraitCategorySchema, type TraitDataEntity, TraitDataEntitySchema, type TraitEntityField, TraitEntityFieldSchema, type TraitEventContract, TraitEventContractSchema, type TraitEventListener, TraitEventListenerSchema, type TraitInput, type TraitRef, TraitRefSchema, type TraitReference, type TraitReferenceInput, TraitReferenceSchema, TraitSchema, type TraitTick, TraitTickSchema, type TraitUIBinding, type Transition, type TransitionFrom, type TransitionInput, TransitionSchema, type UISlot, UISlotSchema, UI_SLOTS, type UXHints, UXHintsSchema, type UseDeclaration, UseDeclarationSchema, type UserPersona, type UserPersonaInput, UserPersonaSchema, VISUAL_STYLES, type ViewFlow, type ViewType, ViewTypeSchema, type VisualStyle, VisualStyleSchema, callService, collectBindings, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createResolvedField, deriveCollection, despawn, doEffects, emit, findService, getAllOperators, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, inferTsType, isBinding, isEffect, isEntityReference, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, renderUI, safeParseOrbitalSchema, set, sexpr, spawn, validateAssetAnimations, validateBindingInContext, walkSExpr };
14452
+ export { ALLOWED_CUSTOM_COMPONENTS, type AllowedCustomComponent, type AnimationDef, type AnimationDefInput, AnimationDefSchema, type OrbitalSchema as AppSchema, type AssetMap, type AssetMapInput, AssetMapSchema, type AssetMapping, type AssetMappingInput, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, type BindingContext, BindingSchema, CORE_BINDINGS, type CallServiceConfig, type ComputedEventContract, ComputedEventContractSchema, type ComputedEventListener, ComputedEventListenerSchema, type CoreBinding, type CreateFlow, type CustomPatternDefinition, type CustomPatternDefinitionInput, CustomPatternDefinitionSchema, type CustomPatternMap, type CustomPatternMapInput, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, type DeleteFlow, type DesignPreferences, type DesignPreferencesInput, DesignPreferencesSchema, type DesignTokens, type DesignTokensInput, DesignTokensSchema, type DomainCategory, DomainCategorySchema, type DomainContext, type DomainContextInput, DomainContextSchema, type DomainVocabulary, DomainVocabularySchema, ENTITY_ROLES, type EditFlow, type Effect, type EffectInput, EffectSchema, type Entity, type EntityField, type EntityFieldInput, EntityFieldSchema, type EntityPersistence, EntityPersistenceSchema, type EntityRef, EntityRefSchema, EntityRefStringSchema, type EntityRole, EntityRoleSchema, EntitySchema, type EntitySemanticRole, EntitySemanticRoleSchema, type Event, type EventInput, type EventListener, EventListenerSchema, type EventPayloadField, EventPayloadFieldSchema, EventSchema, type EventScope, EventScopeSchema, type EventSemanticRole, EventSemanticRoleSchema, type EventSource, EventSourceSchema, type Expression, type ExpressionInput, ExpressionSchema, type Field, type FieldFormat, FieldFormatSchema, FieldSchema, type FieldType, FieldTypeSchema, type Orbital as FullOrbitalUnit, GAME_TYPES, type GameSubCategory, GameSubCategorySchema, type GameType, GameTypeSchema, type Guard, type GuardInput, GuardSchema, type InteractionModel, type InteractionModelInput, InteractionModelSchema, type ListInteraction, type McpServiceDef, McpServiceDefSchema, type NodeClassification, NodeClassificationSchema, type OperatorName, type Orbital, type OrbitalConfig, type OrbitalConfigInput, OrbitalConfigSchema, type OrbitalDefinition, OrbitalDefinitionSchema, type OrbitalEntity, type OrbitalEntityInput, OrbitalEntitySchema, type OrbitalInput, type OrbitalPage, type OrbitalPageInput, OrbitalPageSchema, type OrbitalPageStrictInput, OrbitalPageStrictSchema, type OrbitalSchema, type OrbitalSchemaInput, OrbitalSchemaSchema, type OrbitalTraitRef, OrbitalTraitRefSchema, type OrbitalUnit, OrbitalUnitSchema, OrbitalSchema$1 as OrbitalZodSchema, type Page, type PageRef, type PageRefObject, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, type PageTraitRef, PageTraitRefSchema, type ParsedBinding, PatternTypeSchema, type PayloadField, PayloadFieldSchema, type PresentationType, type RelatedLink, RelatedLinkSchema, type RelationConfig, RelationConfigSchema, type RenderUIConfig, type RequiredField, RequiredFieldSchema, type ResolvedAsset, type ResolvedAssetInput, ResolvedAssetSchema, type ResolvedEntity, type ResolvedEntityBinding, type ResolvedField, type ResolvedIR, type ResolvedNavigation, type ResolvedPage, type ResolvedPattern, type ResolvedSection, type ResolvedSectionEvent, type ResolvedTrait, type ResolvedTraitBinding, type ResolvedTraitDataEntity, type ResolvedTraitEvent, type ResolvedTraitGuard, type ResolvedTraitListener, type ResolvedTraitState, type ResolvedTraitTick, type ResolvedTraitTransition, type ResolvedTraitUIBinding, type RestAuthConfig, RestAuthConfigSchema, type RestServiceDef, RestServiceDefSchema, SERVICE_TYPES, type SExpr, type SExprAtom, SExprAtomSchema, type SExprInput, SExprSchema, type SemanticAssetRef, type SemanticAssetRefInput, SemanticAssetRefSchema, type ServiceDefinition, ServiceDefinitionSchema, type ServiceRef, ServiceRefSchema, ServiceRefStringSchema, type ServiceType, ServiceTypeSchema, type SocketEvents, SocketEventsSchema, type SocketServiceDef, SocketServiceDefSchema, type State, type StateInput, type StateMachine, type StateMachineInput, StateMachineSchema, StateSchema, type StateSemanticRole, StateSemanticRoleSchema, type SuggestedGuard, SuggestedGuardSchema, type ThemeDefinition, ThemeDefinitionSchema, type ThemeRef, ThemeRefSchema, ThemeRefStringSchema, type ThemeTokens, ThemeTokensSchema, type ThemeVariant, ThemeVariantSchema, type Trait, type TraitCategory, TraitCategorySchema, type TraitDataEntity, TraitDataEntitySchema, type TraitEntityField, TraitEntityFieldSchema, type TraitEventContract, TraitEventContractSchema, type TraitEventListener, TraitEventListenerSchema, type TraitInput, type TraitRef, TraitRefSchema, type TraitReference, type TraitReferenceInput, TraitReferenceSchema, TraitSchema, type TraitTick, TraitTickSchema, type TraitUIBinding, type Transition, type TransitionFrom, type TransitionInput, TransitionSchema, type UISlot, UISlotSchema, UI_SLOTS, type UXHints, UXHintsSchema, type UseDeclaration, UseDeclarationSchema, type UserPersona, type UserPersonaInput, UserPersonaSchema, VISUAL_STYLES, type ViewFlow, type ViewType, ViewTypeSchema, type VisualStyle, VisualStyleSchema, callService, collectBindings, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createResolvedField, deriveCollection, despawn, doEffects, emit, findService, getAllOperators, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, inferTsType, isBinding, isCircuitEvent, isEffect, isEntityReference, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, renderUI, safeParseOrbitalSchema, set, sexpr, spawn, validateAssetAnimations, validateBindingInContext, walkSExpr };
@@ -162,6 +162,7 @@ var OrbitalEntitySchema = z.object({
162
162
  persistence: EntityPersistenceSchema.default("persistent"),
163
163
  collection: z.string().optional(),
164
164
  fields: z.array(EntityFieldSchema).min(1, "At least one field is required"),
165
+ instances: z.array(z.record(z.unknown())).optional(),
165
166
  timestamps: z.boolean().optional(),
166
167
  softDelete: z.boolean().optional(),
167
168
  description: z.string().optional(),
@@ -416,6 +417,9 @@ var StateMachineSchema = z.object({
416
417
  transitions: z.array(TransitionSchema),
417
418
  guards: z.array(GuardSchema).optional()
418
419
  });
420
+ function isCircuitEvent(event) {
421
+ return !event.startsWith("_");
422
+ }
419
423
 
420
424
  // src/types/trait.ts
421
425
  var TraitCategorySchema = z.enum([
@@ -1144,6 +1148,6 @@ function isResolvedIR(ir) {
1144
1148
  return typeof r.appName === "string" && r.traits instanceof Map && r.pages instanceof Map;
1145
1149
  }
1146
1150
 
1147
- export { ALLOWED_CUSTOM_COMPONENTS, AnimationDefSchema, AssetMapSchema, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BindingSchema, CORE_BINDINGS, ComputedEventContractSchema, ComputedEventListenerSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EffectSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, McpServiceDefSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PatternTypeSchema, PayloadFieldSchema, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, ResolvedAssetSchema, RestAuthConfigSchema, RestServiceDefSchema, SERVICE_TYPES, SExprAtomSchema, SExprSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SocketEventsSchema, SocketServiceDefSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SuggestedGuardSchema, ThemeDefinitionSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TraitCategorySchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, callService, collectBindings, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createResolvedField, deriveCollection, despawn, doEffects, emit, findService, getAllOperators, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, inferTsType, isBinding, isEffect, isEntityReference, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, renderUI, safeParseOrbitalSchema, set, sexpr, spawn, validateAssetAnimations, validateBindingInContext, walkSExpr };
1151
+ export { ALLOWED_CUSTOM_COMPONENTS, AnimationDefSchema, AssetMapSchema, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BindingSchema, CORE_BINDINGS, ComputedEventContractSchema, ComputedEventListenerSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EffectSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, McpServiceDefSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PatternTypeSchema, PayloadFieldSchema, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, ResolvedAssetSchema, RestAuthConfigSchema, RestServiceDefSchema, SERVICE_TYPES, SExprAtomSchema, SExprSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SocketEventsSchema, SocketServiceDefSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SuggestedGuardSchema, ThemeDefinitionSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TraitCategorySchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, callService, collectBindings, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createResolvedField, deriveCollection, despawn, doEffects, emit, findService, getAllOperators, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, inferTsType, isBinding, isCircuitEvent, isEffect, isEntityReference, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, renderUI, safeParseOrbitalSchema, set, sexpr, spawn, validateAssetAnimations, validateBindingInContext, walkSExpr };
1148
1152
  //# sourceMappingURL=index.js.map
1149
1153
  //# sourceMappingURL=index.js.map