@almadar/core 10.24.0 → 10.26.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,218 +1,6 @@
1
+ import { A as AnyPatternConfig, b as EntityRow, c as Entity, E as EntityField } from './pattern-types-CEZfJqGr.js';
2
+ import { S as SExpr, E as EventPayload, a as Expression } from './expression-C6X4A8L7.js';
1
3
  import { z } from 'zod';
2
- import { S as SExpr, b as EventPayload, d as Expression } from './expression-BgReMVoL.js';
3
- import { AnyPatternConfig } from '@almadar/patterns';
4
-
5
- /**
6
- * Field Types for Orbital Units
7
- *
8
- * Extracted from schema/data-entities.ts for the orbitals module.
9
- * These types define the field structure within orbital entities.
10
- *
11
- * @packageDocumentation
12
- */
13
-
14
- /**
15
- * Supported field types for entity fields.
16
- *
17
- * @example
18
- * { name: 'status', type: 'enum', values: ['draft', 'published'] }
19
- * { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
20
- */
21
- type FieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'array' | 'object' | 'enum' | 'relation' | 'trait' | 'slot' | 'pattern';
22
- declare const FieldTypeSchema: z.ZodEnum<["string", "number", "boolean", "date", "timestamp", "datetime", "array", "object", "enum", "relation", "trait", "slot", "pattern"]>;
23
- /**
24
- * Cardinality for relation fields.
25
- * Matches Rust compiler's Cardinality enum.
26
- */
27
- type RelationCardinality = 'one' | 'many' | 'one-to-many' | 'many-to-one' | 'many-to-many';
28
- /**
29
- * Configuration for relation fields (foreign keys).
30
- * Matches Rust compiler's RelationDefinition format.
31
- */
32
- interface RelationConfig {
33
- /** Target entity name (e.g., 'User', 'Task') - matches Rust's `entity` field */
34
- entity: string;
35
- /** Field on target entity (defaults to 'id') */
36
- field?: string;
37
- /**
38
- * Cardinality: one, many, one-to-many, many-to-one, many-to-many
39
- * Matches Rust compiler's cardinality format
40
- */
41
- cardinality?: RelationCardinality;
42
- /** Delete behavior */
43
- onDelete?: 'cascade' | 'nullify' | 'restrict';
44
- /**
45
- * Foreign key field name (for legacy compatibility).
46
- * @deprecated Use field instead
47
- */
48
- foreignKey?: string;
49
- /**
50
- * Target entity name (for legacy compatibility).
51
- * @deprecated Use entity instead
52
- */
53
- target?: string;
54
- /**
55
- * Cardinality type alias (for legacy compatibility).
56
- * @deprecated Use cardinality instead
57
- */
58
- type?: RelationCardinality;
59
- }
60
- declare const RelationConfigSchema: z.ZodEffects<z.ZodObject<{
61
- entity: z.ZodString;
62
- field: z.ZodOptional<z.ZodString>;
63
- cardinality: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
64
- onDelete: z.ZodOptional<z.ZodEnum<["cascade", "nullify", "restrict"]>>;
65
- foreignKey: z.ZodOptional<z.ZodString>;
66
- target: z.ZodOptional<z.ZodString>;
67
- type: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
68
- }, "strip", z.ZodTypeAny, {
69
- entity: string;
70
- field?: string | undefined;
71
- cardinality?: "one" | "many" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
72
- onDelete?: "cascade" | "nullify" | "restrict" | undefined;
73
- foreignKey?: string | undefined;
74
- target?: string | undefined;
75
- type?: "one" | "many" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
76
- }, {
77
- entity: string;
78
- field?: string | undefined;
79
- cardinality?: "one" | "many" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
80
- onDelete?: "cascade" | "nullify" | "restrict" | undefined;
81
- foreignKey?: string | undefined;
82
- target?: string | undefined;
83
- type?: "one" | "many" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
84
- }>, RelationConfig, {
85
- entity: string;
86
- field?: string | undefined;
87
- cardinality?: "one" | "many" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
88
- onDelete?: "cascade" | "nullify" | "restrict" | undefined;
89
- foreignKey?: string | undefined;
90
- target?: string | undefined;
91
- type?: "one" | "many" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
92
- }>;
93
- /**
94
- * Field format validators for string fields.
95
- */
96
- type FieldFormat = 'email' | 'url' | 'phone' | 'date' | 'datetime' | 'uuid'
97
- /** Render hint: this string field stores an image URL. Mock adapters
98
- * generate a deterministic picsum.photos URL; UI patterns can branch
99
- * to an `<img>` instead of a `<typography>`. */
100
- | 'image'
101
- /** Render hint: avatar-shaped image (square, small). */
102
- | 'avatar'
103
- /** Render hint: thumbnail image (small landscape). */
104
- | 'thumbnail';
105
- declare const FieldFormatSchema: z.ZodEnum<["email", "url", "phone", "date", "datetime", "uuid", "image", "avatar", "thumbnail"]>;
106
- /**
107
- * Field-type tags that don't carry a type-dependent payload. The base
108
- * `EntityField` shape applies as-is.
109
- */
110
- type ScalarFieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'trait' | 'slot' | 'pattern';
111
- /** Fields shared across every variant. */
112
- interface EntityFieldBase {
113
- /**
114
- * Field name (camelCase). Optional for nested item/property descriptors
115
- * where the name is implied by the parent (`items`, `properties[k]`).
116
- * Mirrors Rust's `FieldDefinition.name: Option<String>`.
117
- */
118
- name?: string;
119
- /** Whether the field is required */
120
- required?: boolean;
121
- /** Default value */
122
- default?: unknown;
123
- /** Validation format */
124
- format?: FieldFormat;
125
- /** Minimum value (for number) or length (for string) */
126
- min?: number;
127
- /** Maximum value or length */
128
- max?: number;
129
- /** Object property schemas keyed by property name (for object type).
130
- * Mirrors Rust's `FieldDefinition.properties: Option<HashMap<String,
131
- * FieldDefinition>>`. Populated by the lolo lowerer when a field /
132
- * config slot's type expression resolves to a struct shape
133
- * (`TypeExpr::Object`), including named-type aliases like `[MetricSpec]`. */
134
- properties?: Record<string, EntityField>;
135
- /** Runtime-managed widget state (authored `@intrinsic` in `.lolo`). Exempt
136
- * from the explicit-binding rule and never a domain-data bind target. */
137
- intrinsic?: boolean;
138
- /** Human/semantic description (authored `@description "..."` in `.lolo`).
139
- * Authoring/build-time metadata — factory-signature catalog, embeddings,
140
- * curation field-matching; the runtime ignores it. */
141
- description?: string;
142
- /** User-vocabulary synonyms (authored `@synonyms "..."` in `.lolo`).
143
- * Free text feeding catalog search / curation field-matching. */
144
- synonyms?: string;
145
- }
146
- /**
147
- * Scalar / structural fields — no type-dependent payload required.
148
- * `values?` is permitted as an OPTIONAL UI/validation hint (e.g. lolo's
149
- * `'a' | 'b' | 'c'` string-union sugar lowers to `type: 'string', values:
150
- * [...]`). Only `EnumEntityField` MANDATES values.
151
- */
152
- interface ScalarEntityField extends EntityFieldBase {
153
- type: ScalarFieldType;
154
- /** Optional vocabulary hint for scalar fields (e.g. string unions
155
- * authored as `'a'|'b'|'c'` in lolo). Not required at this variant. */
156
- values?: string[];
157
- }
158
- /** `type: 'enum'` REQUIRES the closed vocabulary in `values`. */
159
- interface EnumEntityField extends EntityFieldBase {
160
- type: 'enum';
161
- /** Closed string vocabulary the field accepts. */
162
- values: string[];
163
- }
164
- /** `type: 'relation'` REQUIRES the relation target binding. */
165
- interface RelationEntityField extends EntityFieldBase {
166
- type: 'relation';
167
- /** Relation target binding (entity + cardinality). */
168
- relation: RelationConfig;
169
- }
170
- /** `type: 'array'` — element schema in `items` strongly preferred but
171
- * optional for legacy compatibility with codegen-emitted scalar-array
172
- * fields (e.g. `{type: 'array', default: []}`). The lolo lowerer + Rust
173
- * validator catch typed-element-required cases downstream. */
174
- interface ArrayEntityField extends EntityFieldBase {
175
- type: 'array';
176
- /** Element schema for the array. */
177
- items?: EntityField;
178
- }
179
- /**
180
- * `type: 'object'` — a fixed-key struct (fields in `properties`) OR a
181
- * dynamic-key map (`Map K V` in `.lolo`; the uniform value schema lives in
182
- * `items`, mirroring an array's element schema). A distinct variant so `items`
183
- * is statically allowed only on object/array fields, never on scalars.
184
- */
185
- interface ObjectEntityField extends EntityFieldBase {
186
- type: 'object';
187
- /** Uniform value schema for a dynamic-key map (`Map K V`). */
188
- items?: EntityField;
189
- }
190
- /**
191
- * Entity field definition — discriminated union by `type`. Each variant
192
- * statically enforces its dependent payload (`values` for enum,
193
- * `relation` for relation, `items` for array) so TS / Zod / JSON Schema
194
- * consumers all agree on the dependency, not just the Rust validator.
195
- *
196
- * @example
197
- * { name: 'status', type: 'enum', values: ['draft', 'published'] }
198
- * { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
199
- * { name: 'tags', type: 'array', items: { type: 'string' } }
200
- */
201
- type EntityField = ScalarEntityField | EnumEntityField | RelationEntityField | ArrayEntityField | ObjectEntityField;
202
- /**
203
- * Zod schema for `EntityField`. Preprocess normalizes:
204
- * - legacy `type` aliases (text → string, int → number, etc.)
205
- * - legacy `enum: string[]` alias → `values: string[]`
206
- *
207
- * Branches on `type` so TS narrows the parsed output to the matching
208
- * discriminated-union variant.
209
- */
210
- declare const EntityFieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
211
- type EntityFieldInput = z.input<typeof EntityFieldSchema>;
212
- /** Alias for EntityField - preferred name */
213
- type Field = EntityField;
214
- /** Alias for EntityFieldSchema - preferred name */
215
- declare const FieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
216
4
 
217
5
  /**
218
6
  * Service Types for Orbital Schema
@@ -959,1207 +747,176 @@ interface ServiceParams {
959
747
  }
960
748
 
961
749
  /**
962
- * Asset Types for Semantic Asset References
750
+ * Effect Types (Self-Contained)
963
751
  *
964
- * Defines types for abstracting asset paths into semantic references.
965
- * Assets are resolved from SemanticAssetRef to actual paths at compile time.
752
+ * Defines effect types for trait transitions and ticks.
753
+ * Effects are S-expressions (arrays) that describe actions to perform.
966
754
  *
967
755
  * @packageDocumentation
968
756
  */
969
757
 
970
758
  /**
971
- * Entity roles in game contexts
759
+ * Known UI slots where content can be rendered
972
760
  */
973
- declare const ENTITY_ROLES: readonly ["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"];
974
- type EntityRole = (typeof ENTITY_ROLES)[number];
975
- declare const EntityRoleSchema: z.ZodEnum<["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"]>;
761
+ declare const UI_SLOTS: readonly ["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"];
762
+ type UISlot = (typeof UI_SLOTS)[number];
763
+ 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"]>;
764
+
976
765
  /**
977
- * Visual art styles for games
766
+ * Configuration extracted from call-service effects
978
767
  */
979
- declare const VISUAL_STYLES: readonly ["pixel", "vector", "hd", "1-bit", "isometric"];
980
- type VisualStyle = (typeof VISUAL_STYLES)[number];
981
- declare const VisualStyleSchema: z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>;
768
+ interface CallServiceConfig {
769
+ service: string;
770
+ action: string;
771
+ endpoint?: string;
772
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
773
+ params?: ServiceParams;
774
+ onSuccess?: string;
775
+ onError?: string;
776
+ }
982
777
  /**
983
- * Whether the asset is a 2D sprite/image or a 3D model. Set by the consuming
984
- * canvas: the same entity role is a 2D sprite-sheet on a tile board and a 3D
985
- * rigged model on a 3D board.
778
+ * A binding reference to a render tree stored elsewhere a trait `config`
779
+ * knob or a payload field e.g. `"@config.bodyContent"`. Resolved to a pattern
780
+ * node at render time. This is how an atom renders a tree that contains data
781
+ * bindings (`entity: "@payload.data"`, `fields: "@config.fields"`): the tree is
782
+ * a permissive `TraitConfigValue` stored in `config` (a binding string is not a
783
+ * valid `AnyPatternConfig` prop value), and the render-ui effect points at it.
784
+ * Worked example: `std-browse`'s loaded transition is `['render-ui', 'main',
785
+ * '@config.bodyContent']`. The Rust validator accepts this form; this variant
786
+ * lets the TS effect type express it.
986
787
  */
987
- declare const ASSET_DIMENSIONS: readonly ["2d", "3d"];
988
- type AssetDimension = (typeof ASSET_DIMENSIONS)[number];
989
- declare const AssetDimensionSchema: z.ZodEnum<["2d", "3d"]>;
788
+ type RenderBinding = `@${string}`;
990
789
  /**
991
- * Rendering aspect ratio of an asset: square (tiles/sprites/portraits/icons),
992
- * 16:9 (scene backdrops), 5:7 (cards), 8:1 (effect frame strips).
790
+ * Render UI effect - displays a pattern in a UI slot.
791
+ * @example ['render-ui', 'main', { patternType: 'entity-table', columns: ['name'] }]
792
+ * @example ['render-ui', 'main', '@config.bodyContent'] // a {@link RenderBinding} target
993
793
  */
994
- declare const ASSET_ASPECTS: readonly ["1:1", "16:9", "5:7", "8:1"];
995
- type AssetAspect = (typeof ASSET_ASPECTS)[number];
996
- declare const AssetAspectSchema: z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>;
794
+ type RenderUIEffect = ['render-ui', UISlot, AnyPatternConfig] | ['render-ui', UISlot, AnyPatternConfig, ResolvedPatternProps] | ['render-ui', UISlot, RenderBinding] | ['render-ui', UISlot, null];
997
795
  /**
998
- * Animation names matching a sprite sheet's row layout. Canonical home for
999
- * this vocabulary `@almadar/ui`'s `spriteAnimationTypes.ts` re-exports it
1000
- * rather than redeclaring, so board `.lolo` config and the render library
1001
- * agree on one enum.
796
+ * Lambda expression for per-item rendering in data-grid/data-list.
797
+ * The compiler generates: {(paramName: Record<string, unknown>) => (<>JSX</>)}
798
+ * where @{paramName}.field bindings reference the current iteration item.
799
+ *
800
+ * @example ["fn", "item", { "type": "stack", "children": [{ "type": "typography", "content": "@item.title" }] }]
1002
801
  */
1003
- declare const ANIMATION_NAMES: readonly ["idle", "walk", "attack", "hit", "death"];
1004
- type AnimationName = (typeof ANIMATION_NAMES)[number];
1005
- declare const AnimationNameSchema: z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>;
1006
- /** Sheet file directions (physical PNG files a sprite sheet ships as). */
1007
- declare const SPRITE_DIRECTIONS: readonly ["se", "sw"];
1008
- type SpriteDirection = (typeof SPRITE_DIRECTIONS)[number];
1009
- declare const SpriteDirectionSchema: z.ZodEnum<["se", "sw"]>;
802
+ type RenderItemLambda = ['fn', string, AnyPatternConfig];
1010
803
  /**
1011
- * Definition for a single named animation within a sprite sheet: which row
1012
- * it occupies, how many frames it has, and its playback rate. This is the
1013
- * shape actually consumed by `@almadar/ui`'s sprite-sheet renderer
1014
- * (`spriteAnimation.ts`'s `frameRect`/`getCurrentFrameFromDef`) — moved here
1015
- * verbatim rather than reconciled with a differently-shaped guess, since
1016
- * `@almadar/ui`'s version is the one with real production consumers.
804
+ * Navigate effect - navigates to an internal page path or an external URL.
805
+ * @example ['navigate', '/tasks'] or ['navigate', '/tasks/:id', { id: '123' }]
806
+ * @example ['navigate', 'https://example.com']
1017
807
  */
1018
- interface AnimationDef {
1019
- /** Row index in the sprite sheet (0-based; each animation occupies one row). */
1020
- row: number;
1021
- /** Number of frames in this animation. */
1022
- frames: number;
1023
- /** Frames per second. */
1024
- frameRate: number;
1025
- /** Whether the animation loops. */
1026
- loop: boolean;
1027
- }
1028
- declare const AnimationDefSchema: z.ZodObject<{
1029
- row: z.ZodNumber;
1030
- frames: z.ZodNumber;
1031
- frameRate: z.ZodNumber;
1032
- loop: z.ZodBoolean;
1033
- }, "strip", z.ZodTypeAny, {
1034
- row: number;
1035
- frames: number;
1036
- frameRate: number;
1037
- loop: boolean;
1038
- }, {
1039
- row: number;
1040
- frames: number;
1041
- frameRate: number;
1042
- loop: boolean;
1043
- }>;
808
+ type NavigateEffect = ['navigate', string] | ['navigate', string, Record<string, string>];
1044
809
  /**
1045
- * Parsed sprite-sheet atlas JSON the contract a `spriteSheet`-role `Asset.url`
1046
- * resolves to when fetched (see `Asset.url` usage in `@almadar/ui`'s
1047
- * `useUnitSpriteAtlas`). A unit's `sprite?: Asset` stays the static single-pose
1048
- * image; `spriteSheet?: Asset` is a SEPARATE reference whose URL points at a
1049
- * `SpriteSheetAtlas`-shaped JSON manifest (e.g. `.../guardian-sprite-sheet.json`),
1050
- * not a PNG. Frame-cutting geometry lives here, not inlined onto `Asset` — an
1051
- * `Asset` traveling through `render-ui` every tick stays small.
810
+ * Emit effect - emits an event, optionally with payload.
811
+ * @example ['emit', 'SAVE'] or ['emit', 'PLAYER_DIED', { playerId: '@entity.id' }]
812
+ * @example ['emit', 'FILTER_CHANGED', '@entity.filters']
1052
813
  */
