@almadar/core 10.29.0 → 10.31.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,4 +1,4 @@
1
- import { A as AnyPatternConfig, b as EntityRow, c as Entity, E as EntityField } from './pattern-types-JZordBZv.js';
1
+ import { A as AnyPatternConfig, b as EntityRow, c as EventId, T as TraitId, O as OrbitalId, d as EntityId, P as PageId, e as Entity, E as EntityField } from './pattern-types-VDIr2TkX.js';
2
2
  import { S as SExpr, E as EventPayload, a as Expression } from './expression-CB9R3KWk.js';
3
3
  import { z } from 'zod';
4
4
 
@@ -37,7 +37,7 @@ declare const ServiceTypeSchema: z.ZodEnum<["rest", "socket", "mcp"]>;
37
37
  * };
38
38
  * ```
39
39
  */
40
- interface RestServiceDef {
40
+ type RestServiceDef = {
41
41
  /** Unique service name (used in call_service effect) */
42
42
  name: string;
43
43
  /** Service type */
@@ -52,11 +52,11 @@ interface RestServiceDef {
52
52
  auth?: RestAuthConfig;
53
53
  /** Timeout in milliseconds (default: 30000) */
54
54
  timeout?: number;
55
- }
55
+ };
56
56
  /**
57
57
  * Authentication configuration for REST services.
58
58
  */
59
- interface RestAuthConfig {
59
+ type RestAuthConfig = {
60
60
  /** Authentication type */
61
61
  type: "api-key" | "bearer" | "basic" | "oauth2";
62
62
  /** For api-key: the query parameter or header name */
@@ -65,7 +65,7 @@ interface RestAuthConfig {
65
65
  location?: "query" | "header";
66
66
  /** Environment variable name containing the secret (for secure storage) */
67
67
  secretEnv?: string;
68
- }
68
+ };
69
69
  declare const RestAuthConfigSchema: z.ZodObject<{
70
70
  type: z.ZodEnum<["api-key", "bearer", "basic", "oauth2"]>;
71
71
  keyName: z.ZodOptional<z.ZodString>;
@@ -148,7 +148,7 @@ declare const RestServiceDefSchema: z.ZodObject<{
148
148
  * };
149
149
  * ```
150
150
  */
151
- interface SocketServiceDef {
151
+ type SocketServiceDef = {
152
152
  /** Unique service name */
153
153
  name: string;
154
154
  /** Service type */
@@ -168,16 +168,16 @@ interface SocketServiceDef {
168
168
  /** Delay between attempts in ms */
169
169
  delayMs?: number;
170
170
  };
171
- }
171
+ };
172
172
  /**
173
173
  * Socket event definitions.
174
174
  */
175
- interface SocketEvents {
175
+ type SocketEvents = {
176
176
  /** Events received from server (maps to orbital events) */
177
177
  inbound: string[];
178
178
  /** Events sent to server (triggered by effects) */
179
179
  outbound: string[];
180
- }
180
+ };
181
181
  declare const SocketEventsSchema: z.ZodObject<{
182
182
  inbound: z.ZodArray<z.ZodString, "many">;
183
183
  outbound: z.ZodArray<z.ZodString, "many">;
@@ -258,7 +258,7 @@ declare const SocketServiceDefSchema: z.ZodObject<{
258
258
  * };
259
259
  * ```
260
260
  */
261
- interface McpServiceDef {
261
+ type McpServiceDef = {
262
262
  /** Unique service name */
263
263
  name: string;
264
264
  /** Service type */
@@ -271,7 +271,7 @@ interface McpServiceDef {
271
271
  capabilities: string[];
272
272
  /** Environment variables to pass to the MCP server */
273
273
  env?: Record<string, string>;
274
- }
274
+ };
275
275
  declare const McpServiceDefSchema: z.ZodObject<{
276
276
  name: z.ZodString;
277
277
  type: z.ZodLiteral<"mcp">;
@@ -450,7 +450,7 @@ type ServiceRef = ServiceDefinition | ServiceRefObject | string;
450
450
  * };
451
451
  * ```
452
452
  */
453
- interface ServiceRefObject {
453
+ type ServiceRefObject = {
454
454
  /** Reference to imported service: "Alias.services.ServiceName" */
455
455
  ref: string;
456
456
  /** Override the service description */
@@ -463,7 +463,7 @@ interface ServiceRefObject {
463
463
  url?: string;
464
464
  /** Override the MCP server path */
465
465
  serverPath?: string;
466
- }
466
+ };
467
467
  /**
468
468
  * Checks if a service reference is a bare string reference.
469
469
  *
@@ -742,9 +742,9 @@ declare function hasService(services: ServiceDefinition[], name: string): boolea
742
742
  */
743
743
  type ServiceParamsValue = string | number | boolean | Date | null | undefined | ServiceParams | readonly ServiceParamsValue[];
744
744
  /** Parameters passed to call-service effects. Recursive for nested request shapes. */
745
- interface ServiceParams {
745
+ type ServiceParams = {
746
746
  [key: string]: ServiceParamsValue;
747
- }
747
+ };
748
748
 
749
749
  /**
750
750
  * Effect Types (Self-Contained)
@@ -765,7 +765,7 @@ declare const UISlotSchema: z.ZodEnum<["main", "sidebar", "modal", "drawer", "ov
765
765
  /**
766
766
  * Configuration extracted from call-service effects
767
767
  */
768
- interface CallServiceConfig {
768
+ type CallServiceConfig = {
769
769
  service: string;
770
770
  action: string;
771
771
  endpoint?: string;
@@ -773,7 +773,7 @@ interface CallServiceConfig {
773
773
  params?: ServiceParams;
774
774
  onSuccess?: string;
775
775
  onError?: string;
776
- }
776
+ };
777
777
  /**
778
778
  * A binding reference to a render tree stored elsewhere — a trait `config`
779
779
  * knob or a payload field — e.g. `"@config.bodyContent"`. Resolved to a pattern
@@ -800,6 +800,17 @@ type RenderUIEffect = ['render-ui', UISlot, AnyPatternConfig] | ['render-ui', UI
800
800
  * @example ["fn", "item", { "type": "stack", "children": [{ "type": "typography", "content": "@item.title" }] }]
801
801
  */
802
802
  type RenderItemLambda = ['fn', string, AnyPatternConfig];
803
+ /**
804
+ * Dynamic-collection children entry: renders one child per item of a collection
805
+ * expression, authored inline in a `children:` position and kept verbatim as IR
806
+ * (no new node kind). The collection expression is an {@link SExpr} evaluated at
807
+ * render time; the {@link RenderItemLambda} body is instantiated per item with
808
+ * the lambda param bound as an `@item`-scope binding. Both execution paths lower
809
+ * onto the one lambda + `@item` + splice machinery.
810
+ *
811
+ * @example ["array/map", "@entity.tasks", ["fn", "item", { "type": "typography", "content": "@item.title" }]]
812
+ */
813
+ type RenderChildrenMap = ['array/map', SExpr, RenderItemLambda];
803
814
  /**
804
815
  * Navigate effect - navigates to an internal page path or an external URL.
805
816
  * @example ['navigate', '/tasks'] or ['navigate', '/tasks/:id', { id: '123' }]
@@ -871,12 +882,12 @@ type SetEffect = ['set', string, unknown] | ['set', string, string, unknown];
871
882
  * position. See `(persist create Entity @payload.data { emit: { success:
872
883
  * "Saved", failure: "SaveFailed" } })` in `.lolo` source.
873
884
  */
874
- interface PersistEmitConfig {
885
+ type PersistEmitConfig = {
875
886
  emit?: {
876
887
  success?: string;
877
888
  failure?: string;
878
889
  };
879
- }
890
+ };
880
891
  /**
881
892
  * Persist effect data argument: either an entity row literal (field map)
882
893
  * or a binding string referencing a row in scope (e.g. `@payload.data`,
@@ -942,7 +953,7 @@ type NotifyEffect = ['notify', string, string | SExpr] | ['notify', string, stri
942
953
  * `limit`, `offset`, `include`, plus the trailing `emit:` map for
943
954
  * success/failure event names.
944
955
  */
945
- interface FetchOptions {
956
+ type FetchOptions = {
946
957
  /** Fetch a single entity by ID */
947
958
  id?: string;
948
959
  /** Filter expression (S-expression) */
@@ -958,7 +969,7 @@ interface FetchOptions {
958
969
  success?: string;
959
970
  failure?: string;
960
971
  };
961
- }
972
+ };
962
973
  /**
963
974
  * Fetch effect - retrieves entity data (server-side).
964
975
  * @example ['fetch', 'User'] or ['fetch', 'User', { id: '@payload.userId' }]
@@ -1031,7 +1042,7 @@ type SwapEffect = ['swap!', string, SExpr];
1031
1042
  * Options accepted by `watch` effects. Mirrors what the runtime reads when
1032
1043
  * registering the change callback: `debounce` and the trailing `emit:` map.
1033
1044
  */
1034
- interface WatchOptions {
1045
+ type WatchOptions = {
1035
1046
  /** Debounce duration in milliseconds */
1036
1047
  debounce?: number;
1037
1048
  /** Lifecycle events to emit on update / failure */
@@ -1039,7 +1050,7 @@ interface WatchOptions {
1039
1050
  on_message?: string;
1040
1051
  failure?: string;
1041
1052
  };
1042
- }
1053
+ };
1043
1054
  /**
1044
1055
  * Watch effect - registers a callback for entity changes.
1045
1056
  * Emits an event whenever the watched binding changes.
@@ -1059,48 +1070,48 @@ type AtomicEffect = ['atomic', ...SExpr[]];
1059
1070
  * lives in `almadar-std/modules/nn`; here we keep the wire shape generic
1060
1071
  * enough for the cross-package runtime + Python bridge to round-trip.
1061
1072
  */
1062
- interface NnLayer {
1073
+ type NnLayer = {
1063
1074
  type: string;
1064
1075
  [key: string]: string | number | boolean | number[] | string[] | undefined;
1065
- }
1076
+ };
1066
1077
  /**
1067
1078
  * Hyperparameters for `train` and `evaluate`. Recursive to allow nested
1068
1079
  * optimizer / scheduler config blocks without falling back to `unknown`.
1069
1080
  */
1070
- interface NnConfig {
1081
+ type NnConfig = {
1071
1082
  [key: string]: string | number | boolean | string[] | number[] | NnConfig | undefined;
1072
- }
1083
+ };
1073
1084
  /**
1074
1085
  * Forward-pass config: `input` is a binding string (`@payload.input`), and
1075
1086
  * `on-complete` names the event to fire when the prediction lands.
1076
1087
  */
1077
- interface ForwardConfig {
1088
+ type ForwardConfig = {
1078
1089
  architecture: NnLayer[];
1079
1090
  input: string;
1080
1091
  'on-complete'?: string;
1081
1092
  config?: NnConfig;
1082
- }
1093
+ };
1083
1094
  /**
1084
1095
  * Training-loop config. `dataset` is a binding string referencing the rows
1085
1096
  * to train on. Optimizer / loss / scheduler land inside `config`.
1086
1097
  */
1087
- interface TrainConfig {
1098
+ type TrainConfig = {
1088
1099
  architecture: NnLayer[];
1089
1100
  dataset: string;
1090
1101
  config?: NnConfig;
1091
1102
  'on-complete'?: string;
1092
- }
1103
+ };
1093
1104
  /**
1094
1105
  * Evaluation config. `metrics` lists named metrics the Python backend
1095
1106
  * computes (`accuracy`, `precision`, ...).
1096
1107
  */
1097
- interface EvaluateConfig {
1108
+ type EvaluateConfig = {
1098
1109
  architecture: NnLayer[];
1099
1110
  dataset: string;
1100
1111
  metrics: string[];
1101
1112
  config?: NnConfig;
1102
1113
  'on-complete'?: string;
1103
- }
1114
+ };
1104
1115
  /**
1105
1116
  * Forward effect - runs a neural network forward pass (Python backend).
1106
1117
  * @example ['forward', 'primary', { architecture: [...], input: '@payload.input', 'on-complete': 'PREDICTION_READY' }]
@@ -1426,14 +1437,17 @@ declare function watch(binding: string, event: string, options: WatchOptions): W
1426
1437
  */
1427
1438
  declare function atomic(...effects: SExpr[]): AtomicEffect;
1428
1439
  /** Resolved pattern props for render-ui effects at runtime. Recursive for nested pattern configs. */
1429
- interface ResolvedPatternProps {
1440
+ type ResolvedPatternProps = {
1430
1441
  [prop: string]: string | number | boolean | null | undefined | ResolvedPatternProps | ResolvedPatternProps[];
1431
- }
1442
+ };
1432
1443
  /** A node in a render-ui effect tree. */
1433
1444
  interface RenderUINode {
1434
1445
  type: string;
1435
1446
  props?: ResolvedPatternProps;
1436
- children?: RenderUINode[];
1447
+ /** Static child nodes and/or dynamic-collection map entries. A
1448
+ * {@link RenderChildrenMap} entry expands at render time into resolved
1449
+ * `RenderUINode`s, so components always receive a flat, fully-resolved list. */
1450
+ children?: Array<RenderUINode | RenderChildrenMap>;
1437
1451
  content?: string;
1438
1452
  entity?: string;
1439
1453
  renderItem?: RenderUINode;
@@ -1442,7 +1456,7 @@ interface RenderUINode {
1442
1456
  /**
1443
1457
  * Represents a state in the state machine
1444
1458
  */
1445
- interface State {
1459
+ type State = {
1446
1460
  /** State name (unique identifier) */
1447
1461
  name: string;
1448
1462
  /** Whether this is the initial state */
@@ -1457,7 +1471,7 @@ interface State {
1457
1471
  onEntry?: string[];
1458
1472
  /** Effect names to run on exit */
1459
1473
  onExit?: string[];
1460
- }
1474
+ };
1461
1475
  declare const StateSchema: z.ZodObject<{
1462
1476
  name: z.ZodString;
1463
1477
  isInitial: z.ZodOptional<z.ZodBoolean>;
@@ -1486,7 +1500,7 @@ declare const StateSchema: z.ZodObject<{
1486
1500
  /**
1487
1501
  * Payload field definition for events
1488
1502
  */
1489
- interface PayloadField {
1503
+ type PayloadField = {
1490
1504
  name: string;
1491
1505
  /**
1492
1506
  * Field type. Mirrors the Rust validator's acceptance: any non-empty
@@ -1499,14 +1513,16 @@ interface PayloadField {
1499
1513
  required?: boolean;
1500
1514
  /** Structured property schema for object-typed payload fields (recursive). */
1501
1515
  properties?: ReadonlyArray<PayloadField>;
1502
- }
1516
+ };
1503
1517
  declare const PayloadFieldSchema: z.ZodType<PayloadField>;
1504
1518
  /**
1505
1519
  * Represents an event that can trigger transitions
1506
1520
  */
1507
- interface Event {
1521
+ type Event = {
1508
1522
  /** Event key (UPPER_SNAKE_CASE) */
1509
1523
  key: string;
1524
+ /** V4 dual-carry id sibling of `key` — optional until the Phase-7 flip. */
1525
+ id?: EventId;
1510
1526
  /** Human-readable name */
1511
1527
  name: string;
1512
1528
  /** Description (authored `@description` on the emit/listen). */
@@ -1522,9 +1538,10 @@ interface Event {
1522
1538
  classification?: "domain" | "system";
1523
1539
  /** Semantic role of this event (optional, for analysis) */
1524
1540
  semanticRole?: string;
1525
- }
1541
+ };
1526
1542
  declare const EventSchema: z.ZodObject<{
1527
1543
  key: z.ZodString;
1544
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
1528
1545
  name: z.ZodString;
1529
1546
  description: z.ZodOptional<z.ZodString>;
1530
1547
  synonyms: z.ZodOptional<z.ZodString>;
@@ -1535,6 +1552,7 @@ declare const EventSchema: z.ZodObject<{
1535
1552
  }, "strip", z.ZodTypeAny, {
1536
1553
  name: string;
1537
1554
  key: string;
1555
+ id?: EventId | undefined;
1538
1556
  description?: string | undefined;
1539
1557
  synonyms?: string | undefined;
1540
1558
  tier?: string | undefined;
@@ -1544,6 +1562,7 @@ declare const EventSchema: z.ZodObject<{
1544
1562
  }, {
1545
1563
  name: string;
1546
1564
  key: string;
1565
+ id?: string | undefined;
1547
1566
  description?: string | undefined;
1548
1567
  synonyms?: string | undefined;
1549
1568
  tier?: string | undefined;
@@ -1562,12 +1581,12 @@ declare const EventSchema: z.ZodObject<{
1562
1581
  * description: "Check if entity has health remaining"
1563
1582
  * }
1564
1583
  */
1565
- interface Guard {
1584
+ type Guard = {
1566
1585
  name: string;
1567
1586
  /** Guard expression - S-expression array only */
1568
1587
  expression: Expression;
1569
1588
  description?: string;
1570
- }
1589
+ };
1571
1590
  declare const GuardSchema: z.ZodObject<{
1572
1591
  name: z.ZodString;
1573
1592
  expression: z.ZodType<SExpr, z.ZodTypeDef, SExpr>;
@@ -1597,24 +1616,27 @@ declare const GuardSchema: z.ZodObject<{
1597
1616
  * ]
1598
1617
  * }
1599
1618
  */
1600
- interface Transition {
1619
+ type Transition = {
1601
1620
  /** Source state name */
1602
1621
  from: string;
1603
1622
  /** Target state name */
1604
1623
  to: string;
1605
1624
  /** Event key that triggers this transition */
1606
1625
  event: string;
1626
+ /** V4 dual-carry id sibling of `event` — optional until the Phase-7 flip. */
1627
+ eventId?: EventId;
1607
1628
  /** Guard expression - S-expression array */
1608
1629
  guard?: Expression | null;
1609
1630
  /** Effects to execute - S-expression arrays */
1610
1631
  effects?: Effect[];
1611
1632
  /** Description */
1612
1633
  description?: string | null;
1613
- }
1634
+ };
1614
1635
  declare const TransitionSchema: z.ZodObject<{
1615
1636
  from: z.ZodString;
1616
1637
  to: z.ZodString;
1617
1638
  event: z.ZodString;
1639
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
1618
1640
  guard: z.ZodOptional<z.ZodNullable<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>>;
1619
1641
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
1620
1642
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1623,6 +1645,7 @@ declare const TransitionSchema: z.ZodObject<{
1623
1645
  from: string;
1624
1646
  to: string;
1625
1647
  description?: string | null | undefined;
1648
+ eventId?: EventId | undefined;
1626
1649
  guard?: SExpr | undefined;
1627
1650
  effects?: unknown[][] | undefined;
1628
1651
  }, {
@@ -1630,13 +1653,14 @@ declare const TransitionSchema: z.ZodObject<{
1630
1653
  from: string;
1631
1654
  to: string;
1632
1655
  description?: string | null | undefined;
1656
+ eventId?: string | undefined;
1633
1657
  guard?: SExpr | undefined;
1634
1658
  effects?: unknown[][] | undefined;
1635
1659
  }>;
1636
1660
  /**
1637
1661
  * Complete state machine definition
1638
1662
  */
1639
- interface StateMachine {
1663
+ type StateMachine = {
1640
1664
  /** All states in the machine */
1641
1665
  states: State[];
1642
1666
  /** All events that can be triggered */
@@ -1645,7 +1669,7 @@ interface StateMachine {
1645
1669
  transitions: Transition[];
1646
1670
  /** Named guard definitions */
1647
1671
  guards?: Guard[];
1648
- }
1672
+ };
1649
1673
  declare const StateMachineSchema: z.ZodObject<{
1650
1674
  states: z.ZodArray<z.ZodObject<{
1651
1675
  name: z.ZodString;
@@ -1674,6 +1698,7 @@ declare const StateMachineSchema: z.ZodObject<{
1674
1698
  }>, "many">;
1675
1699
  events: z.ZodArray<z.ZodObject<{
1676
1700
  key: z.ZodString;
1701
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
1677
1702
  name: z.ZodString;
1678
1703
  description: z.ZodOptional<z.ZodString>;
1679
1704
  synonyms: z.ZodOptional<z.ZodString>;
@@ -1684,6 +1709,7 @@ declare const StateMachineSchema: z.ZodObject<{
1684
1709
  }, "strip", z.ZodTypeAny, {
1685
1710
  name: string;
1686
1711
  key: string;
1712
+ id?: EventId | undefined;
1687
1713
  description?: string | undefined;
1688
1714
  synonyms?: string | undefined;
1689
1715
  tier?: string | undefined;
@@ -1693,6 +1719,7 @@ declare const StateMachineSchema: z.ZodObject<{
1693
1719
  }, {
1694
1720
  name: string;
1695
1721
  key: string;
1722
+ id?: string | undefined;
1696
1723
  description?: string | undefined;
1697
1724
  synonyms?: string | undefined;
1698
1725
  tier?: string | undefined;
@@ -1704,6 +1731,7 @@ declare const StateMachineSchema: z.ZodObject<{
1704
1731
  from: z.ZodString;
1705
1732
  to: z.ZodString;
1706
1733
  event: z.ZodString;
1734
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
1707
1735
  guard: z.ZodOptional<z.ZodNullable<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>>;
1708
1736
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
1709
1737
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1712,6 +1740,7 @@ declare const StateMachineSchema: z.ZodObject<{
1712
1740
  from: string;
1713
1741
  to: string;
1714
1742
  description?: string | null | undefined;
1743
+ eventId?: EventId | undefined;
1715
1744
  guard?: SExpr | undefined;
1716
1745
  effects?: unknown[][] | undefined;
1717
1746
  }, {
@@ -1719,6 +1748,7 @@ declare const StateMachineSchema: z.ZodObject<{
1719
1748
  from: string;
1720
1749
  to: string;
1721
1750
  description?: string | null | undefined;
1751
+ eventId?: string | undefined;
1722
1752
  guard?: SExpr | undefined;
1723
1753
  effects?: unknown[][] | undefined;
1724
1754
  }>, "many">;
@@ -1739,6 +1769,7 @@ declare const StateMachineSchema: z.ZodObject<{
1739
1769
  events: {
1740
1770
  name: string;
1741
1771
  key: string;
1772
+ id?: EventId | undefined;
1742
1773
  description?: string | undefined;
1743
1774
  synonyms?: string | undefined;
1744
1775
  tier?: string | undefined;
@@ -1760,6 +1791,7 @@ declare const StateMachineSchema: z.ZodObject<{
1760
1791
  from: string;
1761
1792
  to: string;
1762
1793
  description?: string | null | undefined;
1794
+ eventId?: EventId | undefined;
1763
1795
  guard?: SExpr | undefined;
1764
1796
  effects?: unknown[][] | undefined;
1765
1797
  }[];
@@ -1772,6 +1804,7 @@ declare const StateMachineSchema: z.ZodObject<{
1772
1804
  events: {
1773
1805
  name: string;
1774
1806
  key: string;
1807
+ id?: string | undefined;
1775
1808
  description?: string | undefined;
1776
1809
  synonyms?: string | undefined;
1777
1810
  tier?: string | undefined;
@@ -1793,6 +1826,7 @@ declare const StateMachineSchema: z.ZodObject<{
1793
1826
  from: string;
1794
1827
  to: string;
1795
1828
  description?: string | null | undefined;
1829
+ eventId?: string | undefined;
1796
1830
  guard?: SExpr | undefined;
1797
1831
  effects?: unknown[][] | undefined;
1798
1832
  }[];
@@ -1831,9 +1865,9 @@ declare function isCircuitEvent(event: string): boolean;
1831
1865
  * via `@config.<key>` bindings.
1832
1866
  */
1833
1867
  type TraitConfigValue = string | number | boolean | null | ReadonlyArray<TraitConfigValue> | TraitConfigObject;
1834
- interface TraitConfigObject {
1868
+ type TraitConfigObject = {
1835
1869
  readonly [key: string]: TraitConfigValue;
1836
- }
1870
+ };
1837
1871
  type TraitConfig = TraitConfigObject;
1838
1872
  /** Zod schema for TraitConfig. Recursive via z.lazy to allow nested structures. */
1839
1873
  declare const TraitConfigValueSchema: z.ZodType<TraitConfigValue>;
@@ -1900,9 +1934,29 @@ declare function normalizeCallSiteConfigToValues(config: CallSiteConfig | undefi
1900
1934
  * the enum member list through lowering — consumed by config-driven UI
1901
1935
  * (e.g. the playground property inspector) to render typed controls.
1902
1936
  */
1903
- interface ConfigFieldDeclaration {
1937
+ /**
1938
+ * The reference config-field types (V4-W5). A config knob typed `entity`,
1939
+ * `trait`, or `event` holds a REFERENCE (an entity/trait/event name), not a
1940
+ * plain value — so the stamp records the referenced node's id on the field
1941
+ * (`ConfigFieldDeclaration.refId`) and both execution paths resolve the value to
1942
+ * the node's CURRENT name by id, exactly like `entityRefIds`/`traitEmbedIds`.
1943
+ * This is the deterministic, source-tagged contract that lets a declaration-only
1944
+ * rename flow through a config value without any name-scanning heuristic.
1945
+ */
1946
+ declare const REFERENCE_CONFIG_TYPES: readonly ["entity", "trait", "event"];
1947
+ type ReferenceConfigType = (typeof REFERENCE_CONFIG_TYPES)[number];
1948
+ /** True when a config field's `type` marks its value as an entity/trait/event reference. */
1949
+ declare function isReferenceConfigType(type: string): type is ReferenceConfigType;
1950
+ type ConfigFieldDeclaration = {
1904
1951
  readonly type: string;
1905
1952
  readonly default?: TraitConfigValue;
1953
+ /**
1954
+ * V4-W5 dual-carry id — set by the stamp when `type` is a reference config
1955
+ * type (`entity`/`trait`/`event`): the stable id of the entity/trait/event
1956
+ * the field's value names. Readers resolve the value to that node's current
1957
+ * name by id (rename-proof); absent for non-reference fields.
1958
+ */
1959
+ readonly refId?: string;
1906
1960
  /** Marks the knob as mandatory at every call site (own-page binding exempt). `required` + `default` may coexist — the default only serves the trait's own demo page. */
1907
1961
  readonly required?: boolean;
1908
1962
  /** `@label` — human-readable control label. */
@@ -1919,14 +1973,14 @@ interface ConfigFieldDeclaration {
1919
1973
  readonly items?: ConfigFieldItemsDeclaration;
1920
1974
  /** Structured property schema for object-typed config fields (no items wrapper). */
1921
1975
  readonly properties?: Readonly<Record<string, TraitEntityField>>;
1922
- }
1923
- interface ConfigFieldItemsDeclaration {
1976
+ };
1977
+ type ConfigFieldItemsDeclaration = {
1924
1978
  readonly type?: string;
1925
1979
  /** Absent for arrays of scalars (`items: { type: "string" }`). */
1926
1980
  readonly properties?: Readonly<Record<string, TraitEntityField>>;
1927
1981
  /** Nested per-item schema for arrays of arrays (recursive). */
1928
1982
  readonly items?: ConfigFieldItemsDeclaration;
1929
- }
1983
+ };
1930
1984
  declare const ConfigFieldDeclarationSchema: z.ZodType<ConfigFieldDeclaration>;
1931
1985
  /**
1932
1986
  * Map of declared config fields keyed by name. Lives on `Trait.config`
@@ -1947,22 +2001,23 @@ type TraitFieldType = 'string' | 'number' | 'boolean' | 'date' | 'array' | 'obje
1947
2001
  /**
1948
2002
  * Simplified field for trait data entities
1949
2003
  */
1950
- interface TraitEntityField {
2004
+ type TraitEntityField = {
1951
2005
  name: string;
1952
2006
  type: TraitFieldType;
1953
2007
  required?: boolean;
1954
- default?: unknown;
2008
+ /** Field default parsed from `.orb` — always a JSON-shaped value. */
2009
+ default?: TraitConfigValue;
1955
2010
  values?: string[];
1956
2011
  /** Structured per-item schema for array-of-object fields (recursive). */
1957
2012
  items?: ConfigFieldItemsDeclaration;
1958
2013
  /** Structured property schema for object-typed entity fields. */
1959
2014
  properties?: Readonly<Record<string, TraitEntityField>>;
1960
- }
2015
+ };
1961
2016
  declare const TraitEntityFieldSchema: z.ZodType<TraitEntityField>;
1962
2017
  /**
1963
2018
  * Simplified data entity for traits
1964
2019
  */
1965
- interface TraitDataEntity {
2020
+ type TraitDataEntity = {
1966
2021
  name: string;
1967
2022
  collection?: string;
1968
2023
  fields: TraitEntityField[];
@@ -1971,7 +2026,7 @@ interface TraitDataEntity {
1971
2026
  runtime?: boolean;
1972
2027
  singleton?: boolean;
1973
2028
  pages?: string[];
1974
- }
2029
+ };
1975
2030
  declare const TraitDataEntitySchema: z.ZodObject<{
1976
2031
  name: z.ZodString;
1977
2032
  collection: z.ZodOptional<z.ZodString>;
@@ -2005,13 +2060,15 @@ declare const TraitDataEntitySchema: z.ZodObject<{
2005
2060
  * Guards can be legacy strings or S-expressions.
2006
2061
  * Effects can be typed Effect objects or S-expressions.
2007
2062
  */
2008
- interface TraitTick {
2063
+ type TraitTick = {
2009
2064
  name: string;
2010
2065
  description?: string;
2011
2066
  priority?: number;
2012
2067
  interval: string | number;
2013
2068
  appliesTo?: string[];
2014
2069
  pages?: string[];
2070
+ /** V4 dual-carry id sibling of `pages` — optional until the Phase-7 flip. */
2071
+ pageIds?: PageId[];
2015
2072
  /** Guard expression - string (legacy) or S-expression array */
2016
2073
  guard?: Expression;
2017
2074
  /** Effects to execute (S-expressions) */
@@ -2022,7 +2079,9 @@ interface TraitTick {
2022
2079
  * Used for validation and documentation.
2023
2080
  */
2024
2081
  emits?: string[];
2025
- }
2082
+ /** V4 dual-carry id sibling of `emits` — optional until the Phase-7 flip. */
2083
+ emitIds?: EventId[];
2084
+ };
2026
2085
  declare const TraitTickSchema: z.ZodObject<{
2027
2086
  name: z.ZodString;
2028
2087
  description: z.ZodOptional<z.ZodString>;
@@ -2030,9 +2089,11 @@ declare const TraitTickSchema: z.ZodObject<{
2030
2089
  interval: z.ZodUnion<[z.ZodLiteral<"frame">, z.ZodNumber]>;
2031
2090
  appliesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2032
2091
  pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2092
+ pageIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, PageId, string>, "many">>;
2033
2093
  guard: z.ZodOptional<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>;
2034
2094
  effects: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">;
2035
2095
  emits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2096
+ emitIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, EventId, string>, "many">>;
2036
2097
  }, "strip", z.ZodTypeAny, {
2037
2098
  name: string;
2038
2099
  effects: unknown[][];
@@ -2042,7 +2103,9 @@ declare const TraitTickSchema: z.ZodObject<{
2042
2103
  guard?: SExpr | undefined;
2043
2104
  priority?: number | undefined;
2044
2105
  appliesTo?: string[] | undefined;
2106
+ pageIds?: PageId[] | undefined;
2045
2107
  emits?: string[] | undefined;
2108
+ emitIds?: EventId[] | undefined;
2046
2109
  }, {
2047
2110
  name: string;
2048
2111
  effects: unknown[][];
@@ -2052,7 +2115,9 @@ declare const TraitTickSchema: z.ZodObject<{
2052
2115
  guard?: SExpr | undefined;
2053
2116
  priority?: number | undefined;
2054
2117
  appliesTo?: string[] | undefined;
2118
+ pageIds?: string[] | undefined;
2055
2119
  emits?: string[] | undefined;
2120
+ emitIds?: string[] | undefined;
2056
2121
  }>;
2057
2122
  /**
2058
2123
  * Event scope determines visibility:
@@ -2065,7 +2130,7 @@ declare const EventScopeSchema: z.ZodEnum<["internal", "external"]>;
2065
2130
  * Payload field definition for events.
2066
2131
  * Defines the structure of data carried by events.
2067
2132
  */
2068
- interface EventPayloadField {
2133
+ type EventPayloadField = {
2069
2134
  /** Field name */
2070
2135
  name: string;
2071
2136
  /**
@@ -2088,15 +2153,17 @@ interface EventPayloadField {
2088
2153
  entityType?: string;
2089
2154
  /** Structured property schema for object-typed payload fields (recursive). */
2090
2155
  properties?: ReadonlyArray<EventPayloadField>;
2091
- }
2156
+ };
2092
2157
  declare const EventPayloadFieldSchema: z.ZodType<EventPayloadField>;
2093
2158
  /**
2094
2159
  * Event contract for events a trait emits.
2095
2160
  * Declares the event name, scope, and payload schema.
2096
2161
  */
2097
- interface TraitEventContract {
2162
+ type TraitEventContract = {
2098
2163
  /** Event name (UPPER_SNAKE_CASE) */
2099
2164
  event: string;
2165
+ /** V4 dual-carry id sibling of `event` — optional until the Phase-7 flip. */
2166
+ eventId?: EventId;
2100
2167
  /** Human-readable description */
2101
2168
  description?: string;
2102
2169
  /** User-vocabulary synonyms (comma-separated) — the per-event analogue of a
@@ -2114,7 +2181,7 @@ interface TraitEventContract {
2114
2181
  * - 'external': Exposed for cross-orbital communication
2115
2182
  */
2116
2183
  scope?: EventScope;
2117
- }
2184
+ };
2118
2185
  /**
2119
2186
  * `@config.<knob>` is the only legal reference form for an emit/listen
2120
2187
  * event name (Option B — the declared event name resolves to a
@@ -2153,6 +2220,7 @@ declare const TraitEventContractSchema: z.ZodObject<{
2153
2220
  * knob's effective literal before codegen/runtime consume it.
2154
2221
  */
2155
2222
  event: z.ZodString;
2223
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2156
2224
  description: z.ZodOptional<z.ZodString>;
2157
2225
  synonyms: z.ZodOptional<z.ZodString>;
2158
2226
  tier: z.ZodOptional<z.ZodString>;
@@ -2165,6 +2233,7 @@ declare const TraitEventContractSchema: z.ZodObject<{
2165
2233
  scope?: "internal" | "external" | undefined;
2166
2234
  tier?: string | undefined;
2167
2235
  payloadSchema?: EventPayloadField[] | undefined;
2236
+ eventId?: EventId | undefined;
2168
2237
  }, {
2169
2238
  event: string;
2170
2239
  description?: string | undefined;
@@ -2172,6 +2241,7 @@ declare const TraitEventContractSchema: z.ZodObject<{
2172
2241
  scope?: "internal" | "external" | undefined;
2173
2242
  tier?: string | undefined;
2174
2243
  payloadSchema?: EventPayloadField[] | undefined;
2244
+ eventId?: string | undefined;
2175
2245
  }>;
2176
2246
  /**
2177
2247
  * Event listener for trait communication.
@@ -2196,10 +2266,16 @@ type ListenSource = {
2196
2266
  } | {
2197
2267
  kind: 'trait';
2198
2268
  trait: string;
2269
+ /** V4 dual-carry id sibling of `trait` — optional until the Phase-7 flip. */
2270
+ traitId?: TraitId;
2199
2271
  } | {
2200
2272
  kind: 'orbital';
2201
2273
  orbital: string;
2202
2274
  trait: string;
2275
+ /** V4 dual-carry id sibling of `orbital` — optional until the Phase-7 flip. */
2276
+ orbitalId?: OrbitalId;
2277
+ /** V4 dual-carry id sibling of `trait` — optional until the Phase-7 flip. */
2278
+ traitId?: TraitId;
2203
2279
  };
2204
2280
  declare const ListenSourceSchema: z.ZodUnion<[z.ZodObject<{
2205
2281
  kind: z.ZodLiteral<"any">;
@@ -2210,30 +2286,43 @@ declare const ListenSourceSchema: z.ZodUnion<[z.ZodObject<{
2210
2286
  }>, z.ZodObject<{
2211
2287
  kind: z.ZodLiteral<"trait">;
2212
2288
  trait: z.ZodString;
2289
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2213
2290
  }, "strip", z.ZodTypeAny, {
2214
2291
  trait: string;
2215
2292
  kind: "trait";
2293
+ traitId?: TraitId | undefined;
2216
2294
  }, {
2217
2295
  trait: string;
2218
2296
  kind: "trait";
2297
+ traitId?: string | undefined;
2219
2298
  }>, z.ZodObject<{
2220
2299
  kind: z.ZodLiteral<"orbital">;
2221
2300
  orbital: z.ZodString;
2222
2301
  trait: z.ZodString;
2302
+ orbitalId: z.ZodOptional<z.ZodEffects<z.ZodString, OrbitalId, string>>;
2303
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2223
2304
  }, "strip", z.ZodTypeAny, {
2305
+ orbital: string;
2224
2306
  trait: string;
2225
2307
  kind: "orbital";
2226
- orbital: string;
2308
+ traitId?: TraitId | undefined;
2309
+ orbitalId?: OrbitalId | undefined;
2227
2310
  }, {
2311
+ orbital: string;
2228
2312
  trait: string;
2229
2313
  kind: "orbital";
2230
- orbital: string;
2314
+ traitId?: string | undefined;
2315
+ orbitalId?: string | undefined;
2231
2316
  }>]>;
2232
- interface TraitEventListener {
2317
+ type TraitEventListener = {
2233
2318
  /** Event key to listen for (bare event name, no source prefix in the new shape) */
2234
2319
  event: string;
2320
+ /** V4 dual-carry id sibling of `event` — optional until the Phase-7 flip. */
2321
+ eventId?: EventId;
2235
2322
  /** State machine event to trigger */
2236
2323
  triggers: string;
2324
+ /** V4 dual-carry id sibling of `triggers` — optional until the Phase-7 flip. */
2325
+ triggersId?: EventId;
2237
2326
  /** Human-readable description (authored `@description` on the listen). */
2238
2327
  description?: string;
2239
2328
  /** User-vocabulary synonyms (comma-separated). */
@@ -2255,10 +2344,12 @@ interface TraitEventListener {
2255
2344
  * a local payload declaration rather than a bus subscription.
2256
2345
  */
2257
2346
  source?: ListenSource;
2258
- }
2347
+ };
2259
2348
  declare const TraitEventListenerSchema: z.ZodObject<{
2260
2349
  event: z.ZodString;
2350
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2261
2351
  triggers: z.ZodString;
2352
+ triggersId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2262
2353
  description: z.ZodOptional<z.ZodString>;
2263
2354
  synonyms: z.ZodOptional<z.ZodString>;
2264
2355
  tier: z.ZodOptional<z.ZodString>;
@@ -2274,24 +2365,33 @@ declare const TraitEventListenerSchema: z.ZodObject<{
2274
2365
  }>, z.ZodObject<{
2275
2366
  kind: z.ZodLiteral<"trait">;
2276
2367
  trait: z.ZodString;
2368
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2277
2369
  }, "strip", z.ZodTypeAny, {
2278
2370
  trait: string;
2279
2371
  kind: "trait";
2372
+ traitId?: TraitId | undefined;
2280
2373
  }, {
2281
2374
  trait: string;
2282
2375
  kind: "trait";
2376
+ traitId?: string | undefined;
2283
2377
  }>, z.ZodObject<{
2284
2378
  kind: z.ZodLiteral<"orbital">;
2285
2379
  orbital: z.ZodString;
2286
2380
  trait: z.ZodString;
2381
+ orbitalId: z.ZodOptional<z.ZodEffects<z.ZodString, OrbitalId, string>>;
2382
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2287
2383
  }, "strip", z.ZodTypeAny, {
2384
+ orbital: string;
2288
2385
  trait: string;
2289
2386
  kind: "orbital";
2290
- orbital: string;
2387
+ traitId?: TraitId | undefined;
2388
+ orbitalId?: OrbitalId | undefined;
2291
2389
  }, {
2390
+ orbital: string;
2292
2391
  trait: string;
2293
2392
  kind: "orbital";
2294
- orbital: string;
2393
+ traitId?: string | undefined;
2394
+ orbitalId?: string | undefined;
2295
2395
  }>]>>;
2296
2396
  }, "strip", z.ZodTypeAny, {
2297
2397
  event: string;
@@ -2303,14 +2403,19 @@ declare const TraitEventListenerSchema: z.ZodObject<{
2303
2403
  } | {
2304
2404
  trait: string;
2305
2405
  kind: "trait";
2406
+ traitId?: TraitId | undefined;
2306
2407
  } | {
2408
+ orbital: string;
2307
2409
  trait: string;
2308
2410
  kind: "orbital";
2309
- orbital: string;
2411
+ traitId?: TraitId | undefined;
2412
+ orbitalId?: OrbitalId | undefined;
2310
2413
  } | undefined;
2311
2414
  scope?: "internal" | "external" | undefined;
2312
2415
  tier?: string | undefined;
2416
+ eventId?: EventId | undefined;
2313
2417
  guard?: SExpr | undefined;
2418
+ triggersId?: EventId | undefined;
2314
2419
  payloadMapping?: Record<string, string> | undefined;
2315
2420
  }, {
2316
2421
  event: string;
@@ -2322,34 +2427,39 @@ declare const TraitEventListenerSchema: z.ZodObject<{
2322
2427
  } | {
2323
2428
  trait: string;
2324
2429
  kind: "trait";
2430
+ traitId?: string | undefined;
2325
2431
  } | {
2432
+ orbital: string;
2326
2433
  trait: string;
2327
2434
  kind: "orbital";
2328
- orbital: string;
2435
+ traitId?: string | undefined;
2436
+ orbitalId?: string | undefined;
2329
2437
  } | undefined;
2330
2438
  scope?: "internal" | "external" | undefined;
2331
2439
  tier?: string | undefined;
2440
+ eventId?: string | undefined;
2332
2441
  guard?: SExpr | undefined;
2442
+ triggersId?: string | undefined;
2333
2443
  payloadMapping?: Record<string, string> | undefined;
2334
2444
  }>;
2335
2445
  /**
2336
2446
  * Field required by a trait from its linkedEntity
2337
2447
  */
2338
- interface RequiredField {
2448
+ type RequiredField = {
2339
2449
  name: string;
2340
2450
  type: 'string' | 'number' | 'boolean' | 'date' | 'array' | 'object' | 'timestamp' | 'datetime' | 'enum';
2341
2451
  description?: string;
2342
- }
2452
+ };
2343
2453
  declare const RequiredFieldSchema: z.ZodObject<{
2344
2454
  name: z.ZodString;
2345
2455
  type: z.ZodEnum<["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum"]>;
2346
2456
  description: z.ZodOptional<z.ZodString>;
2347
2457
  }, "strip", z.ZodTypeAny, {
2348
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
2458
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
2349
2459
  name: string;
2350
2460
  description?: string | undefined;
2351
2461
  }, {
2352
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
2462
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
2353
2463
  name: string;
2354
2464
  description?: string | undefined;
2355
2465
  }>;
@@ -2361,8 +2471,18 @@ declare const RequiredFieldSchema: z.ZodObject<{
2361
2471
  * identifier-substitution pass uses these arguments to rewrite the
2362
2472
  * inlined trait clone before lowering.
2363
2473
  */
2364
- interface TraitReference {
2474
+ type TraitReference = {
2365
2475
  ref: string;
2476
+ /** V4 dual-carry id sibling of `ref` — optional until the Phase-7 flip. */
2477
+ refId?: TraitId;
2478
+ /**
2479
+ * V4 LOCAL DECLARATION id — the identity of this trait AS DECLARED in its
2480
+ * orbital (`trait X = Alias.traits.Y` declares node X; `refId` carries
2481
+ * Y's id). Minted by the stamp so page trait refs and `@trait.X` embeds
2482
+ * resolve by id across `name:` renames (the composed-organism surface was
2483
+ * the one declaration class without an id).
2484
+ */
2485
+ id?: TraitId;
2366
2486
  /**
2367
2487
  * Phase 1.2: optional registry path disambiguator. Pairs with `ref` to
2368
2488
  * explicitly name which `uses` entry the alias was imported from
@@ -2372,10 +2492,14 @@ interface TraitReference {
2372
2492
  */
2373
2493
  from?: string;
2374
2494
  linkedEntity?: string;
2495
+ /** V4 dual-carry id sibling of `linkedEntity` — optional until the Phase-7 flip. */
2496
+ linkedEntityId?: EntityId;
2375
2497
  /** Phase F: rename the inlined trait at the call site */
2376
2498
  name?: string;
2377
2499
  /** Phase F: rename atom event keys at the call site, e.g. {OPEN: "ADD_ITEM"} */
2378
2500
  events?: Record<string, string>;
2501
+ /** V4 dual-carry id sibling of `events` (keys = baked event names resolved to ids) — optional until the Phase-7 flip. */
2502
+ eventIds?: Record<string, EventId>;
2379
2503
  /**
2380
2504
  * Entity-field remap: rewrite the inlined trait's canonical `@entity.X` /
2381
2505
  * `@payload.row.X` field references to the consumer entity's field names,
@@ -2435,66 +2559,86 @@ interface TraitReference {
2435
2559
  * }
2436
2560
  * ```
2437
2561
  */
2438
- effects?: Record<string, unknown[]>;
2439
- }
2562
+ effects?: Record<string, SExpr[]>;
2563
+ };
2440
2564
  declare const TraitReferenceSchema: z.ZodEffects<z.ZodObject<{
2441
2565
  ref: z.ZodString;
2566
+ refId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2567
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2442
2568
  from: z.ZodOptional<z.ZodString>;
2443
2569
  linkedEntity: z.ZodOptional<z.ZodString>;
2570
+ linkedEntityId: z.ZodOptional<z.ZodEffects<z.ZodString, EntityId, string>>;
2444
2571
  name: z.ZodOptional<z.ZodString>;
2445
2572
  events: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2573
+ eventIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, EventId, string>>>;
2446
2574
  fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2447
2575
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodType<ConfigFieldDeclaration, z.ZodTypeDef, ConfigFieldDeclaration>, z.ZodType<TraitConfigValue, z.ZodTypeDef, TraitConfigValue>]>>>;
2448
2576
  appliesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2449
2577
  listens: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
2450
2578
  emitsScope: z.ZodOptional<z.ZodEnum<["internal", "external"]>>;
2451
- effects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown, "many">>>;
2579
+ effects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodType<SExpr, z.ZodTypeDef, SExpr>, "many">>>;
2452
2580
  }, "strip", z.ZodTypeAny, {
2453
2581
  ref: string;
2582
+ id?: TraitId | undefined;
2583
+ from?: string | undefined;
2454
2584
  name?: string | undefined;
2455
2585
  fields?: Record<string, string> | undefined;
2456
2586
  config?: Record<string, TraitConfigValue | ConfigFieldDeclaration> | undefined;
2457
2587
  events?: Record<string, string> | undefined;
2458
- from?: string | undefined;
2459
- effects?: Record<string, unknown[]> | undefined;
2588
+ effects?: Record<string, SExpr[]> | undefined;
2589
+ refId?: TraitId | undefined;
2460
2590
  appliesTo?: string[] | undefined;
2461
2591
  linkedEntity?: string | undefined;
2592
+ linkedEntityId?: EntityId | undefined;
2593
+ eventIds?: Record<string, EventId> | undefined;
2462
2594
  listens?: unknown[] | undefined;
2463
2595
  emitsScope?: "internal" | "external" | undefined;
2464
2596
  }, {
2465
2597
  ref: string;
2598
+ id?: string | undefined;
2599
+ from?: string | undefined;
2466
2600
  name?: string | undefined;
2467
2601
  fields?: Record<string, string> | undefined;
2468
2602
  config?: Record<string, TraitConfigValue | ConfigFieldDeclaration> | undefined;
2469
2603
  events?: Record<string, string> | undefined;
2470
- from?: string | undefined;
2471
- effects?: Record<string, unknown[]> | undefined;
2604
+ effects?: Record<string, SExpr[]> | undefined;
2605
+ refId?: string | undefined;
2472
2606
  appliesTo?: string[] | undefined;
2473
2607
  linkedEntity?: string | undefined;
2608
+ linkedEntityId?: string | undefined;
2609
+ eventIds?: Record<string, string> | undefined;
2474
2610
  listens?: unknown[] | undefined;
2475
2611
  emitsScope?: "internal" | "external" | undefined;
2476
2612
  }>, {
2477
2613
  ref: string;
2614
+ id?: TraitId | undefined;
2615
+ from?: string | undefined;
2478
2616
  name?: string | undefined;
2479
2617
  fields?: Record<string, string> | undefined;
2480
2618
  config?: Record<string, TraitConfigValue | ConfigFieldDeclaration> | undefined;
2481
2619
  events?: Record<string, string> | undefined;
2482
- from?: string | undefined;
2483
- effects?: Record<string, unknown[]> | undefined;
2620
+ effects?: Record<string, SExpr[]> | undefined;
2621
+ refId?: TraitId | undefined;
2484
2622
  appliesTo?: string[] | undefined;
2485
2623
  linkedEntity?: string | undefined;
2624
+ linkedEntityId?: EntityId | undefined;
2625
+ eventIds?: Record<string, EventId> | undefined;
2486
2626
  listens?: unknown[] | undefined;
2487
2627
  emitsScope?: "internal" | "external" | undefined;
2488
2628
  }, {
2489
2629
  ref: string;
2630
+ id?: string | undefined;
2631
+ from?: string | undefined;
2490
2632
  name?: string | undefined;
2491
2633
  fields?: Record<string, string> | undefined;
2492
2634
  config?: Record<string, TraitConfigValue | ConfigFieldDeclaration> | undefined;
2493
2635
  events?: Record<string, string> | undefined;
2494
- from?: string | undefined;
2495
- effects?: Record<string, unknown[]> | undefined;
2636
+ effects?: Record<string, SExpr[]> | undefined;
2637
+ refId?: string | undefined;
2496
2638
  appliesTo?: string[] | undefined;
2497
2639
  linkedEntity?: string | undefined;
2640
+ linkedEntityId?: string | undefined;
2641
+ eventIds?: Record<string, string> | undefined;
2498
2642
  listens?: unknown[] | undefined;
2499
2643
  emitsScope?: "internal" | "external" | undefined;
2500
2644
  }>;
@@ -2515,7 +2659,7 @@ type TraitRef = string | {
2515
2659
  events?: Record<string, string>;
2516
2660
  } | Trait;
2517
2661
  type PresentationType = 'modal' | 'drawer' | 'popover' | 'inline' | 'confirm-dialog';
2518
- interface TraitUIBinding {
2662
+ type TraitUIBinding = {
2519
2663
  [stateName: string]: {
2520
2664
  presentation: PresentationType;
2521
2665
  content: AnyPatternConfig | AnyPatternConfig[];
@@ -2530,7 +2674,7 @@ interface TraitUIBinding {
2530
2674
  totalSteps?: number;
2531
2675
  };
2532
2676
  };
2533
- }
2677
+ };
2534
2678
  /**
2535
2679
  * A Trait is a reusable behavioral module with state machine.
2536
2680
  *
@@ -2560,10 +2704,10 @@ type TraitScope = 'instance' | 'collection';
2560
2704
  * validator enforces it (`ORB_T_REBIND_MISSING_FIELDS`). Mirrors the Rust
2561
2705
  * `EntityFieldContract` serde shape exactly.
2562
2706
  */
2563
- interface EntityFieldContract {
2707
+ type EntityFieldContract = {
2564
2708
  requires: string[];
2565
2709
  provides: string[];
2566
- }
2710
+ };
2567
2711
  declare const EntityFieldContractSchema: z.ZodObject<{
2568
2712
  requires: z.ZodArray<z.ZodString, "many">;
2569
2713
  provides: z.ZodArray<z.ZodString, "many">;
@@ -2574,7 +2718,9 @@ declare const EntityFieldContractSchema: z.ZodObject<{
2574
2718
  requires: string[];
2575
2719
  provides: string[];
2576
2720
  }>;
2577
- interface Trait {
2721
+ type Trait = {
2722
+ /** V4 dual-carry id sibling of `name` — optional until the Phase-7 flip. */
2723
+ id?: TraitId;
2578
2724
  name: string;
2579
2725
  description?: string;
2580
2726
  description_visual_prompt?: string;
@@ -2623,6 +2769,23 @@ interface Trait {
2623
2769
  * Required for inline trait definitions within an orbital.
2624
2770
  */
2625
2771
  linkedEntity?: string;
2772
+ /** V4 dual-carry id sibling of `linkedEntity` — optional until the Phase-7 flip. */
2773
+ linkedEntityId?: EntityId;
2774
+ /**
2775
+ * V4 leverage-ids — id side-map for `@entity.<Name>` binding tokens + positional
2776
+ * entity args (`fetch`/`ref`/`persist`/`spawn`) in this trait's guards/effects/
2777
+ * ticks/listens. Maps the referenced entity NAME → its stable id, so readers
2778
+ * resolve these bare-string positions by id (else name) and an entity rename never
2779
+ * strands them — the coverage that lets the entity name-rewriter be deleted.
2780
+ */
2781
+ entityRefIds?: Record<string, EntityId>;
2782
+ /**
2783
+ * V4 leverage-ids — id side-map for `@trait.<Name>` embed tokens (render-ui embeds /
2784
+ * effect-tree sibling refs). Maps the embed token NAME → the embedded trait's stable
2785
+ * id, so readers splice embeds by id (else name) — the coverage that lets the
2786
+ * `@trait.` name-rewriter be deleted.
2787
+ */
2788
+ traitEmbedIds?: Record<string, TraitId>;
2626
2789
  requiredFields?: RequiredField[];
2627
2790
  dataEntities?: TraitDataEntity[];
2628
2791
  stateMachine?: StateMachine;
@@ -2662,14 +2825,14 @@ interface Trait {
2662
2825
  * `linkedEntity` without re-walking the import graph at runtime.
2663
2826
  */
2664
2827
  sourceEntityDefinition?: Entity;
2665
- }
2828
+ };
2666
2829
  /**
2667
2830
  * Provenance attached to a trait that was cloned from a `uses[]` import
2668
2831
  * during the inline phase. The resolved schema carries this so Studio
2669
2832
  * can group L2 cards by source behavior and offer an L3 drill into the
2670
2833
  * import's own transitions.
2671
2834
  */
2672
- interface SourceBehaviorMetadata {
2835
+ type SourceBehaviorMetadata = {
2673
2836
  /** Behavior name (e.g. "std-stat-card") — the resolved `from:` value. */
2674
2837
  behavior: string;
2675
2838
  /** Alias used at the import site (e.g. "Stat"). Multiple imports of
@@ -2678,8 +2841,9 @@ interface SourceBehaviorMetadata {
2678
2841
  /** Original trait name inside the imported behavior, before any
2679
2842
  * call-site `name:` rename. */
2680
2843
  originalName: string;
2681
- }
2844
+ };
2682
2845
  declare const TraitSchema: z.ZodObject<{
2846
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2683
2847
  name: z.ZodString;
2684
2848
  description: z.ZodOptional<z.ZodString>;
2685
2849
  description_visual_prompt: z.ZodOptional<z.ZodString>;
@@ -2700,16 +2864,19 @@ declare const TraitSchema: z.ZodObject<{
2700
2864
  capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2701
2865
  scope: z.ZodEnum<["instance", "collection"]>;
2702
2866
  linkedEntity: z.ZodOptional<z.ZodString>;
2867
+ linkedEntityId: z.ZodOptional<z.ZodEffects<z.ZodString, EntityId, string>>;
2868
+ entityRefIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, EntityId, string>>>;
2869
+ traitEmbedIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, TraitId, string>>>;
2703
2870
  requiredFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
2704
2871
  name: z.ZodString;
2705
2872
  type: z.ZodEnum<["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum"]>;
2706
2873
  description: z.ZodOptional<z.ZodString>;
2707
2874
  }, "strip", z.ZodTypeAny, {
2708
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
2875
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
2709
2876
  name: string;
2710
2877
  description?: string | undefined;
2711
2878
  }, {
2712
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
2879
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
2713
2880
  name: string;
2714
2881
  description?: string | undefined;
2715
2882
  }>, "many">>;
@@ -2769,6 +2936,7 @@ declare const TraitSchema: z.ZodObject<{
2769
2936
  }>, "many">;
2770
2937
  events: z.ZodArray<z.ZodObject<{
2771
2938
  key: z.ZodString;
2939
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2772
2940
  name: z.ZodString;
2773
2941
  description: z.ZodOptional<z.ZodString>;
2774
2942
  synonyms: z.ZodOptional<z.ZodString>;
@@ -2779,6 +2947,7 @@ declare const TraitSchema: z.ZodObject<{
2779
2947
  }, "strip", z.ZodTypeAny, {
2780
2948
  name: string;
2781
2949
  key: string;
2950
+ id?: EventId | undefined;
2782
2951
  description?: string | undefined;
2783
2952
  synonyms?: string | undefined;
2784
2953
  tier?: string | undefined;
@@ -2788,6 +2957,7 @@ declare const TraitSchema: z.ZodObject<{
2788
2957
  }, {
2789
2958
  name: string;
2790
2959
  key: string;
2960
+ id?: string | undefined;
2791
2961
  description?: string | undefined;
2792
2962
  synonyms?: string | undefined;
2793
2963
  tier?: string | undefined;
@@ -2799,6 +2969,7 @@ declare const TraitSchema: z.ZodObject<{
2799
2969
  from: z.ZodString;
2800
2970
  to: z.ZodString;
2801
2971
  event: z.ZodString;
2972
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2802
2973
  guard: z.ZodOptional<z.ZodNullable<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>>;
2803
2974
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
2804
2975
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -2807,6 +2978,7 @@ declare const TraitSchema: z.ZodObject<{
2807
2978
  from: string;
2808
2979
  to: string;
2809
2980
  description?: string | null | undefined;
2981
+ eventId?: EventId | undefined;
2810
2982
  guard?: SExpr | undefined;
2811
2983
  effects?: unknown[][] | undefined;
2812
2984
  }, {
@@ -2814,6 +2986,7 @@ declare const TraitSchema: z.ZodObject<{
2814
2986
  from: string;
2815
2987
  to: string;
2816
2988
  description?: string | null | undefined;
2989
+ eventId?: string | undefined;
2817
2990
  guard?: SExpr | undefined;
2818
2991
  effects?: unknown[][] | undefined;
2819
2992
  }>, "many">;
@@ -2834,6 +3007,7 @@ declare const TraitSchema: z.ZodObject<{
2834
3007
  events: {
2835
3008
  name: string;
2836
3009
  key: string;
3010
+ id?: EventId | undefined;
2837
3011
  description?: string | undefined;
2838
3012
  synonyms?: string | undefined;
2839
3013
  tier?: string | undefined;
@@ -2855,6 +3029,7 @@ declare const TraitSchema: z.ZodObject<{
2855
3029
  from: string;
2856
3030
  to: string;
2857
3031
  description?: string | null | undefined;
3032
+ eventId?: EventId | undefined;
2858
3033
  guard?: SExpr | undefined;
2859
3034
  effects?: unknown[][] | undefined;
2860
3035
  }[];
@@ -2867,6 +3042,7 @@ declare const TraitSchema: z.ZodObject<{
2867
3042
  events: {
2868
3043
  name: string;
2869
3044
  key: string;
3045
+ id?: string | undefined;
2870
3046
  description?: string | undefined;
2871
3047
  synonyms?: string | undefined;
2872
3048
  tier?: string | undefined;
@@ -2888,6 +3064,7 @@ declare const TraitSchema: z.ZodObject<{
2888
3064
  from: string;
2889
3065
  to: string;
2890
3066
  description?: string | null | undefined;
3067
+ eventId?: string | undefined;
2891
3068
  guard?: SExpr | undefined;
2892
3069
  effects?: unknown[][] | undefined;
2893
3070
  }[];
@@ -2905,9 +3082,11 @@ declare const TraitSchema: z.ZodObject<{
2905
3082
  interval: z.ZodUnion<[z.ZodLiteral<"frame">, z.ZodNumber]>;
2906
3083
  appliesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2907
3084
  pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3085
+ pageIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, PageId, string>, "many">>;
2908
3086
  guard: z.ZodOptional<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>;
2909
3087
  effects: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">;
2910
3088
  emits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3089
+ emitIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, EventId, string>, "many">>;
2911
3090
  }, "strip", z.ZodTypeAny, {
2912
3091
  name: string;
2913
3092
  effects: unknown[][];
@@ -2917,7 +3096,9 @@ declare const TraitSchema: z.ZodObject<{
2917
3096
  guard?: SExpr | undefined;
2918
3097
  priority?: number | undefined;
2919
3098
  appliesTo?: string[] | undefined;
3099
+ pageIds?: PageId[] | undefined;
2920
3100
  emits?: string[] | undefined;
3101
+ emitIds?: EventId[] | undefined;
2921
3102
  }, {
2922
3103
  name: string;
2923
3104
  effects: unknown[][];
@@ -2927,7 +3108,9 @@ declare const TraitSchema: z.ZodObject<{
2927
3108
  guard?: SExpr | undefined;
2928
3109
  priority?: number | undefined;
2929
3110
  appliesTo?: string[] | undefined;
3111
+ pageIds?: string[] | undefined;
2930
3112
  emits?: string[] | undefined;
3113
+ emitIds?: string[] | undefined;
2931
3114
  }>, "many">>;
2932
3115
  emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
2933
3116
  /**
@@ -2940,6 +3123,7 @@ declare const TraitSchema: z.ZodObject<{
2940
3123
  * knob's effective literal before codegen/runtime consume it.
2941
3124
  */
2942
3125
  event: z.ZodString;
3126
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2943
3127
  description: z.ZodOptional<z.ZodString>;
2944
3128
  synonyms: z.ZodOptional<z.ZodString>;
2945
3129
  tier: z.ZodOptional<z.ZodString>;
@@ -2952,6 +3136,7 @@ declare const TraitSchema: z.ZodObject<{
2952
3136
  scope?: "internal" | "external" | undefined;
2953
3137
  tier?: string | undefined;
2954
3138
  payloadSchema?: EventPayloadField[] | undefined;
3139
+ eventId?: EventId | undefined;
2955
3140
  }, {
2956
3141
  event: string;
2957
3142
  description?: string | undefined;
@@ -2959,10 +3144,13 @@ declare const TraitSchema: z.ZodObject<{
2959
3144
  scope?: "internal" | "external" | undefined;
2960
3145
  tier?: string | undefined;
2961
3146
  payloadSchema?: EventPayloadField[] | undefined;
3147
+ eventId?: string | undefined;
2962
3148
  }>, "many">>;
2963
3149
  listens: z.ZodOptional<z.ZodArray<z.ZodObject<{
2964
3150
  event: z.ZodString;
3151
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2965
3152
  triggers: z.ZodString;
3153
+ triggersId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
2966
3154
  description: z.ZodOptional<z.ZodString>;
2967
3155
  synonyms: z.ZodOptional<z.ZodString>;
2968
3156
  tier: z.ZodOptional<z.ZodString>;
@@ -2978,24 +3166,33 @@ declare const TraitSchema: z.ZodObject<{
2978
3166
  }>, z.ZodObject<{
2979
3167
  kind: z.ZodLiteral<"trait">;
2980
3168
  trait: z.ZodString;
3169
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2981
3170
  }, "strip", z.ZodTypeAny, {
2982
3171
  trait: string;
2983
3172
  kind: "trait";
3173
+ traitId?: TraitId | undefined;
2984
3174
  }, {
2985
3175
  trait: string;
2986
3176
  kind: "trait";
3177
+ traitId?: string | undefined;
2987
3178
  }>, z.ZodObject<{
2988
3179
  kind: z.ZodLiteral<"orbital">;
2989
3180
  orbital: z.ZodString;
2990
3181
  trait: z.ZodString;
3182
+ orbitalId: z.ZodOptional<z.ZodEffects<z.ZodString, OrbitalId, string>>;
3183
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
2991
3184
  }, "strip", z.ZodTypeAny, {
3185
+ orbital: string;
2992
3186
  trait: string;
2993
3187
  kind: "orbital";
2994
- orbital: string;
3188
+ traitId?: TraitId | undefined;
3189
+ orbitalId?: OrbitalId | undefined;
2995
3190
  }, {
3191
+ orbital: string;
2996
3192
  trait: string;
2997
3193
  kind: "orbital";
2998
- orbital: string;
3194
+ traitId?: string | undefined;
3195
+ orbitalId?: string | undefined;
2999
3196
  }>]>>;
3000
3197
  }, "strip", z.ZodTypeAny, {
3001
3198
  event: string;
@@ -3007,14 +3204,19 @@ declare const TraitSchema: z.ZodObject<{
3007
3204
  } | {
3008
3205
  trait: string;
3009
3206
  kind: "trait";
3207
+ traitId?: TraitId | undefined;
3010
3208
  } | {
3209
+ orbital: string;
3011
3210
  trait: string;
3012
3211
  kind: "orbital";
3013
- orbital: string;
3212
+ traitId?: TraitId | undefined;
3213
+ orbitalId?: OrbitalId | undefined;
3014
3214
  } | undefined;
3015
3215
  scope?: "internal" | "external" | undefined;
3016
3216
  tier?: string | undefined;
3217
+ eventId?: EventId | undefined;
3017
3218
  guard?: SExpr | undefined;
3219
+ triggersId?: EventId | undefined;
3018
3220
  payloadMapping?: Record<string, string> | undefined;
3019
3221
  }, {
3020
3222
  event: string;
@@ -3026,14 +3228,19 @@ declare const TraitSchema: z.ZodObject<{
3026
3228
  } | {
3027
3229
  trait: string;
3028
3230
  kind: "trait";
3231
+ traitId?: string | undefined;
3029
3232
  } | {
3233
+ orbital: string;
3030
3234
  trait: string;
3031
3235
  kind: "orbital";
3032
- orbital: string;
3236
+ traitId?: string | undefined;
3237
+ orbitalId?: string | undefined;
3033
3238
  } | undefined;
3034
3239
  scope?: "internal" | "external" | undefined;
3035
3240
  tier?: string | undefined;
3241
+ eventId?: string | undefined;
3036
3242
  guard?: SExpr | undefined;
3243
+ triggersId?: string | undefined;
3037
3244
  payloadMapping?: Record<string, string> | undefined;
3038
3245
  }>, "many">>;
3039
3246
  ui: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -3131,6 +3338,7 @@ declare const TraitSchema: z.ZodObject<{
3131
3338
  }, "strip", z.ZodTypeAny, {
3132
3339
  name: string;
3133
3340
  scope: "collection" | "instance";
3341
+ id?: TraitId | undefined;
3134
3342
  description?: string | undefined;
3135
3343
  ui?: Record<string, unknown> | undefined;
3136
3344
  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;
@@ -3150,6 +3358,7 @@ declare const TraitSchema: z.ZodObject<{
3150
3358
  events: {
3151
3359
  name: string;
3152
3360
  key: string;
3361
+ id?: EventId | undefined;
3153
3362
  description?: string | undefined;
3154
3363
  synonyms?: string | undefined;
3155
3364
  tier?: string | undefined;
@@ -3171,6 +3380,7 @@ declare const TraitSchema: z.ZodObject<{
3171
3380
  from: string;
3172
3381
  to: string;
3173
3382
  description?: string | null | undefined;
3383
+ eventId?: EventId | undefined;
3174
3384
  guard?: SExpr | undefined;
3175
3385
  effects?: unknown[][] | undefined;
3176
3386
  }[];
@@ -3187,8 +3397,10 @@ declare const TraitSchema: z.ZodObject<{
3187
3397
  scope?: "internal" | "external" | undefined;
3188
3398
  tier?: string | undefined;
3189
3399
  payloadSchema?: EventPayloadField[] | undefined;
3400
+ eventId?: EventId | undefined;
3190
3401
  }[] | undefined;
3191
3402
  linkedEntity?: string | undefined;
3403
+ linkedEntityId?: EntityId | undefined;
3192
3404
  listens?: {
3193
3405
  event: string;
3194
3406
  triggers: string;
@@ -3199,14 +3411,19 @@ declare const TraitSchema: z.ZodObject<{
3199
3411
  } | {
3200
3412
  trait: string;
3201
3413
  kind: "trait";
3414
+ traitId?: TraitId | undefined;
3202
3415
  } | {
3416
+ orbital: string;
3203
3417
  trait: string;
3204
3418
  kind: "orbital";
3205
- orbital: string;
3419
+ traitId?: TraitId | undefined;
3420
+ orbitalId?: OrbitalId | undefined;
3206
3421
  } | undefined;
3207
3422
  scope?: "internal" | "external" | undefined;
3208
3423
  tier?: string | undefined;
3424
+ eventId?: EventId | undefined;
3209
3425
  guard?: SExpr | undefined;
3426
+ triggersId?: EventId | undefined;
3210
3427
  payloadMapping?: Record<string, string> | undefined;
3211
3428
  }[] | undefined;
3212
3429
  description_visual_prompt?: string | undefined;
@@ -3217,8 +3434,10 @@ declare const TraitSchema: z.ZodObject<{
3217
3434
  } | undefined;
3218
3435
  entityBindingDescription?: string | undefined;
3219
3436
  entityBindingSynonyms?: string | undefined;
3437
+ entityRefIds?: Record<string, EntityId> | undefined;
3438
+ traitEmbedIds?: Record<string, TraitId> | undefined;
3220
3439
  requiredFields?: {
3221
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
3440
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
3222
3441
  name: string;
3223
3442
  description?: string | undefined;
3224
3443
  }[] | undefined;
@@ -3232,7 +3451,9 @@ declare const TraitSchema: z.ZodObject<{
3232
3451
  guard?: SExpr | undefined;
3233
3452
  priority?: number | undefined;
3234
3453
  appliesTo?: string[] | undefined;
3454
+ pageIds?: PageId[] | undefined;
3235
3455
  emits?: string[] | undefined;
3456
+ emitIds?: EventId[] | undefined;
3236
3457
  }[] | undefined;
3237
3458
  sourceBehavior?: {
3238
3459
  behavior: string;
@@ -3263,6 +3484,7 @@ declare const TraitSchema: z.ZodObject<{
3263
3484
  }, {
3264
3485
  name: string;
3265
3486
  scope: "collection" | "instance";
3487
+ id?: string | undefined;
3266
3488
  description?: string | undefined;
3267
3489
  ui?: Record<string, unknown> | undefined;
3268
3490
  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;
@@ -3282,6 +3504,7 @@ declare const TraitSchema: z.ZodObject<{
3282
3504
  events: {
3283
3505
  name: string;
3284
3506
  key: string;
3507
+ id?: string | undefined;
3285
3508
  description?: string | undefined;
3286
3509
  synonyms?: string | undefined;
3287
3510
  tier?: string | undefined;
@@ -3303,6 +3526,7 @@ declare const TraitSchema: z.ZodObject<{
3303
3526
  from: string;
3304
3527
  to: string;
3305
3528
  description?: string | null | undefined;
3529
+ eventId?: string | undefined;
3306
3530
  guard?: SExpr | undefined;
3307
3531
  effects?: unknown[][] | undefined;
3308
3532
  }[];
@@ -3319,8 +3543,10 @@ declare const TraitSchema: z.ZodObject<{
3319
3543
  scope?: "internal" | "external" | undefined;
3320
3544
  tier?: string | undefined;
3321
3545
  payloadSchema?: EventPayloadField[] | undefined;
3546
+ eventId?: string | undefined;
3322
3547
  }[] | undefined;
3323
3548
  linkedEntity?: string | undefined;
3549
+ linkedEntityId?: string | undefined;
3324
3550
  listens?: {
3325
3551
  event: string;
3326
3552
  triggers: string;
@@ -3331,14 +3557,19 @@ declare const TraitSchema: z.ZodObject<{
3331
3557
  } | {
3332
3558
  trait: string;
3333
3559
  kind: "trait";
3560
+ traitId?: string | undefined;
3334
3561
  } | {
3562
+ orbital: string;
3335
3563
  trait: string;
3336
3564
  kind: "orbital";
3337
- orbital: string;
3565
+ traitId?: string | undefined;
3566
+ orbitalId?: string | undefined;
3338
3567
  } | undefined;
3339
3568
  scope?: "internal" | "external" | undefined;
3340
3569
  tier?: string | undefined;
3570
+ eventId?: string | undefined;
3341
3571
  guard?: SExpr | undefined;
3572
+ triggersId?: string | undefined;
3342
3573
  payloadMapping?: Record<string, string> | undefined;
3343
3574
  }[] | undefined;
3344
3575
  description_visual_prompt?: string | undefined;
@@ -3349,8 +3580,10 @@ declare const TraitSchema: z.ZodObject<{
3349
3580
  } | undefined;
3350
3581
  entityBindingDescription?: string | undefined;
3351
3582
  entityBindingSynonyms?: string | undefined;
3583
+ entityRefIds?: Record<string, string> | undefined;
3584
+ traitEmbedIds?: Record<string, string> | undefined;
3352
3585
  requiredFields?: {
3353
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
3586
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
3354
3587
  name: string;
3355
3588
  description?: string | undefined;
3356
3589
  }[] | undefined;
@@ -3364,7 +3597,9 @@ declare const TraitSchema: z.ZodObject<{
3364
3597
  guard?: SExpr | undefined;
3365
3598
  priority?: number | undefined;
3366
3599
  appliesTo?: string[] | undefined;
3600
+ pageIds?: string[] | undefined;
3367
3601
  emits?: string[] | undefined;
3602
+ emitIds?: string[] | undefined;
3368
3603
  }[] | undefined;
3369
3604
  sourceBehavior?: {
3370
3605
  behavior: string;
@@ -3412,6 +3647,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3412
3647
  events?: Record<string, string> | undefined;
3413
3648
  linkedEntity?: string | undefined;
3414
3649
  }>, z.ZodObject<{
3650
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
3415
3651
  name: z.ZodString;
3416
3652
  description: z.ZodOptional<z.ZodString>;
3417
3653
  description_visual_prompt: z.ZodOptional<z.ZodString>;
@@ -3432,16 +3668,19 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3432
3668
  capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3433
3669
  scope: z.ZodEnum<["instance", "collection"]>;
3434
3670
  linkedEntity: z.ZodOptional<z.ZodString>;
3671
+ linkedEntityId: z.ZodOptional<z.ZodEffects<z.ZodString, EntityId, string>>;
3672
+ entityRefIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, EntityId, string>>>;
3673
+ traitEmbedIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, TraitId, string>>>;
3435
3674
  requiredFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
3436
3675
  name: z.ZodString;
3437
3676
  type: z.ZodEnum<["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum"]>;
3438
3677
  description: z.ZodOptional<z.ZodString>;
3439
3678
  }, "strip", z.ZodTypeAny, {
3440
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
3679
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
3441
3680
  name: string;
3442
3681
  description?: string | undefined;
3443
3682
  }, {
3444
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
3683
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
3445
3684
  name: string;
3446
3685
  description?: string | undefined;
3447
3686
  }>, "many">>;
@@ -3501,6 +3740,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3501
3740
  }>, "many">;
3502
3741
  events: z.ZodArray<z.ZodObject<{
3503
3742
  key: z.ZodString;
3743
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
3504
3744
  name: z.ZodString;
3505
3745
  description: z.ZodOptional<z.ZodString>;
3506
3746
  synonyms: z.ZodOptional<z.ZodString>;
@@ -3511,6 +3751,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3511
3751
  }, "strip", z.ZodTypeAny, {
3512
3752
  name: string;
3513
3753
  key: string;
3754
+ id?: EventId | undefined;
3514
3755
  description?: string | undefined;
3515
3756
  synonyms?: string | undefined;
3516
3757
  tier?: string | undefined;
@@ -3520,6 +3761,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3520
3761
  }, {
3521
3762
  name: string;
3522
3763
  key: string;
3764
+ id?: string | undefined;
3523
3765
  description?: string | undefined;
3524
3766
  synonyms?: string | undefined;
3525
3767
  tier?: string | undefined;
@@ -3531,6 +3773,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3531
3773
  from: z.ZodString;
3532
3774
  to: z.ZodString;
3533
3775
  event: z.ZodString;
3776
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
3534
3777
  guard: z.ZodOptional<z.ZodNullable<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>>;
3535
3778
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
3536
3779
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -3539,6 +3782,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3539
3782
  from: string;
3540
3783
  to: string;
3541
3784
  description?: string | null | undefined;
3785
+ eventId?: EventId | undefined;
3542
3786
  guard?: SExpr | undefined;
3543
3787
  effects?: unknown[][] | undefined;
3544
3788
  }, {
@@ -3546,6 +3790,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3546
3790
  from: string;
3547
3791
  to: string;
3548
3792
  description?: string | null | undefined;
3793
+ eventId?: string | undefined;
3549
3794
  guard?: SExpr | undefined;
3550
3795
  effects?: unknown[][] | undefined;
3551
3796
  }>, "many">;
@@ -3566,6 +3811,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3566
3811
  events: {
3567
3812
  name: string;
3568
3813
  key: string;
3814
+ id?: EventId | undefined;
3569
3815
  description?: string | undefined;
3570
3816
  synonyms?: string | undefined;
3571
3817
  tier?: string | undefined;
@@ -3587,6 +3833,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3587
3833
  from: string;
3588
3834
  to: string;
3589
3835
  description?: string | null | undefined;
3836
+ eventId?: EventId | undefined;
3590
3837
  guard?: SExpr | undefined;
3591
3838
  effects?: unknown[][] | undefined;
3592
3839
  }[];
@@ -3599,6 +3846,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3599
3846
  events: {
3600
3847
  name: string;
3601
3848
  key: string;
3849
+ id?: string | undefined;
3602
3850
  description?: string | undefined;
3603
3851
  synonyms?: string | undefined;
3604
3852
  tier?: string | undefined;
@@ -3620,6 +3868,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3620
3868
  from: string;
3621
3869
  to: string;
3622
3870
  description?: string | null | undefined;
3871
+ eventId?: string | undefined;
3623
3872
  guard?: SExpr | undefined;
3624
3873
  effects?: unknown[][] | undefined;
3625
3874
  }[];
@@ -3637,9 +3886,11 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3637
3886
  interval: z.ZodUnion<[z.ZodLiteral<"frame">, z.ZodNumber]>;
3638
3887
  appliesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3639
3888
  pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3889
+ pageIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, PageId, string>, "many">>;
3640
3890
  guard: z.ZodOptional<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>;
3641
3891
  effects: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">;
3642
3892
  emits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3893
+ emitIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, EventId, string>, "many">>;
3643
3894
  }, "strip", z.ZodTypeAny, {
3644
3895
  name: string;
3645
3896
  effects: unknown[][];
@@ -3649,7 +3900,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3649
3900
  guard?: SExpr | undefined;
3650
3901
  priority?: number | undefined;
3651
3902
  appliesTo?: string[] | undefined;
3903
+ pageIds?: PageId[] | undefined;
3652
3904
  emits?: string[] | undefined;
3905
+ emitIds?: EventId[] | undefined;
3653
3906
  }, {
3654
3907
  name: string;
3655
3908
  effects: unknown[][];
@@ -3659,7 +3912,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3659
3912
  guard?: SExpr | undefined;
3660
3913
  priority?: number | undefined;
3661
3914
  appliesTo?: string[] | undefined;
3915
+ pageIds?: string[] | undefined;
3662
3916
  emits?: string[] | undefined;
3917
+ emitIds?: string[] | undefined;
3663
3918
  }>, "many">>;
3664
3919
  emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
3665
3920
  /**
@@ -3672,6 +3927,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3672
3927
  * knob's effective literal before codegen/runtime consume it.
3673
3928
  */
3674
3929
  event: z.ZodString;
3930
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
3675
3931
  description: z.ZodOptional<z.ZodString>;
3676
3932
  synonyms: z.ZodOptional<z.ZodString>;
3677
3933
  tier: z.ZodOptional<z.ZodString>;
@@ -3684,6 +3940,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3684
3940
  scope?: "internal" | "external" | undefined;
3685
3941
  tier?: string | undefined;
3686
3942
  payloadSchema?: EventPayloadField[] | undefined;
3943
+ eventId?: EventId | undefined;
3687
3944
  }, {
3688
3945
  event: string;
3689
3946
  description?: string | undefined;
@@ -3691,10 +3948,13 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3691
3948
  scope?: "internal" | "external" | undefined;
3692
3949
  tier?: string | undefined;
3693
3950
  payloadSchema?: EventPayloadField[] | undefined;
3951
+ eventId?: string | undefined;
3694
3952
  }>, "many">>;
3695
3953
  listens: z.ZodOptional<z.ZodArray<z.ZodObject<{
3696
3954
  event: z.ZodString;
3955
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
3697
3956
  triggers: z.ZodString;
3957
+ triggersId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
3698
3958
  description: z.ZodOptional<z.ZodString>;
3699
3959
  synonyms: z.ZodOptional<z.ZodString>;
3700
3960
  tier: z.ZodOptional<z.ZodString>;
@@ -3710,24 +3970,33 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3710
3970
  }>, z.ZodObject<{
3711
3971
  kind: z.ZodLiteral<"trait">;
3712
3972
  trait: z.ZodString;
3973
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
3713
3974
  }, "strip", z.ZodTypeAny, {
3714
3975
  trait: string;
3715
3976
  kind: "trait";
3977
+ traitId?: TraitId | undefined;
3716
3978
  }, {
3717
3979
  trait: string;
3718
3980
  kind: "trait";
3981
+ traitId?: string | undefined;
3719
3982
  }>, z.ZodObject<{
3720
3983
  kind: z.ZodLiteral<"orbital">;
3721
3984
  orbital: z.ZodString;
3722
3985
  trait: z.ZodString;
3986
+ orbitalId: z.ZodOptional<z.ZodEffects<z.ZodString, OrbitalId, string>>;
3987
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
3723
3988
  }, "strip", z.ZodTypeAny, {
3989
+ orbital: string;
3724
3990
  trait: string;
3725
3991
  kind: "orbital";
3726
- orbital: string;
3992
+ traitId?: TraitId | undefined;
3993
+ orbitalId?: OrbitalId | undefined;
3727
3994
  }, {
3995
+ orbital: string;
3728
3996
  trait: string;
3729
3997
  kind: "orbital";
3730
- orbital: string;
3998
+ traitId?: string | undefined;
3999
+ orbitalId?: string | undefined;
3731
4000
  }>]>>;
3732
4001
  }, "strip", z.ZodTypeAny, {
3733
4002
  event: string;
@@ -3739,14 +4008,19 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3739
4008
  } | {
3740
4009
  trait: string;
3741
4010
  kind: "trait";
4011
+ traitId?: TraitId | undefined;
3742
4012
  } | {
4013
+ orbital: string;
3743
4014
  trait: string;
3744
4015
  kind: "orbital";
3745
- orbital: string;
4016
+ traitId?: TraitId | undefined;
4017
+ orbitalId?: OrbitalId | undefined;
3746
4018
  } | undefined;
3747
4019
  scope?: "internal" | "external" | undefined;
3748
4020
  tier?: string | undefined;
4021
+ eventId?: EventId | undefined;
3749
4022
  guard?: SExpr | undefined;
4023
+ triggersId?: EventId | undefined;
3750
4024
  payloadMapping?: Record<string, string> | undefined;
3751
4025
  }, {
3752
4026
  event: string;
@@ -3758,14 +4032,19 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3758
4032
  } | {
3759
4033
  trait: string;
3760
4034
  kind: "trait";
4035
+ traitId?: string | undefined;
3761
4036
  } | {
4037
+ orbital: string;
3762
4038
  trait: string;
3763
4039
  kind: "orbital";
3764
- orbital: string;
4040
+ traitId?: string | undefined;
4041
+ orbitalId?: string | undefined;
3765
4042
  } | undefined;
3766
4043
  scope?: "internal" | "external" | undefined;
3767
4044
  tier?: string | undefined;
4045
+ eventId?: string | undefined;
3768
4046
  guard?: SExpr | undefined;
4047
+ triggersId?: string | undefined;
3769
4048
  payloadMapping?: Record<string, string> | undefined;
3770
4049
  }>, "many">>;
3771
4050
  ui: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -3863,6 +4142,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3863
4142
  }, "strip", z.ZodTypeAny, {
3864
4143
  name: string;
3865
4144
  scope: "collection" | "instance";
4145
+ id?: TraitId | undefined;
3866
4146
  description?: string | undefined;
3867
4147
  ui?: Record<string, unknown> | undefined;
3868
4148
  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;
@@ -3882,6 +4162,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3882
4162
  events: {
3883
4163
  name: string;
3884
4164
  key: string;
4165
+ id?: EventId | undefined;
3885
4166
  description?: string | undefined;
3886
4167
  synonyms?: string | undefined;
3887
4168
  tier?: string | undefined;
@@ -3903,6 +4184,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3903
4184
  from: string;
3904
4185
  to: string;
3905
4186
  description?: string | null | undefined;
4187
+ eventId?: EventId | undefined;
3906
4188
  guard?: SExpr | undefined;
3907
4189
  effects?: unknown[][] | undefined;
3908
4190
  }[];
@@ -3919,8 +4201,10 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3919
4201
  scope?: "internal" | "external" | undefined;
3920
4202
  tier?: string | undefined;
3921
4203
  payloadSchema?: EventPayloadField[] | undefined;
4204
+ eventId?: EventId | undefined;
3922
4205
  }[] | undefined;
3923
4206
  linkedEntity?: string | undefined;
4207
+ linkedEntityId?: EntityId | undefined;
3924
4208
  listens?: {
3925
4209
  event: string;
3926
4210
  triggers: string;
@@ -3931,14 +4215,19 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3931
4215
  } | {
3932
4216
  trait: string;
3933
4217
  kind: "trait";
4218
+ traitId?: TraitId | undefined;
3934
4219
  } | {
4220
+ orbital: string;
3935
4221
  trait: string;
3936
4222
  kind: "orbital";
3937
- orbital: string;
4223
+ traitId?: TraitId | undefined;
4224
+ orbitalId?: OrbitalId | undefined;
3938
4225
  } | undefined;
3939
4226
  scope?: "internal" | "external" | undefined;
3940
4227
  tier?: string | undefined;
4228
+ eventId?: EventId | undefined;
3941
4229
  guard?: SExpr | undefined;
4230
+ triggersId?: EventId | undefined;
3942
4231
  payloadMapping?: Record<string, string> | undefined;
3943
4232
  }[] | undefined;
3944
4233
  description_visual_prompt?: string | undefined;
@@ -3949,8 +4238,10 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3949
4238
  } | undefined;
3950
4239
  entityBindingDescription?: string | undefined;
3951
4240
  entityBindingSynonyms?: string | undefined;
4241
+ entityRefIds?: Record<string, EntityId> | undefined;
4242
+ traitEmbedIds?: Record<string, TraitId> | undefined;
3952
4243
  requiredFields?: {
3953
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
4244
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
3954
4245
  name: string;
3955
4246
  description?: string | undefined;
3956
4247
  }[] | undefined;
@@ -3964,7 +4255,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3964
4255
  guard?: SExpr | undefined;
3965
4256
  priority?: number | undefined;
3966
4257
  appliesTo?: string[] | undefined;
4258
+ pageIds?: PageId[] | undefined;
3967
4259
  emits?: string[] | undefined;
4260
+ emitIds?: EventId[] | undefined;
3968
4261
  }[] | undefined;
3969
4262
  sourceBehavior?: {
3970
4263
  behavior: string;
@@ -3995,6 +4288,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
3995
4288
  }, {
3996
4289
  name: string;
3997
4290
  scope: "collection" | "instance";
4291
+ id?: string | undefined;
3998
4292
  description?: string | undefined;
3999
4293
  ui?: Record<string, unknown> | undefined;
4000
4294
  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;
@@ -4014,6 +4308,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4014
4308
  events: {
4015
4309
  name: string;
4016
4310
  key: string;
4311
+ id?: string | undefined;
4017
4312
  description?: string | undefined;
4018
4313
  synonyms?: string | undefined;
4019
4314
  tier?: string | undefined;
@@ -4035,6 +4330,7 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4035
4330
  from: string;
4036
4331
  to: string;
4037
4332
  description?: string | null | undefined;
4333
+ eventId?: string | undefined;
4038
4334
  guard?: SExpr | undefined;
4039
4335
  effects?: unknown[][] | undefined;
4040
4336
  }[];
@@ -4051,8 +4347,10 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4051
4347
  scope?: "internal" | "external" | undefined;
4052
4348
  tier?: string | undefined;
4053
4349
  payloadSchema?: EventPayloadField[] | undefined;
4350
+ eventId?: string | undefined;
4054
4351
  }[] | undefined;
4055
4352
  linkedEntity?: string | undefined;
4353
+ linkedEntityId?: string | undefined;
4056
4354
  listens?: {
4057
4355
  event: string;
4058
4356
  triggers: string;
@@ -4063,14 +4361,19 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4063
4361
  } | {
4064
4362
  trait: string;
4065
4363
  kind: "trait";
4364
+ traitId?: string | undefined;
4066
4365
  } | {
4366
+ orbital: string;
4067
4367
  trait: string;
4068
4368
  kind: "orbital";
4069
- orbital: string;
4369
+ traitId?: string | undefined;
4370
+ orbitalId?: string | undefined;
4070
4371
  } | undefined;
4071
4372
  scope?: "internal" | "external" | undefined;
4072
4373
  tier?: string | undefined;
4374
+ eventId?: string | undefined;
4073
4375
  guard?: SExpr | undefined;
4376
+ triggersId?: string | undefined;
4074
4377
  payloadMapping?: Record<string, string> | undefined;
4075
4378
  }[] | undefined;
4076
4379
  description_visual_prompt?: string | undefined;
@@ -4081,8 +4384,10 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4081
4384
  } | undefined;
4082
4385
  entityBindingDescription?: string | undefined;
4083
4386
  entityBindingSynonyms?: string | undefined;
4387
+ entityRefIds?: Record<string, string> | undefined;
4388
+ traitEmbedIds?: Record<string, string> | undefined;
4084
4389
  requiredFields?: {
4085
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
4390
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
4086
4391
  name: string;
4087
4392
  description?: string | undefined;
4088
4393
  }[] | undefined;
@@ -4096,7 +4401,9 @@ declare const TraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4096
4401
  guard?: SExpr | undefined;
4097
4402
  priority?: number | undefined;
4098
4403
  appliesTo?: string[] | undefined;
4404
+ pageIds?: string[] | undefined;
4099
4405
  emits?: string[] | undefined;
4406
+ emitIds?: string[] | undefined;
4100
4407
  }[] | undefined;
4101
4408
  sourceBehavior?: {
4102
4409
  behavior: string;
@@ -4214,6 +4521,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4214
4521
  events?: Record<string, string> | undefined;
4215
4522
  linkedEntity?: string | undefined;
4216
4523
  }>, z.ZodObject<{
4524
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
4217
4525
  name: z.ZodString;
4218
4526
  description: z.ZodOptional<z.ZodString>;
4219
4527
  description_visual_prompt: z.ZodOptional<z.ZodString>;
@@ -4234,16 +4542,19 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4234
4542
  capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4235
4543
  scope: z.ZodEnum<["instance", "collection"]>;
4236
4544
  linkedEntity: z.ZodOptional<z.ZodString>;
4545
+ linkedEntityId: z.ZodOptional<z.ZodEffects<z.ZodString, EntityId, string>>;
4546
+ entityRefIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, EntityId, string>>>;
4547
+ traitEmbedIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, TraitId, string>>>;
4237
4548
  requiredFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
4238
4549
  name: z.ZodString;
4239
4550
  type: z.ZodEnum<["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum"]>;
4240
4551
  description: z.ZodOptional<z.ZodString>;
4241
4552
  }, "strip", z.ZodTypeAny, {
4242
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
4553
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
4243
4554
  name: string;
4244
4555
  description?: string | undefined;
4245
4556
  }, {
4246
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
4557
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
4247
4558
  name: string;
4248
4559
  description?: string | undefined;
4249
4560
  }>, "many">>;
@@ -4303,6 +4614,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4303
4614
  }>, "many">;
4304
4615
  events: z.ZodArray<z.ZodObject<{
4305
4616
  key: z.ZodString;
4617
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
4306
4618
  name: z.ZodString;
4307
4619
  description: z.ZodOptional<z.ZodString>;
4308
4620
  synonyms: z.ZodOptional<z.ZodString>;
@@ -4313,6 +4625,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4313
4625
  }, "strip", z.ZodTypeAny, {
4314
4626
  name: string;
4315
4627
  key: string;
4628
+ id?: EventId | undefined;
4316
4629
  description?: string | undefined;
4317
4630
  synonyms?: string | undefined;
4318
4631
  tier?: string | undefined;
@@ -4322,6 +4635,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4322
4635
  }, {
4323
4636
  name: string;
4324
4637
  key: string;
4638
+ id?: string | undefined;
4325
4639
  description?: string | undefined;
4326
4640
  synonyms?: string | undefined;
4327
4641
  tier?: string | undefined;
@@ -4333,6 +4647,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4333
4647
  from: z.ZodString;
4334
4648
  to: z.ZodString;
4335
4649
  event: z.ZodString;
4650
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
4336
4651
  guard: z.ZodOptional<z.ZodNullable<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>>;
4337
4652
  effects: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">>;
4338
4653
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -4341,6 +4656,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4341
4656
  from: string;
4342
4657
  to: string;
4343
4658
  description?: string | null | undefined;
4659
+ eventId?: EventId | undefined;
4344
4660
  guard?: SExpr | undefined;
4345
4661
  effects?: unknown[][] | undefined;
4346
4662
  }, {
@@ -4348,6 +4664,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4348
4664
  from: string;
4349
4665
  to: string;
4350
4666
  description?: string | null | undefined;
4667
+ eventId?: string | undefined;
4351
4668
  guard?: SExpr | undefined;
4352
4669
  effects?: unknown[][] | undefined;
4353
4670
  }>, "many">;
@@ -4368,6 +4685,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4368
4685
  events: {
4369
4686
  name: string;
4370
4687
  key: string;
4688
+ id?: EventId | undefined;
4371
4689
  description?: string | undefined;
4372
4690
  synonyms?: string | undefined;
4373
4691
  tier?: string | undefined;
@@ -4389,6 +4707,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4389
4707
  from: string;
4390
4708
  to: string;
4391
4709
  description?: string | null | undefined;
4710
+ eventId?: EventId | undefined;
4392
4711
  guard?: SExpr | undefined;
4393
4712
  effects?: unknown[][] | undefined;
4394
4713
  }[];
@@ -4401,6 +4720,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4401
4720
  events: {
4402
4721
  name: string;
4403
4722
  key: string;
4723
+ id?: string | undefined;
4404
4724
  description?: string | undefined;
4405
4725
  synonyms?: string | undefined;
4406
4726
  tier?: string | undefined;
@@ -4422,6 +4742,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4422
4742
  from: string;
4423
4743
  to: string;
4424
4744
  description?: string | null | undefined;
4745
+ eventId?: string | undefined;
4425
4746
  guard?: SExpr | undefined;
4426
4747
  effects?: unknown[][] | undefined;
4427
4748
  }[];
@@ -4439,9 +4760,11 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4439
4760
  interval: z.ZodUnion<[z.ZodLiteral<"frame">, z.ZodNumber]>;
4440
4761
  appliesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4441
4762
  pages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4763
+ pageIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, PageId, string>, "many">>;
4442
4764
  guard: z.ZodOptional<z.ZodType<SExpr, z.ZodTypeDef, SExpr>>;
4443
4765
  effects: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>, "many">;
4444
4766
  emits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4767
+ emitIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, EventId, string>, "many">>;
4445
4768
  }, "strip", z.ZodTypeAny, {
4446
4769
  name: string;
4447
4770
  effects: unknown[][];
@@ -4451,7 +4774,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4451
4774
  guard?: SExpr | undefined;
4452
4775
  priority?: number | undefined;
4453
4776
  appliesTo?: string[] | undefined;
4777
+ pageIds?: PageId[] | undefined;
4454
4778
  emits?: string[] | undefined;
4779
+ emitIds?: EventId[] | undefined;
4455
4780
  }, {
4456
4781
  name: string;
4457
4782
  effects: unknown[][];
@@ -4461,7 +4786,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4461
4786
  guard?: SExpr | undefined;
4462
4787
  priority?: number | undefined;
4463
4788
  appliesTo?: string[] | undefined;
4789
+ pageIds?: string[] | undefined;
4464
4790
  emits?: string[] | undefined;
4791
+ emitIds?: string[] | undefined;
4465
4792
  }>, "many">>;
4466
4793
  emits: z.ZodOptional<z.ZodArray<z.ZodObject<{
4467
4794
  /**
@@ -4474,6 +4801,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4474
4801
  * knob's effective literal before codegen/runtime consume it.
4475
4802
  */
4476
4803
  event: z.ZodString;
4804
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
4477
4805
  description: z.ZodOptional<z.ZodString>;
4478
4806
  synonyms: z.ZodOptional<z.ZodString>;
4479
4807
  tier: z.ZodOptional<z.ZodString>;
@@ -4486,6 +4814,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4486
4814
  scope?: "internal" | "external" | undefined;
4487
4815
  tier?: string | undefined;
4488
4816
  payloadSchema?: EventPayloadField[] | undefined;
4817
+ eventId?: EventId | undefined;
4489
4818
  }, {
4490
4819
  event: string;
4491
4820
  description?: string | undefined;
@@ -4493,10 +4822,13 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4493
4822
  scope?: "internal" | "external" | undefined;
4494
4823
  tier?: string | undefined;
4495
4824
  payloadSchema?: EventPayloadField[] | undefined;
4825
+ eventId?: string | undefined;
4496
4826
  }>, "many">>;
4497
4827
  listens: z.ZodOptional<z.ZodArray<z.ZodObject<{
4498
4828
  event: z.ZodString;
4829
+ eventId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
4499
4830
  triggers: z.ZodString;
4831
+ triggersId: z.ZodOptional<z.ZodEffects<z.ZodString, EventId, string>>;
4500
4832
  description: z.ZodOptional<z.ZodString>;
4501
4833
  synonyms: z.ZodOptional<z.ZodString>;
4502
4834
  tier: z.ZodOptional<z.ZodString>;
@@ -4512,24 +4844,33 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4512
4844
  }>, z.ZodObject<{
4513
4845
  kind: z.ZodLiteral<"trait">;
4514
4846
  trait: z.ZodString;
4847
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
4515
4848
  }, "strip", z.ZodTypeAny, {
4516
4849
  trait: string;
4517
4850
  kind: "trait";
4851
+ traitId?: TraitId | undefined;
4518
4852
  }, {
4519
4853
  trait: string;
4520
4854
  kind: "trait";
4855
+ traitId?: string | undefined;
4521
4856
  }>, z.ZodObject<{
4522
4857
  kind: z.ZodLiteral<"orbital">;
4523
4858
  orbital: z.ZodString;
4524
4859
  trait: z.ZodString;
4860
+ orbitalId: z.ZodOptional<z.ZodEffects<z.ZodString, OrbitalId, string>>;
4861
+ traitId: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
4525
4862
  }, "strip", z.ZodTypeAny, {
4863
+ orbital: string;
4526
4864
  trait: string;
4527
4865
  kind: "orbital";
4528
- orbital: string;
4866
+ traitId?: TraitId | undefined;
4867
+ orbitalId?: OrbitalId | undefined;
4529
4868
  }, {
4869
+ orbital: string;
4530
4870
  trait: string;
4531
4871
  kind: "orbital";
4532
- orbital: string;
4872
+ traitId?: string | undefined;
4873
+ orbitalId?: string | undefined;
4533
4874
  }>]>>;
4534
4875
  }, "strip", z.ZodTypeAny, {
4535
4876
  event: string;
@@ -4541,14 +4882,19 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4541
4882
  } | {
4542
4883
  trait: string;
4543
4884
  kind: "trait";
4885
+ traitId?: TraitId | undefined;
4544
4886
  } | {
4887
+ orbital: string;
4545
4888
  trait: string;
4546
4889
  kind: "orbital";
4547
- orbital: string;
4890
+ traitId?: TraitId | undefined;
4891
+ orbitalId?: OrbitalId | undefined;
4548
4892
  } | undefined;
4549
4893
  scope?: "internal" | "external" | undefined;
4550
4894
  tier?: string | undefined;
4895
+ eventId?: EventId | undefined;
4551
4896
  guard?: SExpr | undefined;
4897
+ triggersId?: EventId | undefined;
4552
4898
  payloadMapping?: Record<string, string> | undefined;
4553
4899
  }, {
4554
4900
  event: string;
@@ -4560,14 +4906,19 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4560
4906
  } | {
4561
4907
  trait: string;
4562
4908
  kind: "trait";
4909
+ traitId?: string | undefined;
4563
4910
  } | {
4911
+ orbital: string;
4564
4912
  trait: string;
4565
4913
  kind: "orbital";
4566
- orbital: string;
4914
+ traitId?: string | undefined;
4915
+ orbitalId?: string | undefined;
4567
4916
  } | undefined;
4568
4917
  scope?: "internal" | "external" | undefined;
4569
4918
  tier?: string | undefined;
4919
+ eventId?: string | undefined;
4570
4920
  guard?: SExpr | undefined;
4921
+ triggersId?: string | undefined;
4571
4922
  payloadMapping?: Record<string, string> | undefined;
4572
4923
  }>, "many">>;
4573
4924
  ui: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -4665,6 +5016,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4665
5016
  }, "strip", z.ZodTypeAny, {
4666
5017
  name: string;
4667
5018
  scope: "collection" | "instance";
5019
+ id?: TraitId | undefined;
4668
5020
  description?: string | undefined;
4669
5021
  ui?: Record<string, unknown> | undefined;
4670
5022
  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;
@@ -4684,6 +5036,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4684
5036
  events: {
4685
5037
  name: string;
4686
5038
  key: string;
5039
+ id?: EventId | undefined;
4687
5040
  description?: string | undefined;
4688
5041
  synonyms?: string | undefined;
4689
5042
  tier?: string | undefined;
@@ -4705,6 +5058,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4705
5058
  from: string;
4706
5059
  to: string;
4707
5060
  description?: string | null | undefined;
5061
+ eventId?: EventId | undefined;
4708
5062
  guard?: SExpr | undefined;
4709
5063
  effects?: unknown[][] | undefined;
4710
5064
  }[];
@@ -4721,8 +5075,10 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4721
5075
  scope?: "internal" | "external" | undefined;
4722
5076
  tier?: string | undefined;
4723
5077
  payloadSchema?: EventPayloadField[] | undefined;
5078
+ eventId?: EventId | undefined;
4724
5079
  }[] | undefined;
4725
5080
  linkedEntity?: string | undefined;
5081
+ linkedEntityId?: EntityId | undefined;
4726
5082
  listens?: {
4727
5083
  event: string;
4728
5084
  triggers: string;
@@ -4733,14 +5089,19 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4733
5089
  } | {
4734
5090
  trait: string;
4735
5091
  kind: "trait";
5092
+ traitId?: TraitId | undefined;
4736
5093
  } | {
5094
+ orbital: string;
4737
5095
  trait: string;
4738
5096
  kind: "orbital";
4739
- orbital: string;
5097
+ traitId?: TraitId | undefined;
5098
+ orbitalId?: OrbitalId | undefined;
4740
5099
  } | undefined;
4741
5100
  scope?: "internal" | "external" | undefined;
4742
5101
  tier?: string | undefined;
5102
+ eventId?: EventId | undefined;
4743
5103
  guard?: SExpr | undefined;
5104
+ triggersId?: EventId | undefined;
4744
5105
  payloadMapping?: Record<string, string> | undefined;
4745
5106
  }[] | undefined;
4746
5107
  description_visual_prompt?: string | undefined;
@@ -4751,8 +5112,10 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4751
5112
  } | undefined;
4752
5113
  entityBindingDescription?: string | undefined;
4753
5114
  entityBindingSynonyms?: string | undefined;
5115
+ entityRefIds?: Record<string, EntityId> | undefined;
5116
+ traitEmbedIds?: Record<string, TraitId> | undefined;
4754
5117
  requiredFields?: {
4755
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
5118
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
4756
5119
  name: string;
4757
5120
  description?: string | undefined;
4758
5121
  }[] | undefined;
@@ -4766,7 +5129,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4766
5129
  guard?: SExpr | undefined;
4767
5130
  priority?: number | undefined;
4768
5131
  appliesTo?: string[] | undefined;
5132
+ pageIds?: PageId[] | undefined;
4769
5133
  emits?: string[] | undefined;
5134
+ emitIds?: EventId[] | undefined;
4770
5135
  }[] | undefined;
4771
5136
  sourceBehavior?: {
4772
5137
  behavior: string;
@@ -4797,6 +5162,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4797
5162
  }, {
4798
5163
  name: string;
4799
5164
  scope: "collection" | "instance";
5165
+ id?: string | undefined;
4800
5166
  description?: string | undefined;
4801
5167
  ui?: Record<string, unknown> | undefined;
4802
5168
  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;
@@ -4816,6 +5182,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4816
5182
  events: {
4817
5183
  name: string;
4818
5184
  key: string;
5185
+ id?: string | undefined;
4819
5186
  description?: string | undefined;
4820
5187
  synonyms?: string | undefined;
4821
5188
  tier?: string | undefined;
@@ -4837,6 +5204,7 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4837
5204
  from: string;
4838
5205
  to: string;
4839
5206
  description?: string | null | undefined;
5207
+ eventId?: string | undefined;
4840
5208
  guard?: SExpr | undefined;
4841
5209
  effects?: unknown[][] | undefined;
4842
5210
  }[];
@@ -4853,8 +5221,10 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4853
5221
  scope?: "internal" | "external" | undefined;
4854
5222
  tier?: string | undefined;
4855
5223
  payloadSchema?: EventPayloadField[] | undefined;
5224
+ eventId?: string | undefined;
4856
5225
  }[] | undefined;
4857
5226
  linkedEntity?: string | undefined;
5227
+ linkedEntityId?: string | undefined;
4858
5228
  listens?: {
4859
5229
  event: string;
4860
5230
  triggers: string;
@@ -4865,14 +5235,19 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4865
5235
  } | {
4866
5236
  trait: string;
4867
5237
  kind: "trait";
5238
+ traitId?: string | undefined;
4868
5239
  } | {
5240
+ orbital: string;
4869
5241
  trait: string;
4870
5242
  kind: "orbital";
4871
- orbital: string;
5243
+ traitId?: string | undefined;
5244
+ orbitalId?: string | undefined;
4872
5245
  } | undefined;
4873
5246
  scope?: "internal" | "external" | undefined;
4874
5247
  tier?: string | undefined;
5248
+ eventId?: string | undefined;
4875
5249
  guard?: SExpr | undefined;
5250
+ triggersId?: string | undefined;
4876
5251
  payloadMapping?: Record<string, string> | undefined;
4877
5252
  }[] | undefined;
4878
5253
  description_visual_prompt?: string | undefined;
@@ -4883,8 +5258,10 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4883
5258
  } | undefined;
4884
5259
  entityBindingDescription?: string | undefined;
4885
5260
  entityBindingSynonyms?: string | undefined;
5261
+ entityRefIds?: Record<string, string> | undefined;
5262
+ traitEmbedIds?: Record<string, string> | undefined;
4886
5263
  requiredFields?: {
4887
- type: "string" | "number" | "boolean" | "object" | "date" | "timestamp" | "datetime" | "array" | "enum";
5264
+ type: "string" | "number" | "boolean" | "object" | "date" | "array" | "timestamp" | "datetime" | "enum";
4888
5265
  name: string;
4889
5266
  description?: string | undefined;
4890
5267
  }[] | undefined;
@@ -4898,7 +5275,9 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4898
5275
  guard?: SExpr | undefined;
4899
5276
  priority?: number | undefined;
4900
5277
  appliesTo?: string[] | undefined;
5278
+ pageIds?: string[] | undefined;
4901
5279
  emits?: string[] | undefined;
5280
+ emitIds?: string[] | undefined;
4902
5281
  }[] | undefined;
4903
5282
  sourceBehavior?: {
4904
5283
  behavior: string;
@@ -4928,4 +5307,4 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
4928
5307
  } | undefined;
4929
5308
  }>]>;
4930
5309
 
4931
- export { type LogEffect as $, type AgentEffect as A, type BehaviorEffect as B, type CallSiteConfig as C, type DeclaredTraitConfig as D, type Effect as E, type EvaluateConfig as F, type EvaluateEffect as G, type Event as H, type EventInput as I, type EventPayloadField as J, EventPayloadFieldSchema as K, EventSchema as L, type EventScope as M, EventScopeSchema as N, type FetchEffect as O, type FetchOptions as P, type FetchResult as Q, type ForwardConfig as R, type State as S, type TraitEventListener as T, type ForwardEffect as U, type Guard as V, type GuardInput as W, GuardSchema as X, type ListenSource as Y, ListenSourceSchema as Z, type LlmEffect as _, type TraitReference as a, TraitDataEntitySchema as a$, type McpServiceDef as a0, McpServiceDefSchema as a1, type MemoryEffect as a2, type NavigateEffect as a3, type NnConfig as a4, type NnLayer as a5, type NotifyEffect as a6, type OrbitalTraitRef as a7, OrbitalTraitRefSchema as a8, type OsEffect as a9, ServiceRefSchema as aA, ServiceRefStringSchema as aB, type ServiceType as aC, ServiceTypeSchema as aD, type SessionEffect as aE, type SetEffect as aF, type SocketEvents as aG, SocketEventsSchema as aH, type SocketServiceDef as aI, SocketServiceDefSchema as aJ, type SpawnEffect as aK, type StateInput as aL, type StateMachine as aM, type StateMachineInput as aN, StateMachineSchema as aO, StateSchema as aP, type SwapEffect as aQ, type TraceEffect as aR, type TrainConfig as aS, type TrainEffect as aT, type TraitCategory as aU, TraitCategorySchema as aV, type TraitConfigObject as aW, TraitConfigSchema as aX, type TraitConfigValue as aY, TraitConfigValueSchema as aZ, type TraitDataEntity as a_, type PayloadField as aa, PayloadFieldSchema as ab, type PersistData as ac, type PersistEffect as ad, type PersistEmitConfig as ae, type PresentationType as af, type RefEffect as ag, type RenderBinding as ah, type RenderItemLambda as ai, type RenderUIEffect as aj, type RenderUINode as ak, type RequiredField as al, RequiredFieldSchema as am, type ResolvedPatternProps as an, type RestAuthConfig as ao, RestAuthConfigSchema as ap, type RestServiceDef as aq, RestServiceDefSchema as ar, SERVICE_TYPES as as, type ServiceDefinition as at, ServiceDefinitionSchema as au, type ServiceParams as av, type ServiceParamsValue as aw, type ServiceRef as ax, type ServiceRefObject as ay, ServiceRefObjectSchema as az, type CallSiteConfigEntry as b, type TraitEntityField as b0, TraitEntityFieldSchema as b1, type TraitEventContract as b2, TraitEventContractSchema as b3, TraitEventListenerSchema as b4, type TraitInput as b5, type TraitRef as b6, TraitRefSchema as b7, type TraitReferenceInput as b8, TraitReferenceSchema as b9, isCallSiteConfigDeclaration as bA, isCircuitEvent as bB, isEffect as bC, isInlineTrait as bD, isMcpService as bE, isRestService as bF, isSExprEffect as bG, isServiceReference as bH, isServiceReferenceObject as bI, isSocketService as bJ, navigate as bK, normalizeCallSiteConfigToValues as bL, normalizeTraitRef as bM, notify as bN, parseServiceRef as bO, persist as bP, ref as bQ, renderUI as bR, resolveConfigRefEventName as bS, set as bT, spawn as bU, swap as bV, watch as bW, type TraitScope as bX, TraitSchema as ba, type TraitTick as bb, TraitTickSchema as bc, type TraitUIBinding as bd, type Transition as be, type TransitionInput as bf, TransitionSchema as bg, type TypedEffect as bh, type UISlot as bi, UISlotSchema as bj, UI_SLOTS as bk, type ValidateEffect as bl, type WatchEffect as bm, type WatchOptions as bn, atomic as bo, callService as bp, configRefEventKnob as bq, deref as br, despawn as bs, doEffects as bt, emit as bu, findService as bv, getServiceNames as bw, getTraitConfig as bx, getTraitName as by, hasService as bz, type Trait as c, type TraitConfig as d, type ApplicationEffect as e, type AtomicEffect as f, CONFIG_REF_EVENT_PATTERN as g, type CallServiceConfig as h, type CallServiceEffect as i, type CheckpointLoadEffect as j, type CheckpointSaveEffect as k, type ComposeEffect as l, type ConfigFieldDeclaration as m, ConfigFieldDeclarationSchema as n, type ConfigFieldItemsDeclaration as o, type ConfigRefEventError as p, DeclaredTraitConfigSchema as q, type DerefEffect as r, type DespawnEffect as s, type DoEffect as t, type EffectInput as u, EffectSchema as v, type EmitConfig as w, type EmitEffect as x, type EntityFieldContract as y, EntityFieldContractSchema as z };
5310
+ export { type LogEffect as $, type AgentEffect as A, type BehaviorEffect as B, type CallSiteConfig as C, type DeclaredTraitConfig as D, type Effect as E, type EvaluateConfig as F, type EvaluateEffect as G, type Event as H, type EventInput as I, type EventPayloadField as J, EventPayloadFieldSchema as K, EventSchema as L, type EventScope as M, EventScopeSchema as N, type FetchEffect as O, type FetchOptions as P, type FetchResult as Q, type ForwardConfig as R, type State as S, type TraitEventListener as T, type ForwardEffect as U, type Guard as V, type GuardInput as W, GuardSchema as X, type ListenSource as Y, ListenSourceSchema as Z, type LlmEffect as _, type TraitReference as a, type TraitConfigValue as a$, type McpServiceDef as a0, McpServiceDefSchema as a1, type MemoryEffect as a2, type NavigateEffect as a3, type NnConfig as a4, type NnLayer as a5, type NotifyEffect as a6, type OrbitalTraitRef as a7, OrbitalTraitRefSchema as a8, type OsEffect as a9, type ServiceRef as aA, type ServiceRefObject as aB, ServiceRefObjectSchema as aC, ServiceRefSchema as aD, ServiceRefStringSchema as aE, type ServiceType as aF, ServiceTypeSchema as aG, type SessionEffect as aH, type SetEffect as aI, type SocketEvents as aJ, SocketEventsSchema as aK, type SocketServiceDef as aL, SocketServiceDefSchema as aM, type SpawnEffect as aN, type StateInput as aO, type StateMachine as aP, type StateMachineInput as aQ, StateMachineSchema as aR, StateSchema as aS, type SwapEffect as aT, type TraceEffect as aU, type TrainConfig as aV, type TrainEffect as aW, type TraitCategory as aX, TraitCategorySchema as aY, type TraitConfigObject as aZ, TraitConfigSchema as a_, type PayloadField as aa, PayloadFieldSchema as ab, type PersistData as ac, type PersistEffect as ad, type PersistEmitConfig as ae, type PresentationType as af, REFERENCE_CONFIG_TYPES as ag, type RefEffect as ah, type ReferenceConfigType as ai, type RenderBinding as aj, type RenderChildrenMap as ak, type RenderItemLambda as al, type RenderUIEffect as am, type RenderUINode as an, type RequiredField as ao, RequiredFieldSchema as ap, type ResolvedPatternProps as aq, type RestAuthConfig as ar, RestAuthConfigSchema as as, type RestServiceDef as at, RestServiceDefSchema as au, SERVICE_TYPES as av, type ServiceDefinition as aw, ServiceDefinitionSchema as ax, type ServiceParams as ay, type ServiceParamsValue as az, type CallSiteConfigEntry as b, type TraitScope as b$, TraitConfigValueSchema as b0, type TraitDataEntity as b1, TraitDataEntitySchema as b2, type TraitEntityField as b3, TraitEntityFieldSchema as b4, type TraitEventContract as b5, TraitEventContractSchema as b6, TraitEventListenerSchema as b7, type TraitInput as b8, type TraitRef as b9, getTraitConfig as bA, getTraitName as bB, hasService as bC, isCallSiteConfigDeclaration as bD, isCircuitEvent as bE, isEffect as bF, isInlineTrait as bG, isMcpService as bH, isReferenceConfigType as bI, isRestService as bJ, isSExprEffect as bK, isServiceReference as bL, isServiceReferenceObject as bM, isSocketService as bN, navigate as bO, normalizeCallSiteConfigToValues as bP, normalizeTraitRef as bQ, notify as bR, parseServiceRef as bS, persist as bT, ref as bU, renderUI as bV, resolveConfigRefEventName as bW, set as bX, spawn as bY, swap as bZ, watch as b_, TraitRefSchema as ba, type TraitReferenceInput as bb, TraitReferenceSchema as bc, TraitSchema as bd, type TraitTick as be, TraitTickSchema as bf, type TraitUIBinding as bg, type Transition as bh, type TransitionInput as bi, TransitionSchema as bj, type TypedEffect as bk, type UISlot as bl, UISlotSchema as bm, UI_SLOTS as bn, type ValidateEffect as bo, type WatchEffect as bp, type WatchOptions as bq, atomic as br, callService as bs, configRefEventKnob as bt, deref as bu, despawn as bv, doEffects as bw, emit as bx, findService as by, getServiceNames as bz, type Trait as c, type TraitConfig as d, type ApplicationEffect as e, type AtomicEffect as f, CONFIG_REF_EVENT_PATTERN as g, type CallServiceConfig as h, type CallServiceEffect as i, type CheckpointLoadEffect as j, type CheckpointSaveEffect as k, type ComposeEffect as l, type ConfigFieldDeclaration as m, ConfigFieldDeclarationSchema as n, type ConfigFieldItemsDeclaration as o, type ConfigRefEventError as p, DeclaredTraitConfigSchema as q, type DerefEffect as r, type DespawnEffect as s, type DoEffect as t, type EffectInput as u, EffectSchema as v, type EmitConfig as w, type EmitEffect as x, type EntityFieldContract as y, EntityFieldContractSchema as z };