1053
- interface SpriteSheetAtlas {
1054
- /** Unit archetype key. */
1055
- unit?: string;
1056
- /** Visual type key. */
1057
- type?: string;
1058
- /** Width of a single frame in pixels. */
1059
- frameWidth: number;
1060
- /** Height of a single frame in pixels. */
1061
- frameHeight: number;
1062
- /** Number of columns (frames per row). */
1063
- columns: number;
1064
- /** Number of rows (animations). */
1065
- rows: number;
1066
- /** Directions present as physical PNG files. */
1067
- directions: SpriteDirection[];
1068
- /** Relative PNG sheet paths per direction. */
1069
- sheets: Partial<Record<SpriteDirection, string>>;
1070
- /** Animation row layout keyed by animation name. */
1071
- animations: Partial<Record<AnimationName, AnimationDef>>;
1072
- }
1073
- declare const SpriteSheetAtlasSchema: z.ZodObject<{
1074
- unit: z.ZodOptional<z.ZodString>;
1075
- type: z.ZodOptional<z.ZodString>;
1076
- frameWidth: z.ZodNumber;
1077
- frameHeight: z.ZodNumber;
1078
- columns: z.ZodNumber;
1079
- rows: z.ZodNumber;
1080
- directions: z.ZodArray<z.ZodEnum<["se", "sw"]>, "many">;
1081
- sheets: z.ZodRecord<z.ZodEnum<["se", "sw"]>, z.ZodString>;
1082
- animations: z.ZodRecord<z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>, z.ZodObject<{
1083
- row: z.ZodNumber;
1084
- frames: z.ZodNumber;
1085
- frameRate: z.ZodNumber;
1086
- loop: z.ZodBoolean;
1087
- }, "strip", z.ZodTypeAny, {
1088
- row: number;
1089
- frames: number;
1090
- frameRate: number;
1091
- loop: boolean;
1092
- }, {
1093
- row: number;
1094
- frames: number;
1095
- frameRate: number;
1096
- loop: boolean;
1097
- }>>;
1098
- }, "strip", z.ZodTypeAny, {
1099
- frameWidth: number;
1100
- frameHeight: number;
1101
- columns: number;
1102
- rows: number;
1103
- directions: ("se" | "sw")[];
1104
- sheets: Partial<Record<"se" | "sw", string>>;
1105
- animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
1106
- row: number;
1107
- frames: number;
1108
- frameRate: number;
1109
- loop: boolean;
1110
- }>>;
1111
- type?: string | undefined;
1112
- unit?: string | undefined;
1113
- }, {
1114
- frameWidth: number;
1115
- frameHeight: number;
1116
- columns: number;
1117
- rows: number;
1118
- directions: ("se" | "sw")[];
1119
- sheets: Partial<Record<"se" | "sw", string>>;
1120
- animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
1121
- row: number;
1122
- frames: number;
1123
- frameRate: number;
1124
- loop: boolean;
1125
- }>>;
1126
- type?: string | undefined;
1127
- unit?: string | undefined;
1128
- }>;
814
+ type EmitEffect = ['emit', string] | ['emit', string, EventPayload | string];
1129
815
  /**
1130
- * One named sub-rectangle inside a packed sheet. Mirrors the ShoeBox /
1131
- * TexturePacker `<SubTexture>` element every Kenney `Spritesheet/*.xml` ships
1132
- * (`x`/`y`/`width`/`height` = the rect in the sheet PNG; `frameX`/`frameY`/
1133
- * `frameWidth`/`frameHeight` = the trim/pad offsets for sprites packed with
1134
- * transparent edges removed optional, present only on trimmed atlases).
816
+ * `emit:` config block attached to async / reactive data operators.
817
+ *
818
+ * Each key names an event the runtime should fire on the bus when the
819
+ * effect reaches the corresponding lifecycle point. The set of keys an
820
+ * operator actually supports is enforced by the compiler validator:
821
+ *
822
+ * | Operator | Supported keys |
823
+ * |------------------|---------------------------|
824
+ * | `fetch` | `success`, `failure` |
825
+ * | `persist` | `success`, `failure` |
826
+ * | `call-service` | `success`, `failure` |
827
+ * | `set` | `success` |
828
+ * | `ref` | `on_change`, `failure` |
829
+ * | `os/watch-*` | `on_message`, `failure` |
830
+ *
831
+ * Payload convention:
832
+ * - `success` / `on_change` → the effect's result (fetched entity, new value)
833
+ * - `failure` → `{ error: string, code?: string }`
834
+ * - `on_message` → the incoming message (os/watch-* streams)
835
+ *
836
+ * See `docs/Almadar_Std_Gaps.md` §3.1 for the close-the-circuit design.
1135
837
  */
1136
- interface SubTexture {
1137
- x: number;
1138
- y: number;
1139
- width: number;
1140
- height: number;
1141
- frameX?: number;
1142
- frameY?: number;
1143
- frameWidth?: number;
1144
- frameHeight?: number;
838
+ interface EmitConfig {
839
+ /** Fires after a one-shot async effect resolves successfully. */
840
+ success?: string;
841
+ /** Fires when the effect throws; payload is `{ error: string }`. */
842
+ failure?: string;
843
+ /** Reactive-subscription event (per update for `ref`). */
844
+ on_change?: string;
845
+ /** Per-event fire for `os/watch-*` streams. */
846
+ on_message?: string;
1145
847
  }
1146
- declare const SubTextureSchema: z.ZodObject<{
1147
- x: z.ZodNumber;
1148
- y: z.ZodNumber;
1149
- width: z.ZodNumber;
1150
- height: z.ZodNumber;
1151
- frameX: z.ZodOptional<z.ZodNumber>;
1152
- frameY: z.ZodOptional<z.ZodNumber>;
1153
- frameWidth: z.ZodOptional<z.ZodNumber>;
1154
- frameHeight: z.ZodOptional<z.ZodNumber>;
1155
- }, "strip", z.ZodTypeAny, {
1156
- x: number;
1157
- y: number;
1158
- width: number;
1159
- height: number;
1160
- frameWidth?: number | undefined;
1161
- frameHeight?: number | undefined;
1162
- frameX?: number | undefined;
1163
- frameY?: number | undefined;
1164
- }, {
1165
- x: number;
1166
- y: number;
1167
- width: number;
1168
- height: number;
1169
- frameWidth?: number | undefined;
1170
- frameHeight?: number | undefined;
1171
- frameX?: number | undefined;
1172
- frameY?: number | undefined;
1173
- }>;
1174
848
  /**
1175
- * A packed sheet + its named sub-rectangles the canonical parse target for a
1176
- * Kenney `Spritesheet/*.xml` atlas. A STATIC tile/prop/UI Asset references one
1177
- * of these: `{ url: <sheet.png>, atlas: <this.json>, sprite: "grass.png" }`
1178
- * the renderer fetches the sheet + atlas ONCE and blits the named sub-rect,
1179
- * instead of loading N individual PNGs. (Animated actors use `SpriteSheetAtlas`
1180
- * instead; a uniform-grid tile page uses `Tilesheet`.)
849
+ * Set effect - sets a binding to a value.
850
+ *
851
+ * Two forms are supported to match the runtime's `set` handler signature
852
+ * `(targetId, field, value)`:
853
+ *
854
+ * - 3-element binding form (legacy / std behaviors): ['set', '@entity.field', value]
855
+ * - 4-element target form (canonical runtime): ['set', entityId, fieldName, value]
856
+ *
857
+ * The 4-element form is what `OrbitalServerRuntime`'s set handler
858
+ * dispatches directly (`update(entityType, targetId, { field: value })`).
859
+ * Prefer the 4-element form when authoring schemas in TypeScript that
860
+ * load directly into the runtime.
861
+ *
862
+ * @example ['set', '@entity.health', 100] // 3-element
863
+ * @example ['set', '@entity.id', 'health', 100] // 4-element
864
+ * @example ['set', '@entity.id', 'count', ['+', '@entity.count', 1]]
1181
865
  */
1182
- interface TextureAtlas {
1183
- /** Relative path to the sheet PNG the sub-rects index into (the atlas's own `imagePath`). */
1184
- imagePath: string;
1185
- /** Sub-rectangles keyed by their atlas name (e.g. `"grass.png"`). */
1186
- subTextures: Record<string, SubTexture>;
1187
- }
1188
- declare const TextureAtlasSchema: z.ZodObject<{
1189
- imagePath: z.ZodString;
1190
- subTextures: z.ZodRecord<z.ZodString, z.ZodObject<{
1191
- x: z.ZodNumber;
1192
- y: z.ZodNumber;
1193
- width: z.ZodNumber;
1194
- height: z.ZodNumber;
1195
- frameX: z.ZodOptional<z.ZodNumber>;
1196
- frameY: z.ZodOptional<z.ZodNumber>;
1197
- frameWidth: z.ZodOptional<z.ZodNumber>;
1198
- frameHeight: z.ZodOptional<z.ZodNumber>;
1199
- }, "strip", z.ZodTypeAny, {
1200
- x: number;
1201
- y: number;
1202
- width: number;
1203
- height: number;
1204
- frameWidth?: number | undefined;
1205
- frameHeight?: number | undefined;
1206
- frameX?: number | undefined;
1207
- frameY?: number | undefined;
1208
- }, {
1209
- x: number;
1210
- y: number;
1211
- width: number;
1212
- height: number;
1213
- frameWidth?: number | undefined;
1214
- frameHeight?: number | undefined;
1215
- frameX?: number | undefined;
1216
- frameY?: number | undefined;
1217
- }>>;
1218
- }, "strip", z.ZodTypeAny, {
1219
- imagePath: string;
1220
- subTextures: Record<string, {
1221
- x: number;
1222
- y: number;
1223
- width: number;
1224
- height: number;
1225
- frameWidth?: number | undefined;
1226
- frameHeight?: number | undefined;
1227
- frameX?: number | undefined;
1228
- frameY?: number | undefined;
1229
- }>;
1230
- }, {
1231
- imagePath: string;
1232
- subTextures: Record<string, {
1233
- x: number;
1234
- y: number;
1235
- width: number;
1236
- height: number;
1237
- frameWidth?: number | undefined;
1238
- frameHeight?: number | undefined;
1239
- frameX?: number | undefined;
1240
- frameY?: number | undefined;
1241
- }>;
1242
- }>;
866
+ type SetEffect = ['set', string, unknown] | ['set', string, string, unknown];
1243
867
  /**
1244
- * A uniform-grid tile page the shape a Kenney `Tilesheet/` sheet takes (e.g.
1245
- * Pirate Pack: "each tile is 64×64, no margin"). Tiles are cut by `(col,row)`
1246
- * index rather than by named rect. `names` is present only when a sibling
1247
- * `.xml`/`.txt` supplies an index→name list; otherwise a tile is addressed by
1248
- * its `"col,row"` (or flat index) via `Asset.sprite`.
868
+ * Trailing config object on persist effects. When present, it carries the
869
+ * `emit` map specifying which events to fire on persist success/failure.
870
+ * Mirrors what the runtime's `EffectExecutor` reads at the 5th tuple
871
+ * position. See `(persist create Entity @payload.data { emit: { success:
872
+ * "Saved", failure: "SaveFailed" } })` in `.lolo` source.
1249
873
  */
1250
- interface Tilesheet {
1251
- /** Relative path to the tile sheet PNG. */
1252
- imagePath: string;
1253
- /** Width of one tile cell in pixels. */
1254
- tileWidth: number;
1255
- /** Height of one tile cell in pixels. */
1256
- tileHeight: number;
1257
- /** Number of columns in the grid. */
1258
- columns: number;
1259
- /** Number of rows in the grid. */
1260
- rows: number;
1261
- /** Outer margin before the first tile, in pixels (default 0). */
1262
- margin?: number;
1263
- /** Gap between adjacent tiles, in pixels (default 0). */
1264
- spacing?: number;
1265
- /** Optional index→name labels when a descriptor supplies them. */
1266
- names?: string[];
874
+ interface PersistEmitConfig {
875
+ emit?: {
876
+ success?: string;
877
+ failure?: string;
878
+ };
1267
879
  }
1268
- declare const TilesheetSchema: z.ZodObject<{
1269
- imagePath: z.ZodString;
1270
- tileWidth: z.ZodNumber;
1271
- tileHeight: z.ZodNumber;
1272
- columns: z.ZodNumber;
1273
- rows: z.ZodNumber;
1274
- margin: z.ZodOptional<z.ZodNumber>;
1275
- spacing: z.ZodOptional<z.ZodNumber>;
1276
- names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1277
- }, "strip", z.ZodTypeAny, {
1278
- columns: number;
1279
- rows: number;
1280
- imagePath: string;
1281
- tileWidth: number;
1282
- tileHeight: number;
1283
- margin?: number | undefined;
1284
- spacing?: number | undefined;
1285
- names?: string[] | undefined;
1286
- }, {
1287
- columns: number;
1288
- rows: number;
1289
- imagePath: string;
1290
- tileWidth: number;
1291
- tileHeight: number;
1292
- margin?: number | undefined;
1293
- spacing?: number | undefined;
1294
- names?: string[] | undefined;
1295
- }>;
1296
880
  /**
1297
- * Semantic reference to an asset (not a hardcoded path).
1298
- * Resolved to actual paths at compile time via asset maps.
881
+ * Persist effect data argument: either an entity row literal (field map)
882
+ * or a binding string referencing a row in scope (e.g. `@payload.data`,
883
+ * `@entity`). At runtime, binding strings resolve to `EntityRow` values
884
+ * before the persist op runs.
1299
885
  */
1300
- interface SemanticAssetRef {
1301
- /**
1302
- * Entity role — a free string. Core no longer constrains the vocabulary to
1303
- * `EntityRole` (that enum stays an exported shared reference for the asset
1304
- * tool + renderer); genre boards may use their own roles (`boss`, `tower`, …).
1305
- */
1306
- role: string;
1307
- /** Sub-category within role (hero, slime, coin, etc.) */
1308
- category: string;
1309
- /** Required animations for this entity */
1310
- animations?: string[];
1311
- /** Visual style preference */
1312
- style?: VisualStyle;
1313
- /** Variant identifier (for multiple versions) */
1314
- variant?: string;
1315
- /** 2D sprite vs 3D model — the rendering dimension the consuming canvas needs. */
1316
- dimension?: AssetDimension;
1317
- /** Rendering aspect ratio (square sprite/portrait/tile, 16:9 backdrop, 5:7 card, 8:1 fx-strip). */
1318
- aspect?: AssetAspect;
1319
- }
1320
- declare const SemanticAssetRefSchema: z.ZodObject<{
1321
- role: z.ZodString;
1322
- category: z.ZodString;
1323
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1324
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1325
- variant: z.ZodOptional<z.ZodString>;
1326
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1327
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1328
- }, "strip", z.ZodTypeAny, {
1329
- role: string;
1330
- category: string;
1331
- animations?: string[] | undefined;
1332
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1333
- variant?: string | undefined;
1334
- dimension?: "2d" | "3d" | undefined;
1335
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1336
- }, {
1337
- role: string;
1338
- category: string;
1339
- animations?: string[] | undefined;
1340
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1341
- variant?: string | undefined;
1342
- dimension?: "2d" | "3d" | undefined;
1343
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1344
- }>;
886
+ type PersistData = EntityRow | string;
1345
887
  /**
1346
- * The single asset type: a `SemanticAssetRef` (role/dimension/animations/aspect/style)
1347
- * WITH its resolved URL folded in. Used everywhere an asset is referenced — a lolo
1348
- * board `assetManifest` (`Map string Asset`), every `@almadar/ui` game prop, the
1349
- * asset-workflow's resolved/pool assets, and the inspector picker. Replaces the bare
1350
- * `AssetUrl`-string asset field so the render metadata travels WITH the asset (no
1351
- * pixel-dimension or filename heuristics needed to know sheet-vs-frame / 2d-vs-3d).
888
+ * Persist effect - creates, updates, deletes, or clears entities.
889
+ *
890
+ * Each operation accepts an optional trailing `PersistEmitConfig` so the
891
+ * runtime can fire success / failure events when the operation completes.
892
+ *
893
+ * @example ['persist', 'create', 'Task', { title: '@payload.title' }]
894
+ * @example ['persist', 'update', '@entity.entityType', '@payload.data']
895
+ * @example ['persist', 'create', 'Task', '@payload.data', { emit: { success: 'TaskCreated' } }]
1352
896
  */
1353
- interface Asset extends SemanticAssetRef {
1354
- /** The resolved asset URL. When `atlas`/`sprite` are set this is the SHEET png; otherwise a standalone image. */
1355
- url: AssetUrl;
1356
- /**
1357
- * Optional atlas JSON (a `TextureAtlas` or `Tilesheet`) that slices `url`.
1358
- * When present with `sprite`, the renderer fetches sheet + atlas once and
1359
- * blits one sub-rect instead of loading a standalone PNG. Absent → `url` is
1360
- * a plain whole-image asset (the existing, non-atlas path).
1361
- */
1362
- atlas?: AssetUrl;
1363
- /**
1364
- * The sub-texture selector within `atlas`: a `SubTexture` name for a
1365
- * `TextureAtlas` (e.g. `"grass.png"`), or a `"col,row"`/flat index for a
1366
- * `Tilesheet`. Only meaningful alongside `atlas`.
1367
- */
1368
- sprite?: string;
1369
- /** Optional display name (inspector picker). */
1370
- name?: string;
1371
- /** Optional thumbnail URL (inspector picker grid). */
1372
- thumbnailUrl?: string;
1373
- }
1374
- declare const AssetSchema: z.ZodObject<{
1375
- role: z.ZodString;
1376
- category: z.ZodString;
1377
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1378
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1379
- variant: z.ZodOptional<z.ZodString>;
1380
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1381
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1382
- } & {
1383
- url: z.ZodString;
1384
- atlas: z.ZodOptional<z.ZodString>;
1385
- sprite: z.ZodOptional<z.ZodString>;
1386
- name: z.ZodOptional<z.ZodString>;
1387
- thumbnailUrl: z.ZodOptional<z.ZodString>;
1388
- }, "strip", z.ZodTypeAny, {
1389
- url: string;
1390
- role: string;
1391
- category: string;
1392
- name?: string | undefined;
1393
- animations?: string[] | undefined;
1394
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1395
- variant?: string | undefined;
1396
- dimension?: "2d" | "3d" | undefined;
1397
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1398
- atlas?: string | undefined;
1399
- sprite?: string | undefined;
1400
- thumbnailUrl?: string | undefined;
1401
- }, {
1402
- url: string;
1403
- role: string;
1404
- category: string;
1405
- name?: string | undefined;
1406
- animations?: string[] | undefined;
1407
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1408
- variant?: string | undefined;
1409
- dimension?: "2d" | "3d" | undefined;
1410
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1411
- atlas?: string | undefined;
1412
- sprite?: string | undefined;
1413
- thumbnailUrl?: string | undefined;
1414
- }>;
897
+ type PersistEffect = ['persist', 'create', string, PersistData] | ['persist', 'create', string, PersistData, PersistEmitConfig] | ['persist', 'update', string, PersistData] | ['persist', 'update', string, PersistData, PersistEmitConfig] | ['persist', 'delete', string] | ['persist', 'delete', string, PersistData] | ['persist', 'delete', string, PersistData, PersistEmitConfig] | ['persist', 'clear', string] | ['persist', 'clear', string, PersistData] | ['persist', 'clear', string, PersistData, PersistEmitConfig];
1415
898
  /**
1416
- * Single browsable asset in the inspector picker catalog.
1417
- * Backs the asset/icon pickers — a flat list the inspector renders for
1418
- * the user to choose from when a config field's type is `'asset'`.
899
+ * Call service effect - invokes an external service.
900
+ *
901
+ * Two shapes are accepted:
902
+ *
903
+ * 1. Flat form (what the runtime reads and every .orb file uses):
904
+ * `['call-service', serviceName, action, params?]` — args[0]=service,
905
+ * args[1]=action, args[2]=params. This is the canonical form; the
906
+ * runtime's EffectExecutor decodes exactly these positions.
907
+ *
908
+ * 2. Legacy config-object form (kept for the `callService()` helper):
909
+ * `['call-service', serviceName, CallServiceConfig]` — retained so
910
+ * older call sites using the builder helper continue to typecheck.
911
+ *
912
+ * @example ['call-service', 'llm', 'generate', { userPrompt: '@entity.inputText' }]
913
+ * @example ['call-service', 'llm', 'generate', { userPrompt: '...' }, { emit: { success: 'OK', failure: 'ERR' } }]
914
+ * @example ['call-service', 'WeatherAPI', { service: 'weather', action: 'get', onSuccess: 'OK' }]
1419
915
  */
1420
- interface AssetCatalogEntry {
1421
- /** Resolvable URL to the asset. */
1422
- url: string;
1423
- /** Display name for the asset. */
1424
- name: string;
1425
- /** Grouping category within the catalog. */
1426
- category: string;
1427
- /** Asset kind the picker dispatches on. */
1428
- kind: 'image' | 'spritesheet' | 'audio' | 'scene' | 'portrait' | 'model' | 'other';
1429
- /** Optional thumbnail URL for grid previews. */
1430
- thumbnailUrl?: string;
1431
- /** 2D sprite vs 3D model — the asset's actual rendering dimension. */
1432
- dimension?: AssetDimension;
1433
- /** The asset's actual rendering aspect ratio. */
1434
- aspect?: AssetAspect;
1435
- }
1436
- declare const AssetCatalogEntrySchema: z.ZodObject<{
1437
- url: z.ZodString;
1438
- name: z.ZodString;
1439
- category: z.ZodString;
1440
- kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
1441
- thumbnailUrl: z.ZodOptional<z.ZodString>;
1442
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1443
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1444
- }, "strip", z.ZodTypeAny, {
1445
- url: string;
1446
- name: string;
1447
- category: string;
1448
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1449
- dimension?: "2d" | "3d" | undefined;
1450
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1451
- thumbnailUrl?: string | undefined;
1452
- }, {
1453
- url: string;
1454
- name: string;
1455
- category: string;
1456
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1457
- dimension?: "2d" | "3d" | undefined;
1458
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1459
- thumbnailUrl?: string | undefined;
1460
- }>;
916
+ type CallServiceEffect = ['call-service', string, string] | ['call-service', string, string, ServiceParams] | ['call-service', string, string, ServiceParams, PersistEmitConfig] | ['call-service', string, CallServiceConfig];
1461
917
  /**
1462
- * Flat list of browsable assets surfaced by the inspector pickers.
1463
- */
1464
- type AssetCatalog = AssetCatalogEntry[];
1465
- declare const AssetCatalogSchema: z.ZodArray<z.ZodObject<{
1466
- url: z.ZodString;
1467
- name: z.ZodString;
1468
- category: z.ZodString;
1469
- kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
1470
- thumbnailUrl: z.ZodOptional<z.ZodString>;
1471
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1472
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1473
- }, "strip", z.ZodTypeAny, {
1474
- url: string;
1475
- name: string;
1476
- category: string;
1477
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1478
- dimension?: "2d" | "3d" | undefined;
1479
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1480
- thumbnailUrl?: string | undefined;
1481
- }, {
1482
- url: string;
1483
- name: string;
1484
- category: string;
1485
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1486
- dimension?: "2d" | "3d" | undefined;
1487
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1488
- thumbnailUrl?: string | undefined;
1489
- }>, "many">;
1490
- /**
1491
- * Asset-reference URL marker. A plain alias over `string` — the value is a
1492
- * resolvable asset URL — but the named type lets the pattern-sync tool
1493
- * (`tools/almadar-pattern-sync/parser.ts`) detect a component prop as an asset
1494
- * field (tagged `asset`) the same way `EventKey`/`LucideIcon` are detected by
1495
- * type identity. Components annotate image/url props as `AssetUrl` (`src`,
1496
- * `backgroundImage`, `avatar`, …); the generator emits a `string` config knob
1497
- * declared as the `asset` config type, which the property inspector dispatches
1498
- * an AssetPicker on. Not branded — asset urls originate from user data, so cast
1499
- * friction would buy nothing; the value is the marker the tool finds.
1500
- */
1501
- type AssetUrl = string;
1502
- /**
1503
- * A neutral position in scene space: 2D (`x`,`y`) or optionally 3D (`x`,`y`,`z`).
1504
- * The single coordinate type shared by every drawable descriptor and camera pose
1505
- * across the 2D and 3D canvas hosts, so a scene composes from the same `{x,y,z?}`
1506
- * regardless of projection or painter. Logical, not pixel — the host's projector
1507
- * maps a `ScenePos` to screen space.
1508
- */
1509
- interface ScenePos {
1510
- x: number;
1511
- y: number;
1512
- z?: number;
1513
- }
1514
- declare const ScenePosSchema: z.ZodObject<{
1515
- x: z.ZodNumber;
1516
- y: z.ZodNumber;
1517
- z: z.ZodOptional<z.ZodNumber>;
1518
- }, "strip", z.ZodTypeAny, {
1519
- x: number;
1520
- y: number;
1521
- z?: number | undefined;
1522
- }, {
1523
- x: number;
1524
- y: number;
1525
- z?: number | undefined;
1526
- }>;
1527
- /**
1528
- * Camera behaviors, unifying the former per-host vocab (2D `camera` string +
1529
- * 3D `cameraMode`). `isometric`/`top-down` are fixed framings; `follow`/`chase`
1530
- * track a target; `perspective` is the 3D dramatic framing.
1531
- */
1532
- declare const CAMERA_MODES: readonly ["isometric", "perspective", "top-down", "follow", "chase"];
1533
- type CameraMode = (typeof CAMERA_MODES)[number];
1534
- declare const CameraModeSchema: z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>;
1535
- /**
1536
- * A neutral camera pose shared by the 2D and 3D canvas hosts, so `type: canvas`
1537
- * carries one camera object regardless of painter. `pos`/`target` are `ScenePos`
1538
- * (logical scene space, not pixels); `zoom` scales the view (the former `scale`);
1539
- * `fov` is the 3D field of view; `mode` selects the framing/tracking behavior.
1540
- * Every field is optional — an omitted camera means the host's default framing.
1541
- */
1542
- interface Camera {
1543
- pos?: ScenePos;
1544
- target?: ScenePos;
1545
- zoom?: number;
1546
- fov?: number;
1547
- mode?: CameraMode;
1548
- }
1549
- declare const CameraSchema: z.ZodObject<{
1550
- pos: z.ZodOptional<z.ZodObject<{
1551
- x: z.ZodNumber;
1552
- y: z.ZodNumber;
1553
- z: z.ZodOptional<z.ZodNumber>;
1554
- }, "strip", z.ZodTypeAny, {
1555
- x: number;
1556
- y: number;
1557
- z?: number | undefined;
1558
- }, {
1559
- x: number;
1560
- y: number;
1561
- z?: number | undefined;
1562
- }>>;
1563
- target: z.ZodOptional<z.ZodObject<{
1564
- x: z.ZodNumber;
1565
- y: z.ZodNumber;
1566
- z: z.ZodOptional<z.ZodNumber>;
1567
- }, "strip", z.ZodTypeAny, {
1568
- x: number;
1569
- y: number;
1570
- z?: number | undefined;
1571
- }, {
1572
- x: number;
1573
- y: number;
1574
- z?: number | undefined;
1575
- }>>;
1576
- zoom: z.ZodOptional<z.ZodNumber>;
1577
- fov: z.ZodOptional<z.ZodNumber>;
1578
- mode: z.ZodOptional<z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>>;
1579
- }, "strip", z.ZodTypeAny, {
1580
- target?: {
1581
- x: number;
1582
- y: number;
1583
- z?: number | undefined;
1584
- } | undefined;
1585
- pos?: {
1586
- x: number;
1587
- y: number;
1588
- z?: number | undefined;
1589
- } | undefined;
1590
- zoom?: number | undefined;
1591
- fov?: number | undefined;
1592
- mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
1593
- }, {
1594
- target?: {
1595
- x: number;
1596
- y: number;
1597
- z?: number | undefined;
1598
- } | undefined;
1599
- pos?: {
1600
- x: number;
1601
- y: number;
1602
- z?: number | undefined;
1603
- } | undefined;
1604
- zoom?: number | undefined;
1605
- fov?: number | undefined;
1606
- mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
1607
- }>;
1608
- type SemanticAssetRefInput = z.input<typeof SemanticAssetRefSchema>;
1609
- type AnimationDefInput = z.input<typeof AnimationDefSchema>;
1610
- type AssetCatalogEntryInput = z.input<typeof AssetCatalogEntrySchema>;
1611
- type SpriteSheetAtlasInput = z.input<typeof SpriteSheetAtlasSchema>;
1612
- /**
1613
- * Creates a semantic asset key from role and category.
1614
- *
1615
- * Generates a unique asset identifier by combining role and category
1616
- * with a colon separator. Used for asset management and lookup.
1617
- *
1618
- * @param {EntityRole} role - Entity role (e.g., 'player', 'enemy')
1619
- * @param {string} category - Asset category (e.g., 'sprite', 'animation')
1620
- * @returns {string} Asset key in format 'role:category'
1621
- *
1622
- * @example
1623
- * createAssetKey('player', 'sprite'); // returns 'player:sprite'
1624
- * createAssetKey('enemy', 'animation'); // returns 'enemy:animation'
1625
- */
1626
- declare function createAssetKey(role: EntityRole, category: string): string;
1627
- /**
1628
- * Parses an asset key into role and category components.
1629
- *
1630
- * Deconstructs an asset key string (format 'role:category') into its
1631
- * constituent parts. Returns null if the key format is invalid.
1632
- *
1633
- * @param {string} key - Asset key in format 'role:category'
1634
- * @returns {{ role: string; category: string } | null} Parsed components or null
1635
- *
1636
- * @example
1637
- * parseAssetKey('player:sprite'); // returns { role: 'player', category: 'sprite' }
1638
- * parseAssetKey('enemy:animation'); // returns { role: 'enemy', category: 'animation' }
1639
- * parseAssetKey('invalid'); // returns null
1640
- */
1641
- declare function parseAssetKey(key: string): {
1642
- role: string;
1643
- category: string;
1644
- } | null;
1645
- /**
1646
- * Gets common animations for an entity role.
1647
- *
1648
- * Returns an array of default animation names appropriate for the
1649
- * specified entity role. Used for asset configuration and validation.
1650
- *
1651
- * @param {EntityRole} role - Entity role
1652
- * @returns {string[]} Array of default animation names
1653
- *
1654
- * @example
1655
- * getDefaultAnimationsForRole('player'); // returns ['idle', 'run', 'jump', 'fall', 'attack', 'hurt', 'die']
1656
- * getDefaultAnimationsForRole('enemy'); // returns ['idle', 'walk', 'attack', 'hurt', 'die']
1657
- */
1658
- declare function getDefaultAnimationsForRole(role: EntityRole): string[];
1659
- /**
1660
- * Validates that an asset reference has required animations.
1661
- *
1662
- * Checks if an asset reference contains all required animations.
1663
- * Returns an error message if validation fails, or null if valid.
1664
- *
1665
- * @param {SemanticAssetRef} assetRef - Asset reference to validate
1666
- * @param {string[]} requiredAnimations - Required animation names
1667
- * @returns {string | null} Error message or null if valid
1668
- *
1669
- * @example
1670
- * validateAssetAnimations(assetRef, ['idle', 'run']); // returns null if valid
1671
- * validateAssetAnimations(assetRef, ['missing-animation']); // returns error message
1672
- */
1673
- declare function validateAssetAnimations(assetRef: SemanticAssetRef, requiredAnimations: string[]): {
1674
- valid: boolean;
1675
- missing: string[];
1676
- };
1677
-
1678
- /**
1679
- * Entity Types for Orbital Units
1680
- *
1681
- * Defines the OrbitalEntity type - the nucleus of an Orbital Unit.
1682
- *
1683
- * @packageDocumentation
1684
- */
1685
-
1686
- /**
1687
- * Entity persistence types.
1688
- *
1689
- * - persistent: Stored in database (has collection)
1690
- * - runtime: Exists only at runtime (not persisted)
1691
- */
1692
- type EntityPersistence = 'persistent' | 'runtime';
1693
- declare const EntityPersistenceSchema: z.ZodEnum<["persistent", "runtime"]>;
1694
- /**
1695
- * OrbitalEntity - the nucleus of an Orbital Unit.
1696
- *
1697
- * This is a simplified entity definition optimized for orbital composition.
1698
- * Collection names are derived automatically from persistence type if not provided.
1699
- */
1700
- interface OrbitalEntity {
1701
- /** Entity name (PascalCase, e.g., "Task", "User") */
1702
- name: string;
1703
- /** Entity persistence type (defaults to 'persistent' if not specified) */
1704
- persistence?: EntityPersistence;
1705
- /** Whether this entity's state is shared across all bound traits (vs per-trait copy). Orthogonal to persistence. */
1706
- shared?: boolean;
1707
- /** Collection name (auto-derived if not provided for persistent entities) */
1708
- collection?: string;
1709
- /** Entity fields */
1710
- fields: EntityField[];
1711
- /** Pre-authored instances (seed data or static reference data) */
1712
- instances?: EntityRow[];
1713
- /** Auto-add createdAt/updatedAt timestamps */
1714
- timestamps?: boolean;
1715
- /** Soft delete support */
1716
- softDelete?: boolean;
1717
- /** Human-readable description */
1718
- description?: string;
1719
- /** Visual prompt for AI generation */
1720
- visual_prompt?: string;
1721
- /** Semantic asset reference for visual representation (games) */
1722
- assetRef?: SemanticAssetRef;
1723
- }
1724
- declare const OrbitalEntitySchema: z.ZodObject<{
1725
- name: z.ZodString;
1726
- persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
1727
- shared: z.ZodOptional<z.ZodBoolean>;
1728
- collection: z.ZodOptional<z.ZodString>;
1729
- fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
1730
- instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1731
- timestamps: z.ZodOptional<z.ZodBoolean>;
1732
- softDelete: z.ZodOptional<z.ZodBoolean>;
1733
- description: z.ZodOptional<z.ZodString>;
1734
- visual_prompt: z.ZodOptional<z.ZodString>;
1735
- assetRef: z.ZodOptional<z.ZodObject<{
1736
- role: z.ZodString;
1737
- category: z.ZodString;
1738
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1739
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1740
- variant: z.ZodOptional<z.ZodString>;
1741
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1742
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1743
- }, "strip", z.ZodTypeAny, {
1744
- role: string;
1745
- category: string;
1746
- animations?: string[] | undefined;
1747
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1748
- variant?: string | undefined;
1749
- dimension?: "2d" | "3d" | undefined;
1750
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1751
- }, {
1752
- role: string;
1753
- category: string;
1754
- animations?: string[] | undefined;
1755
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1756
- variant?: string | undefined;
1757
- dimension?: "2d" | "3d" | undefined;
1758
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1759
- }>>;
1760
- }, "strip", z.ZodTypeAny, {
1761
- name: string;
1762
- persistence: "persistent" | "runtime";
1763
- fields: EntityField[];
1764
- description?: string | undefined;
1765
- shared?: boolean | undefined;
1766
- collection?: string | undefined;
1767
- instances?: Record<string, unknown>[] | undefined;
1768
- timestamps?: boolean | undefined;
1769
- softDelete?: boolean | undefined;
1770
- visual_prompt?: string | undefined;
1771
- assetRef?: {
1772
- role: string;
1773
- category: string;
1774
- animations?: string[] | undefined;
1775
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1776
- variant?: string | undefined;
1777
- dimension?: "2d" | "3d" | undefined;
1778
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1779
- } | undefined;
1780
- }, {
1781
- name: string;
1782
- fields: unknown[];
1783
- description?: string | undefined;
1784
- persistence?: "persistent" | "runtime" | undefined;
1785
- shared?: boolean | undefined;
1786
- collection?: string | undefined;
1787
- instances?: Record<string, unknown>[] | undefined;
1788
- timestamps?: boolean | undefined;
1789
- softDelete?: boolean | undefined;
1790
- visual_prompt?: string | undefined;
1791
- assetRef?: {
1792
- role: string;
1793
- category: string;
1794
- animations?: string[] | undefined;
1795
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1796
- variant?: string | undefined;
1797
- dimension?: "2d" | "3d" | undefined;
1798
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1799
- } | undefined;
1800
- }>;
1801
- type OrbitalEntityInput = z.input<typeof OrbitalEntitySchema>;
1802
- /** Alias for OrbitalEntity - preferred name */
1803
- type Entity = OrbitalEntity;
1804
- /** Alias for OrbitalEntitySchema - preferred name */
1805
- declare const EntitySchema: z.ZodObject<{
1806
- name: z.ZodString;
1807
- persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
1808
- shared: z.ZodOptional<z.ZodBoolean>;
1809
- collection: z.ZodOptional<z.ZodString>;
1810
- fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
1811
- instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1812
- timestamps: z.ZodOptional<z.ZodBoolean>;
1813
- softDelete: z.ZodOptional<z.ZodBoolean>;
1814
- description: z.ZodOptional<z.ZodString>;
1815
- visual_prompt: z.ZodOptional<z.ZodString>;
1816
- assetRef: z.ZodOptional<z.ZodObject<{
1817
- role: z.ZodString;
1818
- category: z.ZodString;
1819
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1820
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1821
- variant: z.ZodOptional<z.ZodString>;
1822
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1823
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1824
- }, "strip", z.ZodTypeAny, {
1825
- role: string;
1826
- category: string;
1827
- animations?: string[] | undefined;
1828
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1829
- variant?: string | undefined;
1830
- dimension?: "2d" | "3d" | undefined;
1831
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1832
- }, {
1833
- role: string;
1834
- category: string;
1835
- animations?: string[] | undefined;
1836
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1837
- variant?: string | undefined;
1838
- dimension?: "2d" | "3d" | undefined;
1839
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1840
- }>>;
1841
- }, "strip", z.ZodTypeAny, {
1842
- name: string;
1843
- persistence: "persistent" | "runtime";
1844
- fields: EntityField[];
1845
- description?: string | undefined;
1846
- shared?: boolean | undefined;
1847
- collection?: string | undefined;
1848
- instances?: Record<string, unknown>[] | undefined;
1849
- timestamps?: boolean | undefined;
1850
- softDelete?: boolean | undefined;
1851
- visual_prompt?: string | undefined;
1852
- assetRef?: {
1853
- role: string;
1854
- category: string;
1855
- animations?: string[] | undefined;
1856
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1857
- variant?: string | undefined;
1858
- dimension?: "2d" | "3d" | undefined;
1859
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1860
- } | undefined;
1861
- }, {
1862
- name: string;
1863
- fields: unknown[];
1864
- description?: string | undefined;
1865
- persistence?: "persistent" | "runtime" | undefined;
1866
- shared?: boolean | undefined;
1867
- collection?: string | undefined;
1868
- instances?: Record<string, unknown>[] | undefined;
1869
- timestamps?: boolean | undefined;
1870
- softDelete?: boolean | undefined;
1871
- visual_prompt?: string | undefined;
1872
- assetRef?: {
1873
- role: string;
1874
- category: string;
1875
- animations?: string[] | undefined;
1876
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1877
- variant?: string | undefined;
1878
- dimension?: "2d" | "3d" | undefined;
1879
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1880
- } | undefined;
1881
- }>;
1882
- /**
1883
- * Derives the collection name for a persistent entity.
1884
- *
1885
- * Generates the database collection name by converting the entity name
1886
- * to lowercase and adding an 's' suffix (simple pluralization).
1887
- * Returns undefined for non-persistent (runtime) entities.
1888
- *
1889
- * @param {OrbitalEntity} entity - Entity to derive collection name for
1890
- * @returns {string | undefined} Collection name or undefined for non-persistent entities
1891
- *
1892
- * @example
1893
- * deriveCollection({ name: 'User', persistence: 'persistent' }); // returns 'users'
1894
- * deriveCollection({ name: 'Task', persistence: 'runtime' }); // returns undefined
1895
- */
1896
- declare function deriveCollection(entity: OrbitalEntity): string | undefined;
1897
- /**
1898
- * Checks if an entity is runtime-only (not persisted).
1899
- *
1900
- * Type guard to determine if an entity exists only at runtime
1901
- * and is not stored in the database.
1902
- *
1903
- * @param {OrbitalEntity} entity - Entity to check
1904
- * @returns {boolean} True if entity is runtime-only, false otherwise
1905
- *
1906
- * @example
1907
- * isRuntimeEntity({ persistence: 'runtime' }); // returns true
1908
- * isRuntimeEntity({ persistence: 'persistent' }); // returns false
1909
- */
1910
- declare function isRuntimeEntity(entity: OrbitalEntity): boolean;
1911
- /**
1912
- * Checks whether an entity's persistence mode allows `persistence` /
1913
- * `collection` overrides at the factory call site.
1914
- *
1915
- * Only `persistent` entities (explicit or default) support these overrides.
1916
- * Runtime entities are fixed; callers must not expose `persistence` or
1917
- * `collection` params for them.
1918
- *
1919
- * @param persistence - The entity persistence mode (undefined = default persistent)
1920
- * @returns True when overrides are allowed, false otherwise
1921
- *
1922
- * @example
1923
- * persistenceModeAllowsOverrides('persistent'); // returns true
1924
- * persistenceModeAllowsOverrides('runtime'); // returns false
1925
- * persistenceModeAllowsOverrides(undefined); // returns true (default persistent)
1926
- */
1927
- declare function persistenceModeAllowsOverrides(persistence: EntityPersistence | undefined): boolean;
1928
- /**
1929
- * A single field value at runtime.
1930
- * Union of all possible types from FieldType: string, number, boolean, date, array, nested.
1931
- * The nested-record branch's index signature tolerates `undefined` so that
1932
- * TypeScript optional properties (`x?: string`, carrying `string | undefined`)
1933
- * on EntityRow extenders typecheck without ceremony. At JSON serialization
1934
- * time `undefined` is equivalent to "key absent" and never appears on the
1935
- * wire; the inclusion here is a pure type-surface accommodation.
1936
- */
1937
- type FieldValue = string | number | boolean | Date | null | string[] | FieldValue[] | {
1938
- [key: string]: FieldValue | undefined;
1939
- };
1940
- /**
1941
- * Runtime guard for `FieldValue` — narrows interpreter-produced `unknown`
1942
- * values at typed substrate boundaries (e.g. `IntegrationContext.http` body).
1943
- */
1944
- declare function isFieldValue(value: unknown): value is FieldValue;
1945
- /**
1946
- * One instance of an entity with actual field values.
1947
- * The shape is determined by the Entity definition at schema time.
1948
- *
1949
- * @example
1950
- * // Entity defines: Patient { fullName: string, age: number, active: boolean }
1951
- * // EntityRow is: { id: "p1", fullName: "Sarah", age: 34, active: true }
1952
- */
1953
- type EntityRow = {
1954
- id?: string;
1955
- } & Record<string, FieldValue | undefined>;
1956
- /**
1957
- * A field-TYPED `EntityRow` — the SINGLE entity type, refined with a concrete
1958
- * field SHAPE `S`. Non-optional members of `S` are REQUIRED, each with its real
1959
- * type; the result stays `& EntityRow`, so the index signature is intact and
1960
- * every other field is still field-open — any domain entity that provides those
1961
- * fields satisfies it.
1962
- *
1963
- * One declaration, two jobs: (1) TypeScript enforces the bound entity has the
1964
- * fields WITH their types (a behavior binding a thinner/mistyped entity fails to
1965
- * typecheck); and (2) pattern-sync reads the same type and writes the entity
1966
- * prop's field shape (`properties` + `requiredFields`) onto the registry, so
1967
- * lolo-ui emits a COMPLETE `entity { … }` (every field, typed + demo-seeded) and
1968
- * the `ORB_X_ENTITY_PROP_CONTRACT` validator rejects an incompatible bind at
1969
- * `orbital validate`. (A raw `EntityRow & { rating: number }` intersection is
1970
- * equivalent for one-off shapes.)
1971
- *
1972
- * @example
1973
- * // HeroOrganism renders entity.title / entity.subtitle:
1974
- * entity?: EntityWith<{ title: string; subtitle?: string }>;
1975
- * // entity.title → string (required)
1976
- * // entity.subtitle → string | undefined (optional)
1977
- * // entity.other → FieldValue | undefined (still field-open)
1978
- */
1979
- type EntityWith<S extends object> = EntityRow & S;
1980
- /**
1981
- * Collection of entity instances keyed by entity name.
1982
- * Used by OrbPreview mockData, OrbitalServerRuntime state, data grids, etc.
1983
- *
1984
- * @example
1985
- * const data: EntityData = {
1986
- * Patient: [{ id: "1", fullName: "Sarah", age: 34 }],
1987
- * QueueEntry: [{ id: "1", patientName: "Sarah", waitMinutes: 12 }],
1988
- * };
1989
- */
1990
- type EntityData = Record<string, EntityRow[]>;
1991
-
1992
- /**
1993
- * Effect Types (Self-Contained)
1994
- *
1995
- * Defines effect types for trait transitions and ticks.
1996
- * Effects are S-expressions (arrays) that describe actions to perform.
1997
- *
1998
- * @packageDocumentation
1999
- */
2000
-
2001
- /**
2002
- * Known UI slots where content can be rendered
2003
- */
2004
- declare const UI_SLOTS: readonly ["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"];
2005
- type UISlot = (typeof UI_SLOTS)[number];
2006
- 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"]>;
2007
-
2008
- /**
2009
- * Configuration extracted from call-service effects
2010
- */
2011
- interface CallServiceConfig {
2012
- service: string;
2013
- action: string;
2014
- endpoint?: string;
2015
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
2016
- params?: ServiceParams;
2017
- onSuccess?: string;
2018
- onError?: string;
2019
- }
2020
- /**
2021
- * A binding reference to a render tree stored elsewhere — a trait `config`
2022
- * knob or a payload field — e.g. `"@config.bodyContent"`. Resolved to a pattern
2023
- * node at render time. This is how an atom renders a tree that contains data
2024
- * bindings (`entity: "@payload.data"`, `fields: "@config.fields"`): the tree is
2025
- * a permissive `TraitConfigValue` stored in `config` (a binding string is not a
2026
- * valid `AnyPatternConfig` prop value), and the render-ui effect points at it.
2027
- * Worked example: `std-browse`'s loaded transition is `['render-ui', 'main',
2028
- * '@config.bodyContent']`. The Rust validator accepts this form; this variant
2029
- * lets the TS effect type express it.
2030
- */
2031
- type RenderBinding = `@${string}`;
2032
- /**
2033
- * Render UI effect - displays a pattern in a UI slot.
2034
- * @example ['render-ui', 'main', { patternType: 'entity-table', columns: ['name'] }]
2035
- * @example ['render-ui', 'main', '@config.bodyContent'] // a {@link RenderBinding} target
2036
- */
2037
- type RenderUIEffect = ['render-ui', UISlot, AnyPatternConfig] | ['render-ui', UISlot, AnyPatternConfig, ResolvedPatternProps] | ['render-ui', UISlot, RenderBinding] | ['render-ui', UISlot, null];
2038
- /**
2039
- * Lambda expression for per-item rendering in data-grid/data-list.
2040
- * The compiler generates: {(paramName: Record<string, unknown>) => (<>JSX</>)}
2041
- * where @{paramName}.field bindings reference the current iteration item.
2042
- *
2043
- * @example ["fn", "item", { "type": "stack", "children": [{ "type": "typography", "content": "@item.title" }] }]
2044
- */
2045
- type RenderItemLambda = ['fn', string, AnyPatternConfig];
2046
- /**
2047
- * Navigate effect - navigates to an internal page path or an external URL.
2048
- * @example ['navigate', '/tasks'] or ['navigate', '/tasks/:id', { id: '123' }]
2049
- * @example ['navigate', 'https://example.com']
2050
- */
2051
- type NavigateEffect = ['navigate', string] | ['navigate', string, Record<string, string>];
2052
- /**
2053
- * Emit effect - emits an event, optionally with payload.
2054
- * @example ['emit', 'SAVE'] or ['emit', 'PLAYER_DIED', { playerId: '@entity.id' }]
2055
- * @example ['emit', 'FILTER_CHANGED', '@entity.filters']
2056
- */
2057
- type EmitEffect = ['emit', string] | ['emit', string, EventPayload | string];
2058
- /**
2059
- * `emit:` config block attached to async / reactive data operators.
2060
- *
2061
- * Each key names an event the runtime should fire on the bus when the
2062
- * effect reaches the corresponding lifecycle point. The set of keys an
2063
- * operator actually supports is enforced by the compiler validator:
2064
- *
2065
- * | Operator | Supported keys |
2066
- * |------------------|---------------------------|
2067
- * | `fetch` | `success`, `failure` |
2068
- * | `persist` | `success`, `failure` |
2069
- * | `call-service` | `success`, `failure` |
2070
- * | `set` | `success` |
2071
- * | `ref` | `on_change`, `failure` |
2072
- * | `os/watch-*` | `on_message`, `failure` |
2073
- *
2074
- * Payload convention:
2075
- * - `success` / `on_change` → the effect's result (fetched entity, new value)
2076
- * - `failure` → `{ error: string, code?: string }`
2077
- * - `on_message` → the incoming message (os/watch-* streams)
2078
- *
2079
- * See `docs/Almadar_Std_Gaps.md` §3.1 for the close-the-circuit design.
2080
- */
2081
- interface EmitConfig {
2082
- /** Fires after a one-shot async effect resolves successfully. */
2083
- success?: string;
2084
- /** Fires when the effect throws; payload is `{ error: string }`. */
2085
- failure?: string;
2086
- /** Reactive-subscription event (per update for `ref`). */
2087
- on_change?: string;
2088
- /** Per-event fire for `os/watch-*` streams. */
2089
- on_message?: string;
2090
- }
2091
- /**
2092
- * Set effect - sets a binding to a value.
2093
- *
2094
- * Two forms are supported to match the runtime's `set` handler signature
2095
- * `(targetId, field, value)`:
2096
- *
2097
- * - 3-element binding form (legacy / std behaviors): ['set', '@entity.field', value]
2098
- * - 4-element target form (canonical runtime): ['set', entityId, fieldName, value]
2099
- *
2100
- * The 4-element form is what `OrbitalServerRuntime`'s set handler
2101
- * dispatches directly (`update(entityType, targetId, { field: value })`).
2102
- * Prefer the 4-element form when authoring schemas in TypeScript that
2103
- * load directly into the runtime.
2104
- *
2105
- * @example ['set', '@entity.health', 100] // 3-element
2106
- * @example ['set', '@entity.id', 'health', 100] // 4-element
2107
- * @example ['set', '@entity.id', 'count', ['+', '@entity.count', 1]]
2108
- */
2109
- type SetEffect = ['set', string, unknown] | ['set', string, string, unknown];
2110
- /**
2111
- * Trailing config object on persist effects. When present, it carries the
2112
- * `emit` map specifying which events to fire on persist success/failure.
2113
- * Mirrors what the runtime's `EffectExecutor` reads at the 5th tuple
2114
- * position. See `(persist create Entity @payload.data { emit: { success:
2115
- * "Saved", failure: "SaveFailed" } })` in `.lolo` source.
2116
- */
2117
- interface PersistEmitConfig {
2118
- emit?: {
2119
- success?: string;
2120
- failure?: string;
2121
- };
2122
- }
2123
- /**
2124
- * Persist effect data argument: either an entity row literal (field map)
2125
- * or a binding string referencing a row in scope (e.g. `@payload.data`,
2126
- * `@entity`). At runtime, binding strings resolve to `EntityRow` values
2127
- * before the persist op runs.
2128
- */
2129
- type PersistData = EntityRow | string;
2130
- /**
2131
- * Persist effect - creates, updates, deletes, or clears entities.
2132
- *
2133
- * Each operation accepts an optional trailing `PersistEmitConfig` so the
2134
- * runtime can fire success / failure events when the operation completes.
2135
- *
2136
- * @example ['persist', 'create', 'Task', { title: '@payload.title' }]
2137
- * @example ['persist', 'update', '@entity.entityType', '@payload.data']
2138
- * @example ['persist', 'create', 'Task', '@payload.data', { emit: { success: 'TaskCreated' } }]
2139
- */
2140
- type PersistEffect = ['persist', 'create', string, PersistData] | ['persist', 'create', string, PersistData, PersistEmitConfig] | ['persist', 'update', string, PersistData] | ['persist', 'update', string, PersistData, PersistEmitConfig] | ['persist', 'delete', string] | ['persist', 'delete', string, PersistData] | ['persist', 'delete', string, PersistData, PersistEmitConfig] | ['persist', 'clear', string] | ['persist', 'clear', string, PersistData] | ['persist', 'clear', string, PersistData, PersistEmitConfig];
2141
- /**
2142
- * Call service effect - invokes an external service.
2143
- *
2144
- * Two shapes are accepted:
2145
- *
2146
- * 1. Flat form (what the runtime reads and every .orb file uses):
2147
- * `['call-service', serviceName, action, params?]` — args[0]=service,
2148
- * args[1]=action, args[2]=params. This is the canonical form; the
2149
- * runtime's EffectExecutor decodes exactly these positions.
2150
- *
2151
- * 2. Legacy config-object form (kept for the `callService()` helper):
2152
- * `['call-service', serviceName, CallServiceConfig]` — retained so
2153
- * older call sites using the builder helper continue to typecheck.
2154
- *
2155
- * @example ['call-service', 'llm', 'generate', { userPrompt: '@entity.inputText' }]
2156
- * @example ['call-service', 'llm', 'generate', { userPrompt: '...' }, { emit: { success: 'OK', failure: 'ERR' } }]
2157
- * @example ['call-service', 'WeatherAPI', { service: 'weather', action: 'get', onSuccess: 'OK' }]
2158
- */
2159
- type CallServiceEffect = ['call-service', string, string] | ['call-service', string, string, ServiceParams] | ['call-service', string, string, ServiceParams, PersistEmitConfig] | ['call-service', string, CallServiceConfig];
2160
- /**
2161
- * Spawn effect - creates a new entity instance (games).
2162
- * @example ['spawn', 'Bullet', { x: '@entity.x', y: '@entity.y' }]
918
+ * Spawn effect - creates a new entity instance (games).
919
+ * @example ['spawn', 'Bullet', { x: '@entity.x', y: '@entity.y' }]
2163
920
  */
2164
921
  type SpawnEffect = ['spawn', string] | ['spawn', string, EntityRow];
2165
922
  /**
@@ -2771,7 +1528,7 @@ declare const EventSchema: z.ZodObject<{
2771
1528
  name: string;
2772
1529
  required?: boolean | undefined;
2773
1530
  }[] | undefined;
2774
- classification?: "system" | "domain" | undefined;
1531
+ classification?: "domain" | "system" | undefined;
2775
1532
  semanticRole?: string | undefined;
2776
1533
  }, {
2777
1534
  name: string;
@@ -2784,7 +1541,7 @@ declare const EventSchema: z.ZodObject<{
2784
1541
  name: string;
2785
1542
  required?: boolean | undefined;
2786
1543
  }[] | undefined;
2787
- classification?: "system" | "domain" | undefined;
1544
+ classification?: "domain" | "system" | undefined;
2788
1545
  semanticRole?: string | undefined;
2789
1546
  }>;
2790
1547
  /**
@@ -2855,16 +1612,16 @@ declare const TransitionSchema: z.ZodObject<{
2855
1612
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
2856
1613
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2857
1614
  }, "strip", z.ZodTypeAny, {
1615
+ event: string;
2858
1616
  from: string;
2859
1617
  to: string;
2860
- event: string;
2861
1618
  description?: string | null | undefined;
2862
1619
  guard?: SExpr | undefined;
2863
1620
  effects?: unknown[][] | undefined;
2864
1621
  }, {
1622
+ event: string;
2865
1623
  from: string;
2866
1624
  to: string;
2867
- event: string;
2868
1625
  description?: string | null | undefined;
2869
1626
  guard?: SExpr | undefined;
2870
1627
  effects?: unknown[][] | undefined;
@@ -2940,7 +1697,7 @@ declare const StateMachineSchema: z.ZodObject<{
2940
1697
  name: string;
2941
1698
  required?: boolean | undefined;
2942
1699
  }[] | undefined;
2943
- classification?: "system" | "domain" | undefined;
1700
+ classification?: "domain" | "system" | undefined;
2944
1701
  semanticRole?: string | undefined;
2945
1702
  }, {
2946
1703
  name: string;
@@ -2953,7 +1710,7 @@ declare const StateMachineSchema: z.ZodObject<{
2953
1710
  name: string;
2954
1711
  required?: boolean | undefined;
2955
1712
  }[] | undefined;
2956
- classification?: "system" | "domain" | undefined;
1713
+ classification?: "domain" | "system" | undefined;
2957
1714
  semanticRole?: string | undefined;
2958
1715
  }>, "many">;
2959
1716
  transitions: z.ZodArray<z.ZodObject<{
@@ -2964,16 +1721,16 @@ declare const StateMachineSchema: z.ZodObject<{
2964
1721
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
2965
1722
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2966
1723
  }, "strip", z.ZodTypeAny, {
1724
+ event: string;
2967
1725
  from: string;
2968
1726
  to: string;
2969
- event: string;
2970
1727
  description?: string | null | undefined;
2971
1728
  guard?: SExpr | undefined;
2972
1729
  effects?: unknown[][] | undefined;
2973
1730
  }, {
1731
+ event: string;
2974
1732
  from: string;
2975
1733
  to: string;
2976
- event: string;
2977
1734
  description?: string | null | undefined;
2978
1735
  guard?: SExpr | undefined;
2979
1736
  effects?: unknown[][] | undefined;
@@ -3003,7 +1760,7 @@ declare const StateMachineSchema: z.ZodObject<{
3003
1760
  name: string;
3004
1761
  required?: boolean | undefined;
3005
1762
  }[] | undefined;
3006
- classification?: "system" | "domain" | undefined;
1763
+ classification?: "domain" | "system" | undefined;
3007
1764
  semanticRole?: string | undefined;
3008
1765
  }[];
3009
1766
  states: {
@@ -3016,9 +1773,9 @@ declare const StateMachineSchema: z.ZodObject<{
3016
1773
  onExit?: string[] | undefined;
3017
1774
  }[];
3018
1775
  transitions: {
1776
+ event: string;
3019
1777
  from: string;
3020
1778
  to: string;
3021
- event: string;
3022
1779
  description?: string | null | undefined;
3023
1780
  guard?: SExpr | undefined;
3024
1781
  effects?: unknown[][] | undefined;
@@ -3040,7 +1797,7 @@ declare const StateMachineSchema: z.ZodObject<{
3040
1797
  name: string;
3041
1798
  required?: boolean | undefined;
3042
1799
  }[] | undefined;
3043
- classification?: "system" | "domain" | undefined;
1800
+ classification?: "domain" | "system" | undefined;
3044
1801
  semanticRole?: string | undefined;
3045
1802
  }[];
3046
1803
  states: {
@@ -3053,9 +1810,9 @@ declare const StateMachineSchema: z.ZodObject<{
3053
1810
  onExit?: string[] | undefined;
3054
1811
  }[];
3055
1812
  transitions: {
1813
+ event: string;
3056
1814
  from: string;
3057
1815
  to: string;
3058
- event: string;
3059
1816
  description?: string | null | undefined;
3060
1817
  guard?: SExpr | undefined;
3061
1818
  effects?: unknown[][] | undefined;
@@ -3316,21 +2073,21 @@ declare const TraitTickSchema: z.ZodObject<{
3316
2073
  effects: unknown[][];
3317
2074
  interval: number | "frame";
3318
2075
  description?: string | undefined;
3319
- guard?: SExpr | undefined;
3320
- emits?: string[] | undefined;
3321
2076
  pages?: string[] | undefined;
2077
+ guard?: SExpr | undefined;
3322
2078
  priority?: number | undefined;
3323
2079
  appliesTo?: string[] | undefined;
2080
+ emits?: string[] | undefined;
3324
2081
  }, {
3325
2082
  name: string;
3326
2083
  effects: unknown[][];
3327
2084
  interval: number | "frame";
3328
2085
  description?: string | undefined;
3329
- guard?: SExpr | undefined;
3330
- emits?: string[] | undefined;
3331
2086
  pages?: string[] | undefined;
2087
+ guard?: SExpr | undefined;
3332
2088
  priority?: number | undefined;
3333
2089
  appliesTo?: string[] | undefined;
2090
+ emits?: string[] | undefined;
3334
2091
  }>;
3335
2092
  /**
3336
2093
  * Event scope determines visibility:
@@ -3465,6 +2222,7 @@ declare const TraitEventContractSchema: z.ZodObject<{
3465
2222
  event: string;
3466
2223
  description?: string | undefined;
3467
2224
  synonyms?: string | undefined;
2225
+ scope?: "internal" | "external" | undefined;
3468
2226
  tier?: string | undefined;
3469
2227
  payloadSchema?: {
3470
2228
  type: string;
@@ -3473,11 +2231,11 @@ declare const TraitEventContractSchema: z.ZodObject<{
3473
2231
  description?: string | undefined;
3474
2232
  entityType?: string | undefined;
3475
2233
  }[] | undefined;
3476
- scope?: "internal" | "external" | undefined;
3477
2234
  }, {
3478
2235
  event: string;
3479
2236
  description?: string | undefined;
3480
2237
  synonyms?: string | undefined;
2238
+ scope?: "internal" | "external" | undefined;
3481
2239
  tier?: string | undefined;
3482
2240
  payloadSchema?: {
3483
2241
  type: string;
@@ -3486,7 +2244,6 @@ declare const TraitEventContractSchema: z.ZodObject<{
3486
2244
  description?: string | undefined;
3487
2245
  entityType?: string | undefined;
3488
2246
  }[] | undefined;
3489
- scope?: "internal" | "external" | undefined;
3490
2247
  }>;
3491
2248
  /**
3492
2249
  * Event listener for trait communication.
@@ -3613,8 +2370,6 @@ declare const TraitEventListenerSchema: z.ZodObject<{
3613
2370
  triggers: string;
3614
2371
  description?: string | undefined;
3615
2372
  synonyms?: string | undefined;
3616
- tier?: string | undefined;
3617
- guard?: SExpr | undefined;
3618
2373
  source?: {
3619
2374
  kind: "any";
3620
2375
  } | {
@@ -3626,14 +2381,14 @@ declare const TraitEventListenerSchema: z.ZodObject<{
3626
2381
  orbital: string;
3627
2382
  } | undefined;
3628
2383
  scope?: "internal" | "external" | undefined;
2384
+ tier?: string | undefined;
2385
+ guard?: SExpr | undefined;
3629
2386
  payloadMapping?: Record<string, string> | undefined;
3630
2387
  }, {
3631
2388
  event: string;
3632
2389
  triggers: string;
3633
2390
  description?: string | undefined;
3634
2391
  synonyms?: string | undefined;
3635
- tier?: string | undefined;
3636
- guard?: SExpr | undefined;
3637
2392
  source?: {
3638
2393
  kind: "any";
3639
2394
  } | {
@@ -3645,6 +2400,8 @@ declare const TraitEventListenerSchema: z.ZodObject<{
3645
2400
  orbital: string;
3646
2401
  } | undefined;
3647
2402
  scope?: "internal" | "external" | undefined;
2403
+ tier?: string | undefined;
2404
+ guard?: SExpr | undefined;
3648
2405
  payloadMapping?: Record<string, string> | undefined;
3649
2406
  }>;
3650
2407
  /**
@@ -3772,9 +2529,9 @@ declare const TraitReferenceSchema: z.ZodEffects<z.ZodObject<{
3772
2529
  events?: Record<string, string> | undefined;
3773
2530
  from?: string | undefined;
3774
2531
  effects?: Record<string, unknown[]> | undefined;
3775
- listens?: unknown[] | undefined;
3776
2532
  appliesTo?: string[] | undefined;
3777
2533
  linkedEntity?: string | undefined;
2534
+ listens?: unknown[] | undefined;
3778
2535
  emitsScope?: "internal" | "external" | undefined;
3779
2536
  }, {
3780
2537
  ref: string;
@@ -3784,9 +2541,9 @@ declare const TraitReferenceSchema: z.ZodEffects<z.ZodObject<{
3784
2541
  events?: Record<string, string> | undefined;
3785
2542
  from?: string | undefined;
3786
2543
  effects?: Record<string, unknown[]> | undefined;
3787
- listens?: unknown[] | undefined;
3788
2544
  appliesTo?: string[] | undefined;
3789
2545
  linkedEntity?: string | undefined;
2546
+ listens?: unknown[] | undefined;
3790
2547
  emitsScope?: "internal" | "external" | undefined;
3791
2548
  }>, {
3792
2549
  ref: string;
@@ -3796,9 +2553,9 @@ declare const TraitReferenceSchema: z.ZodEffects<z.ZodObject<{
3796
2553
  events?: Record<string, string> | undefined;
3797
2554
  from?: string | undefined;
3798
2555
  effects?: Record<string, unknown[]> | undefined;
3799
- listens?: unknown[] | undefined;
3800
2556
  appliesTo?: string[] | undefined;
3801
2557
  linkedEntity?: string | undefined;
2558
+ listens?: unknown[] | undefined;
3802
2559
  emitsScope?: "internal" | "external" | undefined;
3803
2560
  }, {
3804
2561
  ref: string;
@@ -3808,9 +2565,9 @@ declare const TraitReferenceSchema: z.ZodEffects<z.ZodObject<{
3808
2565
  events?: Record<string, string> | undefined;
3809
2566
  from?: string | undefined;
3810
2567
  effects?: Record<string, unknown[]> | undefined;
3811
- listens?: unknown[] | undefined;
3812
2568
  appliesTo?: string[] | undefined;
3813
2569
  linkedEntity?: string | undefined;
2570
+ listens?: unknown[] | undefined;
3814
2571
  emitsScope?: "internal" | "external" | undefined;
3815
2572
  }>;
3816
2573
  /**
@@ -4144,7 +2901,7 @@ declare const TraitSchema: z.ZodObject<{
4144
2901
  name: string;
4145
2902
  required?: boolean | undefined;
4146
2903
  }[] | undefined;
4147
- classification?: "system" | "domain" | undefined;
2904
+ classification?: "domain" | "system" | undefined;
4148
2905
  semanticRole?: string | undefined;
4149
2906
  }, {
4150
2907
  name: string;
@@ -4157,7 +2914,7 @@ declare const TraitSchema: z.ZodObject<{
4157
2914
  name: string;
4158
2915
  required?: boolean | undefined;
4159
2916
  }[] | undefined;
4160
- classification?: "system" | "domain" | undefined;
2917
+ classification?: "domain" | "system" | undefined;
4161
2918
  semanticRole?: string | undefined;
4162
2919
  }>, "many">;
4163
2920
  transitions: z.ZodArray<z.ZodObject<{
@@ -4168,16 +2925,16 @@ declare const TraitSchema: z.ZodObject<{
4168
2925
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
4169
2926
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4170
2927
  }, "strip", z.ZodTypeAny, {
2928
+ event: string;
4171
2929
  from: string;
4172
2930
  to: string;
4173
- event: string;
4174
2931
  description?: string | null | undefined;
4175
2932
  guard?: SExpr | undefined;
4176
2933
  effects?: unknown[][] | undefined;
4177
2934
  }, {
2935
+ event: string;
4178
2936
  from: string;
4179
2937
  to: string;
4180
- event: string;
4181
2938
  description?: string | null | undefined;
4182
2939
  guard?: SExpr | undefined;
4183
2940
  effects?: unknown[][] | undefined;
@@ -4207,7 +2964,7 @@ declare const TraitSchema: z.ZodObject<{
4207
2964
  name: string;
4208
2965
  required?: boolean | undefined;
4209
2966
  }[] | undefined;
4210
- classification?: "system" | "domain" | undefined;
2967
+ classification?: "domain" | "system" | undefined;
4211
2968
  semanticRole?: string | undefined;
4212
2969
  }[];
4213
2970
  states: {
@@ -4220,9 +2977,9 @@ declare const TraitSchema: z.ZodObject<{
4220
2977
  onExit?: string[] | undefined;
4221
2978
  }[];
4222
2979
  transitions: {
2980
+ event: string;
4223
2981
  from: string;
4224
2982
  to: string;
4225
- event: string;
4226
2983
  description?: string | null | undefined;
4227
2984
  guard?: SExpr | undefined;
4228
2985
  effects?: unknown[][] | undefined;
@@ -4244,7 +3001,7 @@ declare const TraitSchema: z.ZodObject<{
4244
3001
  name: string;
4245
3002
  required?: boolean | undefined;
4246
3003
  }[] | undefined;
4247
- classification?: "system" | "domain" | undefined;
3004
+ classification?: "domain" | "system" | undefined;
4248
3005
  semanticRole?: string | undefined;
4249
3006
  }[];
4250
3007
  states: {
@@ -4257,9 +3014,9 @@ declare const TraitSchema: z.ZodObject<{
4257
3014
  onExit?: string[] | undefined;
4258
3015
  }[];
4259
3016
  transitions: {
3017
+ event: string;
4260
3018
  from: string;
4261
3019
  to: string;
4262
- event: string;
4263
3020
  description?: string | null | undefined;
4264
3021
  guard?: SExpr | undefined;
4265
3022
  effects?: unknown[][] | undefined;
@@ -4286,21 +3043,21 @@ declare const TraitSchema: z.ZodObject<{
4286
3043
  effects: unknown[][];
4287
3044
  interval: number | "frame";
4288
3045
  description?: string | undefined;
4289
- guard?: SExpr | undefined;
4290
- emits?: string[] | undefined;
4291
3046
  pages?: string[] | undefined;
3047
+ guard?: SExpr | undefined;
4292
3048
  priority?: number | undefined;
4293
3049
  appliesTo?: string[] | undefined;
3050
+ emits?: string[] | undefined;
4294
3051
  }, {
4295
3052
  name: string;
4296
3053
  effects: unknown[][];
4297
3054
  interval: number | "frame";
4298
3055
  description?: string | undefined;
4299
- guard?: SExpr | undefined;
4300
- emits?: string[] | undefined;
4301
3056
  pages?: string[] | undefined;
3057
+ guard?: SExpr | undefined;
4302
3058
  priority?: number | undefined;
4303
3059
  appliesTo?: string[] | undefined;
3060
+ emits?: string[] | undefined;
4304
3061
  }>, "many">>;
4305
3062
  emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
4306
3063
  /**
@@ -4348,6 +3105,7 @@ declare const TraitSchema: z.ZodObject<{
4348
3105
  event: string;
4349
3106
  description?: string | undefined;
4350
3107
  synonyms?: string | undefined;
3108
+ scope?: "internal" | "external" | undefined;
4351
3109
  tier?: string | undefined;
4352
3110
  payloadSchema?: {
4353
3111
  type: string;
@@ -4356,11 +3114,11 @@ declare const TraitSchema: z.ZodObject<{
4356
3114
  description?: string | undefined;
4357
3115
  entityType?: string | undefined;
4358
3116
  }[] | undefined;
4359
- scope?: "internal" | "external" | undefined;
4360
3117
  }, {
4361
3118
  event: string;
4362
3119
  description?: string | undefined;
4363
3120
  synonyms?: string | undefined;
3121
+ scope?: "internal" | "external" | undefined;
4364
3122
  tier?: string | undefined;
4365
3123
  payloadSchema?: {
4366
3124
  type: string;
@@ -4369,7 +3127,6 @@ declare const TraitSchema: z.ZodObject<{
4369
3127
  description?: string | undefined;
4370
3128
  entityType?: string | undefined;
4371
3129
  }[] | undefined;
4372
- scope?: "internal" | "external" | undefined;
4373
3130
  }>, "many">>;
4374
3131
  listens: z.ZodOptional<z.ZodArray<z.ZodObject<{
4375
3132
  event: z.ZodString;
@@ -4413,8 +3170,6 @@ declare const TraitSchema: z.ZodObject<{
4413
3170
  triggers: string;
4414
3171
  description?: string | undefined;
4415
3172
  synonyms?: string | undefined;
4416
- tier?: string | undefined;
4417
- guard?: SExpr | undefined;
4418
3173
  source?: {
4419
3174
  kind: "any";
4420
3175
  } | {
@@ -4426,14 +3181,14 @@ declare const TraitSchema: z.ZodObject<{
4426
3181
  orbital: string;
4427
3182
  } | undefined;
4428
3183
  scope?: "internal" | "external" | undefined;
3184
+ tier?: string | undefined;
3185
+ guard?: SExpr | undefined;
4429
3186
  payloadMapping?: Record<string, string> | undefined;
4430
3187
  }, {
4431
3188
  event: string;
4432
3189
  triggers: string;
4433
3190
  description?: string | undefined;
4434
3191
  synonyms?: string | undefined;
4435
- tier?: string | undefined;
4436
- guard?: SExpr | undefined;
4437
3192
  source?: {
4438
3193
  kind: "any";
4439
3194
  } | {
@@ -4445,6 +3200,8 @@ declare const TraitSchema: z.ZodObject<{
4445
3200
  orbital: string;
4446
3201
  } | undefined;
4447
3202
  scope?: "internal" | "external" | undefined;
3203
+ tier?: string | undefined;
3204
+ guard?: SExpr | undefined;
4448
3205
  payloadMapping?: Record<string, string> | undefined;
4449
3206
  }>, "many">>;
4450
3207
  ui: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -4547,54 +3304,6 @@ declare const TraitSchema: z.ZodObject<{
4547
3304
  category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
4548
3305
  config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
4549
3306
  capabilities?: string[] | undefined;
4550
- emits?: {
4551
- event: string;
4552
- description?: string | undefined;
4553
- synonyms?: string | undefined;
4554
- tier?: string | undefined;
4555
- payloadSchema?: {
4556
- type: string;
4557
- name: string;
4558
- required?: boolean | undefined;
4559
- description?: string | undefined;
4560
- entityType?: string | undefined;
4561
- }[] | undefined;
4562
- scope?: "internal" | "external" | undefined;
4563
- }[] | undefined;
4564
- listens?: {
4565
- event: string;
4566
- triggers: string;
4567
- description?: string | undefined;
4568
- synonyms?: string | undefined;
4569
- tier?: string | undefined;
4570
- guard?: SExpr | undefined;
4571
- source?: {
4572
- kind: "any";
4573
- } | {
4574
- trait: string;
4575
- kind: "trait";
4576
- } | {
4577
- trait: string;
4578
- kind: "orbital";
4579
- orbital: string;
4580
- } | undefined;
4581
- scope?: "internal" | "external" | undefined;
4582
- payloadMapping?: Record<string, string> | undefined;
4583
- }[] | undefined;
4584
- linkedEntity?: string | undefined;
4585
- description_visual_prompt?: string | undefined;
4586
- entityRebindable?: boolean | undefined;
4587
- entityContract?: {
4588
- requires: string[];
4589
- provides: string[];
4590
- } | undefined;
4591
- entityBindingDescription?: string | undefined;
4592
- entityBindingSynonyms?: string | undefined;
4593
- requiredFields?: {
4594
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
4595
- name: string;
4596
- description?: string | undefined;
4597
- }[] | undefined;
4598
3307
  dataEntities?: {
4599
3308
  name: string;
4600
3309
  fields: {
@@ -4623,7 +3332,7 @@ declare const TraitSchema: z.ZodObject<{
4623
3332
  name: string;
4624
3333
  required?: boolean | undefined;
4625
3334
  }[] | undefined;
4626
- classification?: "system" | "domain" | undefined;
3335
+ classification?: "domain" | "system" | undefined;
4627
3336
  semanticRole?: string | undefined;
4628
3337
  }[];
4629
3338
  states: {
@@ -4636,9 +3345,9 @@ declare const TraitSchema: z.ZodObject<{
4636
3345
  onExit?: string[] | undefined;
4637
3346
  }[];
4638
3347
  transitions: {
3348
+ event: string;
4639
3349
  from: string;
4640
3350
  to: string;
4641
- event: string;
4642
3351
  description?: string | null | undefined;
4643
3352
  guard?: SExpr | undefined;
4644
3353
  effects?: unknown[][] | undefined;
@@ -4649,56 +3358,11 @@ declare const TraitSchema: z.ZodObject<{
4649
3358
  description?: string | undefined;
4650
3359
  }[] | undefined;
4651
3360
  } | undefined;
4652
- initialEffects?: unknown[][] | undefined;
4653
- ticks?: {
4654
- name: string;
4655
- effects: unknown[][];
4656
- interval: number | "frame";
4657
- description?: string | undefined;
4658
- guard?: SExpr | undefined;
4659
- emits?: string[] | undefined;
4660
- pages?: string[] | undefined;
4661
- priority?: number | undefined;
4662
- appliesTo?: string[] | undefined;
4663
- }[] | undefined;
4664
- sourceBehavior?: {
4665
- behavior: string;
4666
- alias: string;
4667
- originalName: string;
4668
- } | undefined;
4669
- sourceEntityDefinition?: {
4670
- name: string;
4671
- persistence: "persistent" | "runtime";
4672
- fields: EntityField[];
4673
- description?: string | undefined;
4674
- shared?: boolean | undefined;
4675
- collection?: string | undefined;
4676
- instances?: Record<string, unknown>[] | undefined;
4677
- timestamps?: boolean | undefined;
4678
- softDelete?: boolean | undefined;
4679
- visual_prompt?: string | undefined;
4680
- assetRef?: {
4681
- role: string;
4682
- category: string;
4683
- animations?: string[] | undefined;
4684
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
4685
- variant?: string | undefined;
4686
- dimension?: "2d" | "3d" | undefined;
4687
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
4688
- } | undefined;
4689
- } | undefined;
4690
- }, {
4691
- name: string;
4692
- scope: "collection" | "instance";
4693
- description?: string | undefined;
4694
- ui?: Record<string, unknown> | undefined;
4695
- category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
4696
- config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
4697
- capabilities?: string[] | undefined;
4698
3361
  emits?: {
4699
3362
  event: string;
4700
3363
  description?: string | undefined;
4701
3364
  synonyms?: string | undefined;
3365
+ scope?: "internal" | "external" | undefined;
4702
3366
  tier?: string | undefined;
4703
3367
  payloadSchema?: {
4704
3368
  type: string;
@@ -4707,15 +3371,13 @@ declare const TraitSchema: z.ZodObject<{
4707
3371
  description?: string | undefined;
4708
3372
  entityType?: string | undefined;
4709
3373
  }[] | undefined;
4710
- scope?: "internal" | "external" | undefined;
4711
3374
  }[] | undefined;
3375
+ linkedEntity?: string | undefined;
4712
3376
  listens?: {
4713
3377
  event: string;
4714
3378
  triggers: string;
4715
3379
  description?: string | undefined;
4716
3380
  synonyms?: string | undefined;
4717
- tier?: string | undefined;
4718
- guard?: SExpr | undefined;
4719
3381
  source?: {
4720
3382
  kind: "any";
4721
3383
  } | {
@@ -4727,9 +3389,10 @@ declare const TraitSchema: z.ZodObject<{
4727
3389
  orbital: string;
4728
3390
  } | undefined;
4729
3391
  scope?: "internal" | "external" | undefined;
3392
+ tier?: string | undefined;
3393
+ guard?: SExpr | undefined;
4730
3394
  payloadMapping?: Record<string, string> | undefined;
4731
3395
  }[] | undefined;
4732
- linkedEntity?: string | undefined;
4733
3396
  description_visual_prompt?: string | undefined;
4734
3397
  entityRebindable?: boolean | undefined;
4735
3398
  entityContract?: {
@@ -4743,6 +3406,52 @@ declare const TraitSchema: z.ZodObject<{
4743
3406
  name: string;
4744
3407
  description?: string | undefined;
4745
3408
  }[] | undefined;
3409
+ initialEffects?: unknown[][] | undefined;
3410
+ ticks?: {
3411
+ name: string;
3412
+ effects: unknown[][];
3413
+ interval: number | "frame";
3414
+ description?: string | undefined;
3415
+ pages?: string[] | undefined;
3416
+ guard?: SExpr | undefined;
3417
+ priority?: number | undefined;
3418
+ appliesTo?: string[] | undefined;
3419
+ emits?: string[] | undefined;
3420
+ }[] | undefined;
3421
+ sourceBehavior?: {
3422
+ behavior: string;
3423
+ alias: string;
3424
+ originalName: string;
3425
+ } | undefined;
3426
+ sourceEntityDefinition?: {
3427
+ name: string;
3428
+ persistence: "persistent" | "runtime";
3429
+ fields: EntityField[];
3430
+ description?: string | undefined;
3431
+ shared?: boolean | undefined;
3432
+ collection?: string | undefined;
3433
+ instances?: Record<string, unknown>[] | undefined;
3434
+ timestamps?: boolean | undefined;
3435
+ softDelete?: boolean | undefined;
3436
+ visual_prompt?: string | undefined;
3437
+ assetRef?: {
3438
+ role: string;
3439
+ category: string;
3440
+ animations?: string[] | undefined;
3441
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
3442
+ variant?: string | undefined;
3443
+ dimension?: "2d" | "3d" | undefined;
3444
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
3445
+ } | undefined;
3446
+ } | undefined;
3447
+ }, {
3448
+ name: string;
3449
+ scope: "collection" | "instance";
3450
+ description?: string | undefined;
3451
+ ui?: Record<string, unknown> | undefined;
3452
+ category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
3453
+ config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
3454
+ capabilities?: string[] | undefined;
4746
3455
  dataEntities?: {
4747
3456
  name: string;
4748
3457
  fields: {
@@ -4771,7 +3480,7 @@ declare const TraitSchema: z.ZodObject<{
4771
3480
  name: string;
4772
3481
  required?: boolean | undefined;
4773
3482
  }[] | undefined;
4774
- classification?: "system" | "domain" | undefined;
3483
+ classification?: "domain" | "system" | undefined;
4775
3484
  semanticRole?: string | undefined;
4776
3485
  }[];
4777
3486
  states: {
@@ -4784,30 +3493,78 @@ declare const TraitSchema: z.ZodObject<{
4784
3493
  onExit?: string[] | undefined;
4785
3494
  }[];
4786
3495
  transitions: {
3496
+ event: string;
4787
3497
  from: string;
4788
3498
  to: string;
4789
- event: string;
4790
3499
  description?: string | null | undefined;
4791
3500
  guard?: SExpr | undefined;
4792
3501
  effects?: unknown[][] | undefined;
4793
3502
  }[];
4794
3503
  guards?: {
4795
3504
  name: string;
4796
- expression: SExpr;
3505
+ expression: SExpr;
3506
+ description?: string | undefined;
3507
+ }[] | undefined;
3508
+ } | undefined;
3509
+ emits?: {
3510
+ event: string;
3511
+ description?: string | undefined;
3512
+ synonyms?: string | undefined;
3513
+ scope?: "internal" | "external" | undefined;
3514
+ tier?: string | undefined;
3515
+ payloadSchema?: {
3516
+ type: string;
3517
+ name: string;
3518
+ required?: boolean | undefined;
4797
3519
  description?: string | undefined;
3520
+ entityType?: string | undefined;
4798
3521
  }[] | undefined;
3522
+ }[] | undefined;
3523
+ linkedEntity?: string | undefined;
3524
+ listens?: {
3525
+ event: string;
3526
+ triggers: string;
3527
+ description?: string | undefined;
3528
+ synonyms?: string | undefined;
3529
+ source?: {
3530
+ kind: "any";
3531
+ } | {
3532
+ trait: string;
3533
+ kind: "trait";
3534
+ } | {
3535
+ trait: string;
3536
+ kind: "orbital";
3537
+ orbital: string;
3538
+ } | undefined;
3539
+ scope?: "internal" | "external" | undefined;
3540
+ tier?: string | undefined;
3541
+ guard?: SExpr | undefined;
3542
+ payloadMapping?: Record<string, string> | undefined;
3543
+ }[] | undefined;
3544
+ description_visual_prompt?: string | undefined;
3545
+ entityRebindable?: boolean | undefined;
3546
+ entityContract?: {
3547
+ requires: string[];
3548
+ provides: string[];
4799
3549
  } | undefined;
3550
+ entityBindingDescription?: string | undefined;
3551
+ entityBindingSynonyms?: string | undefined;
3552
+ requiredFields?: {
3553
+ type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
3554
+ name: string;
3555
+ description?: string | undefined;
3556
+ }[] | undefined;
4800
3557
  initialEffects?: unknown[][] | undefined;
4801
3558
  ticks?: {
4802
3559
  name: string;
4803
3560
  effects: unknown[][];
4804
3561
  interval: number | "frame";
4805
3562
  description?: string | undefined;
4806
- guard?: SExpr | undefined;
4807
- emits?: string[] | undefined;
4808
3563
  pages?: string[] | undefined;
3564
+ guard?: SExpr | undefined;
4809
3565
  priority?: number | undefined;
4810
3566
  appliesTo?: string[] | undefined;
3567
+ emits?: string[] | undefined;
4811
3568
  }[] | undefined;
4812
3569
  sourceBehavior?: {
4813
3570
  behavior: string;
@@ -5004,7 +3761,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5004
3761
  name: string;
5005
3762
  required?: boolean | undefined;
5006
3763
  }[] | undefined;
5007
- classification?: "system" | "domain" | undefined;
3764
+ classification?: "domain" | "system" | undefined;
5008
3765
  semanticRole?: string | undefined;
5009
3766
  }, {
5010
3767
  name: string;
@@ -5017,7 +3774,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5017
3774
  name: string;
5018
3775
  required?: boolean | undefined;
5019
3776
  }[] | undefined;
5020
- classification?: "system" | "domain" | undefined;
3777
+ classification?: "domain" | "system" | undefined;
5021
3778
  semanticRole?: string | undefined;
5022
3779
  }>, "many">;
5023
3780
  transitions: z.ZodArray<z.ZodObject<{
@@ -5028,16 +3785,16 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5028
3785
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
5029
3786
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5030
3787
  }, "strip", z.ZodTypeAny, {
3788
+ event: string;
5031
3789
  from: string;
5032
3790
  to: string;
5033
- event: string;
5034
3791
  description?: string | null | undefined;
5035
3792
  guard?: SExpr | undefined;
5036
3793
  effects?: unknown[][] | undefined;
5037
3794
  }, {
3795
+ event: string;
5038
3796
  from: string;
5039
3797
  to: string;
5040
- event: string;
5041
3798
  description?: string | null | undefined;
5042
3799
  guard?: SExpr | undefined;
5043
3800
  effects?: unknown[][] | undefined;
@@ -5067,7 +3824,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5067
3824
  name: string;
5068
3825
  required?: boolean | undefined;
5069
3826
  }[] | undefined;
5070
- classification?: "system" | "domain" | undefined;
3827
+ classification?: "domain" | "system" | undefined;
5071
3828
  semanticRole?: string | undefined;
5072
3829
  }[];
5073
3830
  states: {
@@ -5080,9 +3837,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5080
3837
  onExit?: string[] | undefined;
5081
3838
  }[];
5082
3839
  transitions: {
3840
+ event: string;
5083
3841
  from: string;
5084
3842
  to: string;
5085
- event: string;
5086
3843
  description?: string | null | undefined;
5087
3844
  guard?: SExpr | undefined;
5088
3845
  effects?: unknown[][] | undefined;
@@ -5104,7 +3861,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5104
3861
  name: string;
5105
3862
  required?: boolean | undefined;
5106
3863
  }[] | undefined;
5107
- classification?: "system" | "domain" | undefined;
3864
+ classification?: "domain" | "system" | undefined;
5108
3865
  semanticRole?: string | undefined;
5109
3866
  }[];
5110
3867
  states: {
@@ -5117,9 +3874,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5117
3874
  onExit?: string[] | undefined;
5118
3875
  }[];
5119
3876
  transitions: {
3877
+ event: string;
5120
3878
  from: string;
5121
3879
  to: string;
5122
- event: string;
5123
3880
  description?: string | null | undefined;
5124
3881
  guard?: SExpr | undefined;
5125
3882
  effects?: unknown[][] | undefined;
@@ -5146,21 +3903,21 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5146
3903
  effects: unknown[][];
5147
3904
  interval: number | "frame";
5148
3905
  description?: string | undefined;
5149
- guard?: SExpr | undefined;
5150
- emits?: string[] | undefined;
5151
3906
  pages?: string[] | undefined;
3907
+ guard?: SExpr | undefined;
5152
3908
  priority?: number | undefined;
5153
3909
  appliesTo?: string[] | undefined;
3910
+ emits?: string[] | undefined;
5154
3911
  }, {
5155
3912
  name: string;
5156
3913
  effects: unknown[][];
5157
3914
  interval: number | "frame";
5158
3915
  description?: string | undefined;
5159
- guard?: SExpr | undefined;
5160
- emits?: string[] | undefined;
5161
3916
  pages?: string[] | undefined;
3917
+ guard?: SExpr | undefined;
5162
3918
  priority?: number | undefined;
5163
3919
  appliesTo?: string[] | undefined;
3920
+ emits?: string[] | undefined;
5164
3921
  }>, "many">>;
5165
3922
  emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
5166
3923
  /**
@@ -5208,6 +3965,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5208
3965
  event: string;
5209
3966
  description?: string | undefined;
5210
3967
  synonyms?: string | undefined;
3968
+ scope?: "internal" | "external" | undefined;
5211
3969
  tier?: string | undefined;
5212
3970
  payloadSchema?: {
5213
3971
  type: string;
@@ -5216,11 +3974,11 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5216
3974
  description?: string | undefined;
5217
3975
  entityType?: string | undefined;
5218
3976
  }[] | undefined;
5219
- scope?: "internal" | "external" | undefined;
5220
3977
  }, {
5221
3978
  event: string;
5222
3979
  description?: string | undefined;
5223
3980
  synonyms?: string | undefined;
3981
+ scope?: "internal" | "external" | undefined;
5224
3982
  tier?: string | undefined;
5225
3983
  payloadSchema?: {
5226
3984
  type: string;
@@ -5229,7 +3987,6 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5229
3987
  description?: string | undefined;
5230
3988
  entityType?: string | undefined;
5231
3989
  }[] | undefined;
5232
- scope?: "internal" | "external" | undefined;
5233
3990
  }>, "many">>;
5234
3991
  listens: z.ZodOptional<z.ZodArray<z.ZodObject<{
5235
3992
  event: z.ZodString;
@@ -5273,8 +4030,6 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5273
4030
  triggers: string;
5274
4031
  description?: string | undefined;
5275
4032
  synonyms?: string | undefined;
5276
- tier?: string | undefined;
5277
- guard?: SExpr | undefined;
5278
4033
  source?: {
5279
4034
  kind: "any";
5280
4035
  } | {
@@ -5286,14 +4041,14 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5286
4041
  orbital: string;
5287
4042
  } | undefined;
5288
4043
  scope?: "internal" | "external" | undefined;
4044
+ tier?: string | undefined;
4045
+ guard?: SExpr | undefined;
5289
4046
  payloadMapping?: Record<string, string> | undefined;
5290
4047
  }, {
5291
4048
  event: string;
5292
4049
  triggers: string;
5293
4050
  description?: string | undefined;
5294
4051
  synonyms?: string | undefined;
5295
- tier?: string | undefined;
5296
- guard?: SExpr | undefined;
5297
4052
  source?: {
5298
4053
  kind: "any";
5299
4054
  } | {
@@ -5305,6 +4060,8 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5305
4060
  orbital: string;
5306
4061
  } | undefined;
5307
4062
  scope?: "internal" | "external" | undefined;
4063
+ tier?: string | undefined;
4064
+ guard?: SExpr | undefined;
5308
4065
  payloadMapping?: Record<string, string> | undefined;
5309
4066
  }>, "many">>;
5310
4067
  ui: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -5407,54 +4164,6 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5407
4164
  category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
5408
4165
  config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
5409
4166
  capabilities?: string[] | undefined;
5410
- emits?: {
5411
- event: string;
5412
- description?: string | undefined;
5413
- synonyms?: string | undefined;
5414
- tier?: string | undefined;
5415
- payloadSchema?: {
5416
- type: string;
5417
- name: string;
5418
- required?: boolean | undefined;
5419
- description?: string | undefined;
5420
- entityType?: string | undefined;
5421
- }[] | undefined;
5422
- scope?: "internal" | "external" | undefined;
5423
- }[] | undefined;
5424
- listens?: {
5425
- event: string;
5426
- triggers: string;
5427
- description?: string | undefined;
5428
- synonyms?: string | undefined;
5429
- tier?: string | undefined;
5430
- guard?: SExpr | undefined;
5431
- source?: {
5432
- kind: "any";
5433
- } | {
5434
- trait: string;
5435
- kind: "trait";
5436
- } | {
5437
- trait: string;
5438
- kind: "orbital";
5439
- orbital: string;
5440
- } | undefined;
5441
- scope?: "internal" | "external" | undefined;
5442
- payloadMapping?: Record<string, string> | undefined;
5443
- }[] | undefined;
5444
- linkedEntity?: string | undefined;
5445
- description_visual_prompt?: string | undefined;
5446
- entityRebindable?: boolean | undefined;
5447
- entityContract?: {
5448
- requires: string[];
5449
- provides: string[];
5450
- } | undefined;
5451
- entityBindingDescription?: string | undefined;
5452
- entityBindingSynonyms?: string | undefined;
5453
- requiredFields?: {
5454
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
5455
- name: string;
5456
- description?: string | undefined;
5457
- }[] | undefined;
5458
4167
  dataEntities?: {
5459
4168
  name: string;
5460
4169
  fields: {
@@ -5483,7 +4192,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5483
4192
  name: string;
5484
4193
  required?: boolean | undefined;
5485
4194
  }[] | undefined;
5486
- classification?: "system" | "domain" | undefined;
4195
+ classification?: "domain" | "system" | undefined;
5487
4196
  semanticRole?: string | undefined;
5488
4197
  }[];
5489
4198
  states: {
@@ -5496,9 +4205,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5496
4205
  onExit?: string[] | undefined;
5497
4206
  }[];
5498
4207
  transitions: {
4208
+ event: string;
5499
4209
  from: string;
5500
4210
  to: string;
5501
- event: string;
5502
4211
  description?: string | null | undefined;
5503
4212
  guard?: SExpr | undefined;
5504
4213
  effects?: unknown[][] | undefined;
@@ -5509,56 +4218,11 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5509
4218
  description?: string | undefined;
5510
4219
  }[] | undefined;
5511
4220
  } | undefined;
5512
- initialEffects?: unknown[][] | undefined;
5513
- ticks?: {
5514
- name: string;
5515
- effects: unknown[][];
5516
- interval: number | "frame";
5517
- description?: string | undefined;
5518
- guard?: SExpr | undefined;
5519
- emits?: string[] | undefined;
5520
- pages?: string[] | undefined;
5521
- priority?: number | undefined;
5522
- appliesTo?: string[] | undefined;
5523
- }[] | undefined;
5524
- sourceBehavior?: {
5525
- behavior: string;
5526
- alias: string;
5527
- originalName: string;
5528
- } | undefined;
5529
- sourceEntityDefinition?: {
5530
- name: string;
5531
- persistence: "persistent" | "runtime";
5532
- fields: EntityField[];
5533
- description?: string | undefined;
5534
- shared?: boolean | undefined;
5535
- collection?: string | undefined;
5536
- instances?: Record<string, unknown>[] | undefined;
5537
- timestamps?: boolean | undefined;
5538
- softDelete?: boolean | undefined;
5539
- visual_prompt?: string | undefined;
5540
- assetRef?: {
5541
- role: string;
5542
- category: string;
5543
- animations?: string[] | undefined;
5544
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
5545
- variant?: string | undefined;
5546
- dimension?: "2d" | "3d" | undefined;
5547
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
5548
- } | undefined;
5549
- } | undefined;
5550
- }, {
5551
- name: string;
5552
- scope: "collection" | "instance";
5553
- description?: string | undefined;
5554
- ui?: Record<string, unknown> | undefined;
5555
- category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
5556
- config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
5557
- capabilities?: string[] | undefined;
5558
4221
  emits?: {
5559
4222
  event: string;
5560
4223
  description?: string | undefined;
5561
4224
  synonyms?: string | undefined;
4225
+ scope?: "internal" | "external" | undefined;
5562
4226
  tier?: string | undefined;
5563
4227
  payloadSchema?: {
5564
4228
  type: string;
@@ -5567,15 +4231,13 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5567
4231
  description?: string | undefined;
5568
4232
  entityType?: string | undefined;
5569
4233
  }[] | undefined;
5570
- scope?: "internal" | "external" | undefined;
5571
4234
  }[] | undefined;
4235
+ linkedEntity?: string | undefined;
5572
4236
  listens?: {
5573
4237
  event: string;
5574
4238
  triggers: string;
5575
4239
  description?: string | undefined;
5576
4240
  synonyms?: string | undefined;
5577
- tier?: string | undefined;
5578
- guard?: SExpr | undefined;
5579
4241
  source?: {
5580
4242
  kind: "any";
5581
4243
  } | {
@@ -5587,9 +4249,10 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5587
4249
  orbital: string;
5588
4250
  } | undefined;
5589
4251
  scope?: "internal" | "external" | undefined;
4252
+ tier?: string | undefined;
4253
+ guard?: SExpr | undefined;
5590
4254
  payloadMapping?: Record<string, string> | undefined;
5591
4255
  }[] | undefined;
5592
- linkedEntity?: string | undefined;
5593
4256
  description_visual_prompt?: string | undefined;
5594
4257
  entityRebindable?: boolean | undefined;
5595
4258
  entityContract?: {
@@ -5603,6 +4266,52 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5603
4266
  name: string;
5604
4267
  description?: string | undefined;
5605
4268
  }[] | undefined;
4269
+ initialEffects?: unknown[][] | undefined;
4270
+ ticks?: {
4271
+ name: string;
4272
+ effects: unknown[][];
4273
+ interval: number | "frame";
4274
+ description?: string | undefined;
4275
+ pages?: string[] | undefined;
4276
+ guard?: SExpr | undefined;
4277
+ priority?: number | undefined;
4278
+ appliesTo?: string[] | undefined;
4279
+ emits?: string[] | undefined;
4280
+ }[] | undefined;
4281
+ sourceBehavior?: {
4282
+ behavior: string;
4283
+ alias: string;
4284
+ originalName: string;
4285
+ } | undefined;
4286
+ sourceEntityDefinition?: {
4287
+ name: string;
4288
+ persistence: "persistent" | "runtime";
4289
+ fields: EntityField[];
4290
+ description?: string | undefined;
4291
+ shared?: boolean | undefined;
4292
+ collection?: string | undefined;
4293
+ instances?: Record<string, unknown>[] | undefined;
4294
+ timestamps?: boolean | undefined;
4295
+ softDelete?: boolean | undefined;
4296
+ visual_prompt?: string | undefined;
4297
+ assetRef?: {
4298
+ role: string;
4299
+ category: string;
4300
+ animations?: string[] | undefined;
4301
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
4302
+ variant?: string | undefined;
4303
+ dimension?: "2d" | "3d" | undefined;
4304
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
4305
+ } | undefined;
4306
+ } | undefined;
4307
+ }, {
4308
+ name: string;
4309
+ scope: "collection" | "instance";
4310
+ description?: string | undefined;
4311
+ ui?: Record<string, unknown> | undefined;
4312
+ category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
4313
+ config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
4314
+ capabilities?: string[] | undefined;
5606
4315
  dataEntities?: {
5607
4316
  name: string;
5608
4317
  fields: {
@@ -5631,7 +4340,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5631
4340
  name: string;
5632
4341
  required?: boolean | undefined;
5633
4342
  }[] | undefined;
5634
- classification?: "system" | "domain" | undefined;
4343
+ classification?: "domain" | "system" | undefined;
5635
4344
  semanticRole?: string | undefined;
5636
4345
  }[];
5637
4346
  states: {
@@ -5644,9 +4353,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5644
4353
  onExit?: string[] | undefined;
5645
4354
  }[];
5646
4355
  transitions: {
4356
+ event: string;
5647
4357
  from: string;
5648
4358
  to: string;
5649
- event: string;
5650
4359
  description?: string | null | undefined;
5651
4360
  guard?: SExpr | undefined;
5652
4361
  effects?: unknown[][] | undefined;
@@ -5657,17 +4366,65 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5657
4366
  description?: string | undefined;
5658
4367
  }[] | undefined;
5659
4368
  } | undefined;
4369
+ emits?: {
4370
+ event: string;
4371
+ description?: string | undefined;
4372
+ synonyms?: string | undefined;
4373
+ scope?: "internal" | "external" | undefined;
4374
+ tier?: string | undefined;
4375
+ payloadSchema?: {
4376
+ type: string;
4377
+ name: string;
4378
+ required?: boolean | undefined;
4379
+ description?: string | undefined;
4380
+ entityType?: string | undefined;
4381
+ }[] | undefined;
4382
+ }[] | undefined;
4383
+ linkedEntity?: string | undefined;
4384
+ listens?: {
4385
+ event: string;
4386
+ triggers: string;
4387
+ description?: string | undefined;
4388
+ synonyms?: string | undefined;
4389
+ source?: {
4390
+ kind: "any";
4391
+ } | {
4392
+ trait: string;
4393
+ kind: "trait";
4394
+ } | {
4395
+ trait: string;
4396
+ kind: "orbital";
4397
+ orbital: string;
4398
+ } | undefined;
4399
+ scope?: "internal" | "external" | undefined;
4400
+ tier?: string | undefined;
4401
+ guard?: SExpr | undefined;
4402
+ payloadMapping?: Record<string, string> | undefined;
4403
+ }[] | undefined;
4404
+ description_visual_prompt?: string | undefined;
4405
+ entityRebindable?: boolean | undefined;
4406
+ entityContract?: {
4407
+ requires: string[];
4408
+ provides: string[];
4409
+ } | undefined;
4410
+ entityBindingDescription?: string | undefined;
4411
+ entityBindingSynonyms?: string | undefined;
4412
+ requiredFields?: {
4413
+ type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
4414
+ name: string;
4415
+ description?: string | undefined;
4416
+ }[] | undefined;
5660
4417
  initialEffects?: unknown[][] | undefined;
5661
4418
  ticks?: {
5662
4419
  name: string;
5663
4420
  effects: unknown[][];
5664
4421
  interval: number | "frame";
5665
4422
  description?: string | undefined;
5666
- guard?: SExpr | undefined;
5667
- emits?: string[] | undefined;
5668
4423
  pages?: string[] | undefined;
4424
+ guard?: SExpr | undefined;
5669
4425
  priority?: number | undefined;
5670
4426
  appliesTo?: string[] | undefined;
4427
+ emits?: string[] | undefined;
5671
4428
  }[] | undefined;
5672
4429
  sourceBehavior?: {
5673
4430
  behavior: string;
@@ -5934,7 +4691,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5934
4691
  name: string;
5935
4692
  required?: boolean | undefined;
5936
4693
  }[] | undefined;
5937
- classification?: "system" | "domain" | undefined;
4694
+ classification?: "domain" | "system" | undefined;
5938
4695
  semanticRole?: string | undefined;
5939
4696
  }, {
5940
4697
  name: string;
@@ -5947,7 +4704,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5947
4704
  name: string;
5948
4705
  required?: boolean | undefined;
5949
4706
  }[] | undefined;
5950
- classification?: "system" | "domain" | undefined;
4707
+ classification?: "domain" | "system" | undefined;
5951
4708
  semanticRole?: string | undefined;
5952
4709
  }>, "many">;
5953
4710
  transitions: z.ZodArray<z.ZodObject<{
@@ -5958,16 +4715,16 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5958
4715
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
5959
4716
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5960
4717
  }, "strip", z.ZodTypeAny, {
4718
+ event: string;
5961
4719
  from: string;
5962
4720
  to: string;
5963
- event: string;
5964
4721
  description?: string | null | undefined;
5965
4722
  guard?: SExpr | undefined;
5966
4723
  effects?: unknown[][] | undefined;
5967
4724
  }, {
4725
+ event: string;
5968
4726
  from: string;
5969
4727
  to: string;
5970
- event: string;
5971
4728
  description?: string | null | undefined;
5972
4729
  guard?: SExpr | undefined;
5973
4730
  effects?: unknown[][] | undefined;
@@ -5997,7 +4754,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5997
4754
  name: string;
5998
4755
  required?: boolean | undefined;
5999
4756
  }[] | undefined;
6000
- classification?: "system" | "domain" | undefined;
4757
+ classification?: "domain" | "system" | undefined;
6001
4758
  semanticRole?: string | undefined;
6002
4759
  }[];
6003
4760
  states: {
@@ -6010,9 +4767,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6010
4767
  onExit?: string[] | undefined;
6011
4768
  }[];
6012
4769
  transitions: {
4770
+ event: string;
6013
4771
  from: string;
6014
4772
  to: string;
6015
- event: string;
6016
4773
  description?: string | null | undefined;
6017
4774
  guard?: SExpr | undefined;
6018
4775
  effects?: unknown[][] | undefined;
@@ -6034,7 +4791,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6034
4791
  name: string;
6035
4792
  required?: boolean | undefined;
6036
4793
  }[] | undefined;
6037
- classification?: "system" | "domain" | undefined;
4794
+ classification?: "domain" | "system" | undefined;
6038
4795
  semanticRole?: string | undefined;
6039
4796
  }[];
6040
4797
  states: {
@@ -6047,9 +4804,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6047
4804
  onExit?: string[] | undefined;
6048
4805
  }[];
6049
4806
  transitions: {
4807
+ event: string;
6050
4808
  from: string;
6051
4809
  to: string;
6052
- event: string;
6053
4810
  description?: string | null | undefined;
6054
4811
  guard?: SExpr | undefined;
6055
4812
  effects?: unknown[][] | undefined;
@@ -6076,21 +4833,21 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6076
4833
  effects: unknown[][];
6077
4834
  interval: number | "frame";
6078
4835
  description?: string | undefined;
6079
- guard?: SExpr | undefined;
6080
- emits?: string[] | undefined;
6081
4836
  pages?: string[] | undefined;
4837
+ guard?: SExpr | undefined;
6082
4838
  priority?: number | undefined;
6083
4839
  appliesTo?: string[] | undefined;
4840
+ emits?: string[] | undefined;
6084
4841
  }, {
6085
4842
  name: string;
6086
4843
  effects: unknown[][];
6087
4844
  interval: number | "frame";
6088
4845
  description?: string | undefined;
6089
- guard?: SExpr | undefined;
6090
- emits?: string[] | undefined;
6091
4846
  pages?: string[] | undefined;
4847
+ guard?: SExpr | undefined;
6092
4848
  priority?: number | undefined;
6093
4849
  appliesTo?: string[] | undefined;
4850
+ emits?: string[] | undefined;
6094
4851
  }>, "many">>;
6095
4852
  emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
6096
4853
  /**
@@ -6138,6 +4895,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6138
4895
  event: string;
6139
4896
  description?: string | undefined;
6140
4897
  synonyms?: string | undefined;
4898
+ scope?: "internal" | "external" | undefined;
6141
4899
  tier?: string | undefined;
6142
4900
  payloadSchema?: {
6143
4901
  type: string;
@@ -6146,11 +4904,11 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6146
4904
  description?: string | undefined;
6147
4905
  entityType?: string | undefined;
6148
4906
  }[] | undefined;
6149
- scope?: "internal" | "external" | undefined;
6150
4907
  }, {
6151
4908
  event: string;
6152
4909
  description?: string | undefined;
6153
4910
  synonyms?: string | undefined;
4911
+ scope?: "internal" | "external" | undefined;
6154
4912
  tier?: string | undefined;
6155
4913
  payloadSchema?: {
6156
4914
  type: string;
@@ -6159,7 +4917,6 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6159
4917
  description?: string | undefined;
6160
4918
  entityType?: string | undefined;
6161
4919
  }[] | undefined;
6162
- scope?: "internal" | "external" | undefined;
6163
4920
  }>, "many">>;
6164
4921
  listens: z.ZodOptional<z.ZodArray<z.ZodObject<{
6165
4922
  event: z.ZodString;
@@ -6203,8 +4960,6 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6203
4960
  triggers: string;
6204
4961
  description?: string | undefined;
6205
4962
  synonyms?: string | undefined;
6206
- tier?: string | undefined;
6207
- guard?: SExpr | undefined;
6208
4963
  source?: {
6209
4964
  kind: "any";
6210
4965
  } | {
@@ -6216,14 +4971,14 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6216
4971
  orbital: string;
6217
4972
  } | undefined;
6218
4973
  scope?: "internal" | "external" | undefined;
4974
+ tier?: string | undefined;
4975
+ guard?: SExpr | undefined;
6219
4976
  payloadMapping?: Record<string, string> | undefined;
6220
4977
  }, {
6221
4978
  event: string;
6222
4979
  triggers: string;
6223
4980
  description?: string | undefined;
6224
4981
  synonyms?: string | undefined;
6225
- tier?: string | undefined;
6226
- guard?: SExpr | undefined;
6227
4982
  source?: {
6228
4983
  kind: "any";
6229
4984
  } | {
@@ -6235,6 +4990,8 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6235
4990
  orbital: string;
6236
4991
  } | undefined;
6237
4992
  scope?: "internal" | "external" | undefined;
4993
+ tier?: string | undefined;
4994
+ guard?: SExpr | undefined;
6238
4995
  payloadMapping?: Record<string, string> | undefined;
6239
4996
  }>, "many">>;
6240
4997
  ui: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -6337,54 +5094,6 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6337
5094
  category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
6338
5095
  config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
6339
5096
  capabilities?: string[] | undefined;
6340
- emits?: {
6341
- event: string;
6342
- description?: string | undefined;
6343
- synonyms?: string | undefined;
6344
- tier?: string | undefined;
6345
- payloadSchema?: {
6346
- type: string;
6347
- name: string;
6348
- required?: boolean | undefined;
6349
- description?: string | undefined;
6350
- entityType?: string | undefined;
6351
- }[] | undefined;
6352
- scope?: "internal" | "external" | undefined;
6353
- }[] | undefined;
6354
- listens?: {
6355
- event: string;
6356
- triggers: string;
6357
- description?: string | undefined;
6358
- synonyms?: string | undefined;
6359
- tier?: string | undefined;
6360
- guard?: SExpr | undefined;
6361
- source?: {
6362
- kind: "any";
6363
- } | {
6364
- trait: string;
6365
- kind: "trait";
6366
- } | {
6367
- trait: string;
6368
- kind: "orbital";
6369
- orbital: string;
6370
- } | undefined;
6371
- scope?: "internal" | "external" | undefined;
6372
- payloadMapping?: Record<string, string> | undefined;
6373
- }[] | undefined;
6374
- linkedEntity?: string | undefined;
6375
- description_visual_prompt?: string | undefined;
6376
- entityRebindable?: boolean | undefined;
6377
- entityContract?: {
6378
- requires: string[];
6379
- provides: string[];
6380
- } | undefined;
6381
- entityBindingDescription?: string | undefined;
6382
- entityBindingSynonyms?: string | undefined;
6383
- requiredFields?: {
6384
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
6385
- name: string;
6386
- description?: string | undefined;
6387
- }[] | undefined;
6388
5097
  dataEntities?: {
6389
5098
  name: string;
6390
5099
  fields: {
@@ -6413,7 +5122,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6413
5122
  name: string;
6414
5123
  required?: boolean | undefined;
6415
5124
  }[] | undefined;
6416
- classification?: "system" | "domain" | undefined;
5125
+ classification?: "domain" | "system" | undefined;
6417
5126
  semanticRole?: string | undefined;
6418
5127
  }[];
6419
5128
  states: {
@@ -6426,9 +5135,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6426
5135
  onExit?: string[] | undefined;
6427
5136
  }[];
6428
5137
  transitions: {
5138
+ event: string;
6429
5139
  from: string;
6430
5140
  to: string;
6431
- event: string;
6432
5141
  description?: string | null | undefined;
6433
5142
  guard?: SExpr | undefined;
6434
5143
  effects?: unknown[][] | undefined;
@@ -6439,56 +5148,11 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6439
5148
  description?: string | undefined;
6440
5149
  }[] | undefined;
6441
5150
  } | undefined;
6442
- initialEffects?: unknown[][] | undefined;
6443
- ticks?: {
6444
- name: string;
6445
- effects: unknown[][];
6446
- interval: number | "frame";
6447
- description?: string | undefined;
6448
- guard?: SExpr | undefined;
6449
- emits?: string[] | undefined;
6450
- pages?: string[] | undefined;
6451
- priority?: number | undefined;
6452
- appliesTo?: string[] | undefined;
6453
- }[] | undefined;
6454
- sourceBehavior?: {
6455
- behavior: string;
6456
- alias: string;
6457
- originalName: string;
6458
- } | undefined;
6459
- sourceEntityDefinition?: {
6460
- name: string;
6461
- persistence: "persistent" | "runtime";
6462
- fields: EntityField[];
6463
- description?: string | undefined;
6464
- shared?: boolean | undefined;
6465
- collection?: string | undefined;
6466
- instances?: Record<string, unknown>[] | undefined;
6467
- timestamps?: boolean | undefined;
6468
- softDelete?: boolean | undefined;
6469
- visual_prompt?: string | undefined;
6470
- assetRef?: {
6471
- role: string;
6472
- category: string;
6473
- animations?: string[] | undefined;
6474
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
6475
- variant?: string | undefined;
6476
- dimension?: "2d" | "3d" | undefined;
6477
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
6478
- } | undefined;
6479
- } | undefined;
6480
- }, {
6481
- name: string;
6482
- scope: "collection" | "instance";
6483
- description?: string | undefined;
6484
- ui?: Record<string, unknown> | undefined;
6485
- category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
6486
- config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
6487
- capabilities?: string[] | undefined;
6488
5151
  emits?: {
6489
5152
  event: string;
6490
5153
  description?: string | undefined;
6491
5154
  synonyms?: string | undefined;
5155
+ scope?: "internal" | "external" | undefined;
6492
5156
  tier?: string | undefined;
6493
5157
  payloadSchema?: {
6494
5158
  type: string;
@@ -6497,15 +5161,13 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6497
5161
  description?: string | undefined;
6498
5162
  entityType?: string | undefined;
6499
5163
  }[] | undefined;
6500
- scope?: "internal" | "external" | undefined;
6501
5164
  }[] | undefined;
5165
+ linkedEntity?: string | undefined;
6502
5166
  listens?: {
6503
5167
  event: string;
6504
5168
  triggers: string;
6505
5169
  description?: string | undefined;
6506
5170
  synonyms?: string | undefined;
6507
- tier?: string | undefined;
6508
- guard?: SExpr | undefined;
6509
5171
  source?: {
6510
5172
  kind: "any";
6511
5173
  } | {
@@ -6517,9 +5179,10 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6517
5179
  orbital: string;
6518
5180
  } | undefined;
6519
5181
  scope?: "internal" | "external" | undefined;
5182
+ tier?: string | undefined;
5183
+ guard?: SExpr | undefined;
6520
5184
  payloadMapping?: Record<string, string> | undefined;
6521
5185
  }[] | undefined;
6522
- linkedEntity?: string | undefined;
6523
5186
  description_visual_prompt?: string | undefined;
6524
5187
  entityRebindable?: boolean | undefined;
6525
5188
  entityContract?: {
@@ -6533,6 +5196,52 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6533
5196
  name: string;
6534
5197
  description?: string | undefined;
6535
5198
  }[] | undefined;
5199
+ initialEffects?: unknown[][] | undefined;
5200
+ ticks?: {
5201
+ name: string;
5202
+ effects: unknown[][];
5203
+ interval: number | "frame";
5204
+ description?: string | undefined;
5205
+ pages?: string[] | undefined;
5206
+ guard?: SExpr | undefined;
5207
+ priority?: number | undefined;
5208
+ appliesTo?: string[] | undefined;
5209
+ emits?: string[] | undefined;
5210
+ }[] | undefined;
5211
+ sourceBehavior?: {
5212
+ behavior: string;
5213
+ alias: string;
5214
+ originalName: string;
5215
+ } | undefined;
5216
+ sourceEntityDefinition?: {
5217
+ name: string;
5218
+ persistence: "persistent" | "runtime";
5219
+ fields: EntityField[];
5220
+ description?: string | undefined;
5221
+ shared?: boolean | undefined;
5222
+ collection?: string | undefined;
5223
+ instances?: Record<string, unknown>[] | undefined;
5224
+ timestamps?: boolean | undefined;
5225
+ softDelete?: boolean | undefined;
5226
+ visual_prompt?: string | undefined;
5227
+ assetRef?: {
5228
+ role: string;
5229
+ category: string;
5230
+ animations?: string[] | undefined;
5231
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
5232
+ variant?: string | undefined;
5233
+ dimension?: "2d" | "3d" | undefined;
5234
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
5235
+ } | undefined;
5236
+ } | undefined;
5237
+ }, {
5238
+ name: string;
5239
+ scope: "collection" | "instance";
5240
+ description?: string | undefined;
5241
+ ui?: Record<string, unknown> | undefined;
5242
+ category?: "validation" | "notification" | "lifecycle" | "temporal" | "integration" | "interaction" | "agent" | "game-core" | "game-character" | "game-ai" | "game-combat" | "game-items" | "game-cards" | "game-board" | "game-puzzle" | undefined;
5243
+ config?: Readonly<Record<string, ConfigFieldDeclaration>> | undefined;
5244
+ capabilities?: string[] | undefined;
6536
5245
  dataEntities?: {
6537
5246
  name: string;
6538
5247
  fields: {
@@ -6561,7 +5270,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6561
5270
  name: string;
6562
5271
  required?: boolean | undefined;
6563
5272
  }[] | undefined;
6564
- classification?: "system" | "domain" | undefined;
5273
+ classification?: "domain" | "system" | undefined;
6565
5274
  semanticRole?: string | undefined;
6566
5275
  }[];
6567
5276
  states: {
@@ -6574,9 +5283,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6574
5283
  onExit?: string[] | undefined;
6575
5284
  }[];
6576
5285
  transitions: {
5286
+ event: string;
6577
5287
  from: string;
6578
5288
  to: string;
6579
- event: string;
6580
5289
  description?: string | null | undefined;
6581
5290
  guard?: SExpr | undefined;
6582
5291
  effects?: unknown[][] | undefined;
@@ -6587,17 +5296,65 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6587
5296
  description?: string | undefined;
6588
5297
  }[] | undefined;
6589
5298
  } | undefined;
5299
+ emits?: {
5300
+ event: string;
5301
+ description?: string | undefined;
5302
+ synonyms?: string | undefined;
5303
+ scope?: "internal" | "external" | undefined;
5304
+ tier?: string | undefined;
5305
+ payloadSchema?: {
5306
+ type: string;
5307
+ name: string;
5308
+ required?: boolean | undefined;
5309
+ description?: string | undefined;
5310
+ entityType?: string | undefined;
5311
+ }[] | undefined;
5312
+ }[] | undefined;
5313
+ linkedEntity?: string | undefined;
5314
+ listens?: {
5315
+ event: string;
5316
+ triggers: string;
5317
+ description?: string | undefined;
5318
+ synonyms?: string | undefined;
5319
+ source?: {
5320
+ kind: "any";
5321
+ } | {
5322
+ trait: string;
5323
+ kind: "trait";
5324
+ } | {
5325
+ trait: string;
5326
+ kind: "orbital";
5327
+ orbital: string;
5328
+ } | undefined;
5329
+ scope?: "internal" | "external" | undefined;
5330
+ tier?: string | undefined;
5331
+ guard?: SExpr | undefined;
5332
+ payloadMapping?: Record<string, string> | undefined;
5333
+ }[] | undefined;
5334
+ description_visual_prompt?: string | undefined;
5335
+ entityRebindable?: boolean | undefined;
5336
+ entityContract?: {
5337
+ requires: string[];
5338
+ provides: string[];
5339
+ } | undefined;
5340
+ entityBindingDescription?: string | undefined;
5341
+ entityBindingSynonyms?: string | undefined;
5342
+ requiredFields?: {
5343
+ type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
5344
+ name: string;
5345
+ description?: string | undefined;
5346
+ }[] | undefined;
6590
5347
  initialEffects?: unknown[][] | undefined;
6591
5348
  ticks?: {
6592
5349
  name: string;
6593
5350
  effects: unknown[][];
6594
5351
  interval: number | "frame";
6595
5352
  description?: string | undefined;
6596
- guard?: SExpr | undefined;
6597
- emits?: string[] | undefined;
6598
5353
  pages?: string[] | undefined;
5354
+ guard?: SExpr | undefined;
6599
5355
  priority?: number | undefined;
6600
5356
  appliesTo?: string[] | undefined;
5357
+ emits?: string[] | undefined;
6601
5358
  }[] | undefined;
6602
5359
  sourceBehavior?: {
6603
5360
  behavior: string;
@@ -6627,4 +5384,4 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
6627
5384
  } | undefined;
6628
5385
  }>]>;
6629
5386
 
6630
- export { EffectSchema as $, ANIMATION_NAMES as A, type AtomicEffect as B, type CallSiteConfig as C, CAMERA_MODES as D, type EntityField as E, type FieldValue as F, type CallServiceConfig as G, type CallServiceEffect as H, type Camera as I, type CameraMode as J, CameraModeSchema as K, CameraSchema as L, type CheckpointLoadEffect as M, type CheckpointSaveEffect as N, type ConfigFieldDeclaration as O, ConfigFieldDeclarationSchema as P, type DeclaredTraitConfig as Q, type RelationConfig as R, type State as S, type TraitEventListener as T, DeclaredTraitConfigSchema as U, type DerefEffect as V, type DespawnEffect as W, type DoEffect as X, ENTITY_ROLES as Y, type Effect as Z, type EffectInput as _, type EntityPersistence as a, type RenderUIEffect as a$, type EmitConfig as a0, type EmitEffect as a1, type Entity as a2, type EntityData as a3, type EntityFieldContract as a4, EntityFieldContractSchema as a5, type EntityFieldInput as a6, EntityFieldSchema as a7, EntityPersistenceSchema as a8, type EntityRole as a9, GuardSchema as aA, type ListenSource as aB, ListenSourceSchema as aC, type LogEffect as aD, type McpServiceDef as aE, McpServiceDefSchema as aF, type NavigateEffect as aG, type NnConfig as aH, type NnLayer as aI, type NotifyEffect as aJ, type OrbitalEntity as aK, type OrbitalEntityInput as aL, OrbitalEntitySchema as aM, type OrbitalTraitRef as aN, OrbitalTraitRefSchema as aO, type OsEffect as aP, type PayloadField as aQ, PayloadFieldSchema as aR, type PersistData as aS, type PersistEffect as aT, type PersistEmitConfig as aU, type PresentationType as aV, type RefEffect as aW, RelationConfigSchema as aX, type RelationEntityField as aY, type RenderBinding as aZ, type RenderItemLambda as a_, EntityRoleSchema as aa, EntitySchema as ab, type EntityWith as ac, type EnumEntityField as ad, type EvaluateConfig as ae, type EvaluateEffect as af, type Event as ag, type EventInput as ah, type EventPayloadField as ai, EventPayloadFieldSchema as aj, EventSchema as ak, type EventScope as al, EventScopeSchema as am, type FetchEffect as an, type FetchOptions as ao, type FetchResult as ap, type Field as aq, type FieldFormat as ar, FieldFormatSchema as as, FieldSchema as at, type FieldType as au, FieldTypeSchema as av, type ForwardConfig as aw, type ForwardEffect as ax, type Guard as ay, type GuardInput as az, type TraitReference as b, type TraitEventContract as b$, type RenderUINode as b0, type RequiredField as b1, RequiredFieldSchema as b2, type ResolvedPatternProps as b3, type RestAuthConfig as b4, RestAuthConfigSchema as b5, type RestServiceDef as b6, RestServiceDefSchema as b7, SERVICE_TYPES as b8, SPRITE_DIRECTIONS as b9, type SpriteSheetAtlasInput as bA, SpriteSheetAtlasSchema as bB, type StateInput as bC, type StateMachine as bD, type StateMachineInput as bE, StateMachineSchema as bF, StateSchema as bG, type SubTexture as bH, SubTextureSchema as bI, type SwapEffect as bJ, type TextureAtlas as bK, TextureAtlasSchema as bL, type Tilesheet as bM, TilesheetSchema as bN, type TrainConfig as bO, type TrainEffect as bP, type TraitCategory as bQ, TraitCategorySchema as bR, type TraitConfig as bS, type TraitConfigObject as bT, TraitConfigSchema as bU, type TraitConfigValue as bV, TraitConfigValueSchema as bW, type TraitDataEntity as bX, TraitDataEntitySchema as bY, type TraitEntityField as bZ, TraitEntityFieldSchema as b_, type ScalarEntityField as ba, type ScenePos as bb, ScenePosSchema as bc, type SemanticAssetRef as bd, type SemanticAssetRefInput as be, SemanticAssetRefSchema as bf, type ServiceDefinition as bg, ServiceDefinitionSchema as bh, type ServiceParams as bi, type ServiceParamsValue as bj, type ServiceRef as bk, type ServiceRefObject as bl, ServiceRefObjectSchema as bm, ServiceRefSchema as bn, ServiceRefStringSchema as bo, type ServiceType as bp, ServiceTypeSchema as bq, type SetEffect as br, type SocketEvents as bs, SocketEventsSchema as bt, type SocketServiceDef as bu, SocketServiceDefSchema as bv, type SpawnEffect as bw, type SpriteDirection as bx, SpriteDirectionSchema as by, type SpriteSheetAtlas as bz, type CallSiteConfigEntry as c, type TraitScope as c$, TraitEventContractSchema as c0, TraitEventListenerSchema as c1, type TraitInput as c2, type TraitRef as c3, TraitRefSchema as c4, type TraitReferenceInput as c5, TraitReferenceSchema as c6, TraitSchema as c7, type TraitTick as c8, TraitTickSchema as c9, hasService as cA, isCallSiteConfigDeclaration as cB, isCircuitEvent as cC, isEffect as cD, isFieldValue as cE, isInlineTrait as cF, isMcpService as cG, isRestService as cH, isRuntimeEntity as cI, isSExprEffect as cJ, isServiceReference as cK, isServiceReferenceObject as cL, isSocketService as cM, navigate as cN, normalizeTraitRef as cO, notify as cP, parseAssetKey as cQ, parseServiceRef as cR, persist as cS, persistenceModeAllowsOverrides as cT, ref as cU, renderUI as cV, set as cW, spawn as cX, swap as cY, validateAssetAnimations as cZ, watch as c_, type TraitUIBinding as ca, type Transition as cb, type TransitionInput as cc, TransitionSchema as cd, type TypedEffect as ce, type UISlot as cf, UISlotSchema as cg, UI_SLOTS as ch, VISUAL_STYLES as ci, type VisualStyle as cj, VisualStyleSchema as ck, type WatchEffect as cl, type WatchOptions as cm, atomic as cn, callService as co, createAssetKey as cp, deref as cq, deriveCollection as cr, despawn as cs, doEffects as ct, emit as cu, findService as cv, getDefaultAnimationsForRole as cw, getServiceNames as cx, getTraitConfig as cy, getTraitName as cz, type Trait as d, type EntityRow as e, ASSET_ASPECTS as f, ASSET_DIMENSIONS as g, type AgentEffect as h, type AnimationDef as i, type AnimationDefInput as j, AnimationDefSchema as k, type AnimationName as l, AnimationNameSchema as m, type ArrayEntityField as n, type Asset as o, type AssetAspect as p, AssetAspectSchema as q, type AssetCatalog as r, type AssetCatalogEntry as s, type AssetCatalogEntryInput as t, AssetCatalogEntrySchema as u, AssetCatalogSchema as v, type AssetDimension as w, AssetDimensionSchema as x, AssetSchema as y, type AssetUrl as z };
5387
+ export { OrbitalTraitRefSchema as $, type AgentEffect as A, EventSchema as B, type CallSiteConfig as C, type DeclaredTraitConfig as D, type Effect as E, type EventScope as F, EventScopeSchema as G, type FetchEffect as H, type FetchOptions as I, type FetchResult as J, type ForwardConfig as K, type ForwardEffect as L, type Guard as M, type GuardInput as N, GuardSchema as O, type ListenSource as P, ListenSourceSchema as Q, type LogEffect as R, type State as S, type TraitEventListener as T, type McpServiceDef as U, McpServiceDefSchema as V, type NavigateEffect as W, type NnConfig as X, type NnLayer as Y, type NotifyEffect as Z, type OrbitalTraitRef as _, type TraitReference as a, TraitReferenceSchema as a$, type OsEffect as a0, type PayloadField as a1, PayloadFieldSchema as a2, type PersistData as a3, type PersistEffect as a4, type PersistEmitConfig as a5, type PresentationType as a6, type RefEffect as a7, type RenderBinding as a8, type RenderItemLambda as a9, type SpawnEffect as aA, type StateInput as aB, type StateMachine as aC, type StateMachineInput as aD, StateMachineSchema as aE, StateSchema as aF, type SwapEffect as aG, type TrainConfig as aH, type TrainEffect as aI, type TraitCategory as aJ, TraitCategorySchema as aK, type TraitConfig as aL, type TraitConfigObject as aM, TraitConfigSchema as aN, type TraitConfigValue as aO, TraitConfigValueSchema as aP, type TraitDataEntity as aQ, TraitDataEntitySchema as aR, type TraitEntityField as aS, TraitEntityFieldSchema as aT, type TraitEventContract as aU, TraitEventContractSchema as aV, TraitEventListenerSchema as aW, type TraitInput as aX, type TraitRef as aY, TraitRefSchema as aZ, type TraitReferenceInput as a_, type RenderUIEffect as aa, type RenderUINode as ab, type RequiredField as ac, RequiredFieldSchema as ad, type ResolvedPatternProps as ae, type RestAuthConfig as af, RestAuthConfigSchema as ag, type RestServiceDef as ah, RestServiceDefSchema as ai, SERVICE_TYPES as aj, type ServiceDefinition as ak, ServiceDefinitionSchema as al, type ServiceParams as am, type ServiceParamsValue as an, type ServiceRef as ao, type ServiceRefObject as ap, ServiceRefObjectSchema as aq, ServiceRefSchema as ar, ServiceRefStringSchema as as, type ServiceType as at, ServiceTypeSchema as au, type SetEffect as av, type SocketEvents as aw, SocketEventsSchema as ax, type SocketServiceDef as ay, SocketServiceDefSchema as az, type CallSiteConfigEntry as b, TraitSchema as b0, type TraitTick as b1, TraitTickSchema as b2, type TraitUIBinding as b3, type Transition as b4, type TransitionInput as b5, TransitionSchema as b6, type TypedEffect as b7, type UISlot as b8, UISlotSchema as b9, notify as bA, parseServiceRef as bB, persist as bC, ref as bD, renderUI as bE, set as bF, spawn as bG, swap as bH, watch as bI, type TraitScope as bJ, UI_SLOTS as ba, type WatchEffect as bb, type WatchOptions as bc, atomic as bd, callService as be, deref as bf, despawn as bg, doEffects as bh, emit as bi, findService as bj, getServiceNames as bk, getTraitConfig as bl, getTraitName as bm, hasService as bn, isCallSiteConfigDeclaration as bo, isCircuitEvent as bp, isEffect as bq, isInlineTrait as br, isMcpService as bs, isRestService as bt, isSExprEffect as bu, isServiceReference as bv, isServiceReferenceObject as bw, isSocketService as bx, navigate as by, normalizeTraitRef as bz, type Trait as c, type AtomicEffect as d, type CallServiceConfig as e, type CallServiceEffect as f, type CheckpointLoadEffect as g, type CheckpointSaveEffect as h, type ConfigFieldDeclaration as i, ConfigFieldDeclarationSchema as j, DeclaredTraitConfigSchema as k, type DerefEffect as l, type DespawnEffect as m, type DoEffect as n, type EffectInput as o, EffectSchema as p, type EmitConfig as q, type EmitEffect as r, type EntityFieldContract as s, EntityFieldContractSchema as t, type EvaluateConfig as u, type EvaluateEffect as v, type Event as w, type EventInput as x, type EventPayloadField as y, EventPayloadFieldSchema as z };