@almadar/core 10.41.0 → 10.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { S as SExpr, a as EventPayload, E as Expression } from './expression-DpAj1RzP.js';
3
- import { F as FieldValue, b as EntityRow } from './entity-DfD-iXkn.js';
2
+ import { J as JsonValue, R as RuntimeValue, S as SExpr, a as EventPayload, E as Expression } from './expression-Yf7qvvOs.js';
4
3
 
5
4
  /**
6
5
  * Service Types for Orbital Schema
@@ -74,12 +73,12 @@ declare const RestAuthConfigSchema: z.ZodObject<{
74
73
  }, "strip", z.ZodTypeAny, {
75
74
  type: "api-key" | "bearer" | "basic" | "oauth2";
76
75
  keyName?: string | undefined;
77
- location?: "query" | "header" | undefined;
76
+ location?: "header" | "query" | undefined;
78
77
  secretEnv?: string | undefined;
79
78
  }, {
80
79
  type: "api-key" | "bearer" | "basic" | "oauth2";
81
80
  keyName?: string | undefined;
82
- location?: "query" | "header" | undefined;
81
+ location?: "header" | "query" | undefined;
83
82
  secretEnv?: string | undefined;
84
83
  }>;
85
84
  declare const RestServiceDefSchema: z.ZodObject<{
@@ -96,12 +95,12 @@ declare const RestServiceDefSchema: z.ZodObject<{
96
95
  }, "strip", z.ZodTypeAny, {
97
96
  type: "api-key" | "bearer" | "basic" | "oauth2";
98
97
  keyName?: string | undefined;
99
- location?: "query" | "header" | undefined;
98
+ location?: "header" | "query" | undefined;
100
99
  secretEnv?: string | undefined;
101
100
  }, {
102
101
  type: "api-key" | "bearer" | "basic" | "oauth2";
103
102
  keyName?: string | undefined;
104
- location?: "query" | "header" | undefined;
103
+ location?: "header" | "query" | undefined;
105
104
  secretEnv?: string | undefined;
106
105
  }>>;
107
106
  timeout: z.ZodOptional<z.ZodNumber>;
@@ -110,26 +109,26 @@ declare const RestServiceDefSchema: z.ZodObject<{
110
109
  name: string;
111
110
  baseUrl: string;
112
111
  description?: string | undefined;
113
- headers?: Record<string, string> | undefined;
114
112
  auth?: {
115
113
  type: "api-key" | "bearer" | "basic" | "oauth2";
116
114
  keyName?: string | undefined;
117
- location?: "query" | "header" | undefined;
115
+ location?: "header" | "query" | undefined;
118
116
  secretEnv?: string | undefined;
119
117
  } | undefined;
118
+ headers?: Record<string, string> | undefined;
120
119
  timeout?: number | undefined;
121
120
  }, {
122
121
  type: "rest";
123
122
  name: string;
124
123
  baseUrl: string;
125
124
  description?: string | undefined;
126
- headers?: Record<string, string> | undefined;
127
125
  auth?: {
128
126
  type: "api-key" | "bearer" | "basic" | "oauth2";
129
127
  keyName?: string | undefined;
130
- location?: "query" | "header" | undefined;
128
+ location?: "header" | "query" | undefined;
131
129
  secretEnv?: string | undefined;
132
130
  } | undefined;
131
+ headers?: Record<string, string> | undefined;
133
132
  timeout?: number | undefined;
134
133
  }>;
135
134
  /**
@@ -312,12 +311,12 @@ declare const ServiceDefinitionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
312
311
  }, "strip", z.ZodTypeAny, {
313
312
  type: "api-key" | "bearer" | "basic" | "oauth2";
314
313
  keyName?: string | undefined;
315
- location?: "query" | "header" | undefined;
314
+ location?: "header" | "query" | undefined;
316
315
  secretEnv?: string | undefined;
317
316
  }, {
318
317
  type: "api-key" | "bearer" | "basic" | "oauth2";
319
318
  keyName?: string | undefined;
320
- location?: "query" | "header" | undefined;
319
+ location?: "header" | "query" | undefined;
321
320
  secretEnv?: string | undefined;
322
321
  }>>;
323
322
  timeout: z.ZodOptional<z.ZodNumber>;
@@ -326,26 +325,26 @@ declare const ServiceDefinitionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
326
325
  name: string;
327
326
  baseUrl: string;
328
327
  description?: string | undefined;
329
- headers?: Record<string, string> | undefined;
330
328
  auth?: {
331
329
  type: "api-key" | "bearer" | "basic" | "oauth2";
332
330
  keyName?: string | undefined;
333
- location?: "query" | "header" | undefined;
331
+ location?: "header" | "query" | undefined;
334
332
  secretEnv?: string | undefined;
335
333
  } | undefined;
334
+ headers?: Record<string, string> | undefined;
336
335
  timeout?: number | undefined;
337
336
  }, {
338
337
  type: "rest";
339
338
  name: string;
340
339
  baseUrl: string;
341
340
  description?: string | undefined;
342
- headers?: Record<string, string> | undefined;
343
341
  auth?: {
344
342
  type: "api-key" | "bearer" | "basic" | "oauth2";
345
343
  keyName?: string | undefined;
346
- location?: "query" | "header" | undefined;
344
+ location?: "header" | "query" | undefined;
347
345
  secretEnv?: string | undefined;
348
346
  } | undefined;
347
+ headers?: Record<string, string> | undefined;
349
348
  timeout?: number | undefined;
350
349
  }>, z.ZodObject<{
351
350
  name: z.ZodString;
@@ -527,12 +526,12 @@ declare const ServiceRefSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.Z
527
526
  }, "strip", z.ZodTypeAny, {
528
527
  type: "api-key" | "bearer" | "basic" | "oauth2";
529
528
  keyName?: string | undefined;
530
- location?: "query" | "header" | undefined;
529
+ location?: "header" | "query" | undefined;
531
530
  secretEnv?: string | undefined;
532
531
  }, {
533
532
  type: "api-key" | "bearer" | "basic" | "oauth2";
534
533
  keyName?: string | undefined;
535
- location?: "query" | "header" | undefined;
534
+ location?: "header" | "query" | undefined;
536
535
  secretEnv?: string | undefined;
537
536
  }>>;
538
537
  timeout: z.ZodOptional<z.ZodNumber>;
@@ -541,26 +540,26 @@ declare const ServiceRefSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.Z
541
540
  name: string;
542
541
  baseUrl: string;
543
542
  description?: string | undefined;
544
- headers?: Record<string, string> | undefined;
545
543
  auth?: {
546
544
  type: "api-key" | "bearer" | "basic" | "oauth2";
547
545
  keyName?: string | undefined;
548
- location?: "query" | "header" | undefined;
546
+ location?: "header" | "query" | undefined;
549
547
  secretEnv?: string | undefined;
550
548
  } | undefined;
549
+ headers?: Record<string, string> | undefined;
551
550
  timeout?: number | undefined;
552
551
  }, {
553
552
  type: "rest";
554
553
  name: string;
555
554
  baseUrl: string;
556
555
  description?: string | undefined;
557
- headers?: Record<string, string> | undefined;
558
556
  auth?: {
559
557
  type: "api-key" | "bearer" | "basic" | "oauth2";
560
558
  keyName?: string | undefined;
561
- location?: "query" | "header" | undefined;
559
+ location?: "header" | "query" | undefined;
562
560
  secretEnv?: string | undefined;
563
561
  } | undefined;
562
+ headers?: Record<string, string> | undefined;
564
563
  timeout?: number | undefined;
565
564
  }>, z.ZodObject<{
566
565
  name: z.ZodString;
@@ -746,13 +745,1517 @@ type ServiceParams = {
746
745
  [key: string]: ServiceParamsValue;
747
746
  };
748
747
 
748
+ /**
749
+ * Identity model (Almadar Rabit V4, Phase 1 — types only).
750
+ *
751
+ * Branded, prefix-tagged node ids + a workspace-scoped name ledger. Ids are
752
+ * the durable edge keys of the identity-keyed schema graph; the ledger is the
753
+ * sole name↔id map (names are display labels, one row per rename). This module
754
+ * is pure: no I/O, no side effects. Minting is the only impurity (clock +
755
+ * crypto randomness for the ULID suffix).
756
+ *
757
+ * @packageDocumentation
758
+ */
759
+
760
+ type Branded<K extends string> = string & {
761
+ readonly __idBrand: K;
762
+ };
763
+ type OrbitalId = Branded<'OrbitalId'>;
764
+ type EntityId = Branded<'EntityId'>;
765
+ type TraitId = Branded<'TraitId'>;
766
+ type EventId = Branded<'EventId'>;
767
+ type PageId = Branded<'PageId'>;
768
+ type ServiceId = Branded<'ServiceId'>;
769
+ type ThemeId = Branded<'ThemeId'>;
770
+ type PaletteEntryId = Branded<'PaletteEntryId'>;
771
+ /** Node kind ↔ id-prefix table. The single source of truth for every prefix. */
772
+ declare const ID_PREFIXES: {
773
+ readonly orbital: "orb_";
774
+ readonly entity: "ent_";
775
+ readonly trait: "trt_";
776
+ readonly event: "evt_";
777
+ readonly page: "pag_";
778
+ readonly service: "svc_";
779
+ readonly theme: "thm_";
780
+ readonly palette: "pal_";
781
+ };
782
+ type IdKind = keyof typeof ID_PREFIXES;
783
+ /** Compile-time map from kind to its branded id type. */
784
+ interface IdForKind {
785
+ orbital: OrbitalId;
786
+ entity: EntityId;
787
+ trait: TraitId;
788
+ event: EventId;
789
+ page: PageId;
790
+ service: ServiceId;
791
+ theme: ThemeId;
792
+ palette: PaletteEntryId;
793
+ }
794
+ declare const isOrbitalId: (value: string) => value is OrbitalId;
795
+ declare const asOrbitalId: (value: string) => OrbitalId;
796
+ declare const isEntityId: (value: string) => value is EntityId;
797
+ declare const asEntityId: (value: string) => EntityId;
798
+ declare const isTraitId: (value: string) => value is TraitId;
799
+ declare const asTraitId: (value: string) => TraitId;
800
+ declare const isEventId: (value: string) => value is EventId;
801
+ declare const asEventId: (value: string) => EventId;
802
+ declare const isPageId: (value: string) => value is PageId;
803
+ declare const asPageId: (value: string) => PageId;
804
+ declare const isServiceId: (value: string) => value is ServiceId;
805
+ declare const asServiceId: (value: string) => ServiceId;
806
+ declare const isThemeId: (value: string) => value is ThemeId;
807
+ declare const asThemeId: (value: string) => ThemeId;
808
+ declare const isPaletteEntryId: (value: string) => value is PaletteEntryId;
809
+ declare const asPaletteEntryId: (value: string) => PaletteEntryId;
810
+ /**
811
+ * The id-prefix for a node kind (`'entity' → 'ent_'`). The JS mirror of the
812
+ * Rust `IdKind::prefix`. Single source of truth is {@link ID_PREFIXES}.
813
+ */
814
+ declare function idPrefix(kind: IdKind): string;
815
+ /**
816
+ * The node kind an id's prefix denotes, or `null` for an unrecognized /
817
+ * bare-prefix string. The JS mirror of the Rust `id_kind_of`. Prefixes are
818
+ * mutually non-overlapping, so match order is irrelevant.
819
+ */
820
+ declare function idKindOf(id: string): IdKind | null;
821
+ /** Mint a fresh, opaque, kind-tagged id: `<prefix><ULID>`. */
822
+ declare function mintId<K extends IdKind>(kind: K): IdForKind[K];
823
+ /** Ledger row kind. `palette` entries are manifest ids, not name-ledger rows. */
824
+ type LedgerKind = 'orbital' | 'entity' | 'trait' | 'event' | 'page' | 'service' | 'theme';
825
+ /**
826
+ * One ledger row: the workspace's name history for a single node id.
827
+ *
828
+ * For kind `'event'` the row is minted per-(trait, declared event) per the
829
+ * Phase-0 freeze — the owning trait is recorded in `parent`; a call-site event
830
+ * rename is a one-row edit on this same id (the baked-vs-current key namespaces
831
+ * collapse into `bakedName` vs `curName`).
832
+ */
833
+ interface LedgerEntry {
834
+ id: string;
835
+ kind: LedgerKind;
836
+ bakedName: string;
837
+ curName: string;
838
+ renames: ReadonlyArray<{
839
+ from: string;
840
+ to: string;
841
+ at: string;
842
+ }>;
843
+ owner: 'std' | 'io' | 'workspace';
844
+ /** Owning trait for kind `'event'` (per-trait event-id namespace). */
845
+ parent?: TraitId;
846
+ }
847
+ interface IdentityLedger {
848
+ schemaVersion: 1;
849
+ entries: Record<string, LedgerEntry>;
850
+ }
851
+ /** Resolve a name to its id via exact `curName` match within `kind`, else null. */
852
+ declare function ledgerResolveName(ledger: IdentityLedger, kind: LedgerKind, name: string): string | null;
853
+ /** Immutable rename: returns a new ledger with the id's `curName` + `renames` updated. */
854
+ declare function ledgerRename(ledger: IdentityLedger, id: string, to: string, at: string): IdentityLedger;
855
+ /** Current display name for an id, or null when the id is not in the ledger. */
856
+ declare function ledgerCurName(ledger: IdentityLedger, id: string): string | null;
857
+ /**
858
+ * Prefix-checked, kind-tagged id schemas. Each narrows a validated string to
859
+ * its branded id type via the module's own kind guard, so a schema that reads
860
+ * `TraitIdSchema.optional()` yields `TraitId | undefined` with no cast. The
861
+ * guard is the single source of prefix truth (`ID_PREFIXES`); the schema is a
862
+ * thin zod wrapper over it.
863
+ */
864
+ declare const OrbitalIdSchema: z.ZodEffects<z.ZodString, OrbitalId, string>;
865
+ declare const EntityIdSchema: z.ZodEffects<z.ZodString, EntityId, string>;
866
+ declare const TraitIdSchema: z.ZodEffects<z.ZodString, TraitId, string>;
867
+ declare const EventIdSchema: z.ZodEffects<z.ZodString, EventId, string>;
868
+ declare const PageIdSchema: z.ZodEffects<z.ZodString, PageId, string>;
869
+ declare const ServiceIdSchema: z.ZodEffects<z.ZodString, ServiceId, string>;
870
+ declare const ThemeIdSchema: z.ZodEffects<z.ZodString, ThemeId, string>;
871
+ declare const PaletteEntryIdSchema: z.ZodEffects<z.ZodString, PaletteEntryId, string>;
872
+ declare const LedgerKindSchema: z.ZodEnum<["orbital", "entity", "trait", "event", "page", "service", "theme"]>;
873
+ declare const LedgerEntrySchema: z.ZodObject<{
874
+ id: z.ZodString;
875
+ kind: z.ZodEnum<["orbital", "entity", "trait", "event", "page", "service", "theme"]>;
876
+ bakedName: z.ZodString;
877
+ curName: z.ZodString;
878
+ renames: z.ZodArray<z.ZodObject<{
879
+ from: z.ZodString;
880
+ to: z.ZodString;
881
+ at: z.ZodString;
882
+ }, "strip", z.ZodTypeAny, {
883
+ at: string;
884
+ from: string;
885
+ to: string;
886
+ }, {
887
+ at: string;
888
+ from: string;
889
+ to: string;
890
+ }>, "many">;
891
+ owner: z.ZodEnum<["std", "io", "workspace"]>;
892
+ parent: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
893
+ }, "strip", z.ZodTypeAny, {
894
+ id: string;
895
+ kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
896
+ bakedName: string;
897
+ curName: string;
898
+ renames: {
899
+ at: string;
900
+ from: string;
901
+ to: string;
902
+ }[];
903
+ owner: "std" | "io" | "workspace";
904
+ parent?: TraitId | undefined;
905
+ }, {
906
+ id: string;
907
+ kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
908
+ bakedName: string;
909
+ curName: string;
910
+ renames: {
911
+ at: string;
912
+ from: string;
913
+ to: string;
914
+ }[];
915
+ owner: "std" | "io" | "workspace";
916
+ parent?: string | undefined;
917
+ }>;
918
+ declare const IdentityLedgerSchema: z.ZodObject<{
919
+ schemaVersion: z.ZodLiteral<1>;
920
+ entries: z.ZodRecord<z.ZodString, z.ZodObject<{
921
+ id: z.ZodString;
922
+ kind: z.ZodEnum<["orbital", "entity", "trait", "event", "page", "service", "theme"]>;
923
+ bakedName: z.ZodString;
924
+ curName: z.ZodString;
925
+ renames: z.ZodArray<z.ZodObject<{
926
+ from: z.ZodString;
927
+ to: z.ZodString;
928
+ at: z.ZodString;
929
+ }, "strip", z.ZodTypeAny, {
930
+ at: string;
931
+ from: string;
932
+ to: string;
933
+ }, {
934
+ at: string;
935
+ from: string;
936
+ to: string;
937
+ }>, "many">;
938
+ owner: z.ZodEnum<["std", "io", "workspace"]>;
939
+ parent: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
940
+ }, "strip", z.ZodTypeAny, {
941
+ id: string;
942
+ kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
943
+ bakedName: string;
944
+ curName: string;
945
+ renames: {
946
+ at: string;
947
+ from: string;
948
+ to: string;
949
+ }[];
950
+ owner: "std" | "io" | "workspace";
951
+ parent?: TraitId | undefined;
952
+ }, {
953
+ id: string;
954
+ kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
955
+ bakedName: string;
956
+ curName: string;
957
+ renames: {
958
+ at: string;
959
+ from: string;
960
+ to: string;
961
+ }[];
962
+ owner: "std" | "io" | "workspace";
963
+ parent?: string | undefined;
964
+ }>>;
965
+ }, "strip", z.ZodTypeAny, {
966
+ entries: Record<string, {
967
+ id: string;
968
+ kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
969
+ bakedName: string;
970
+ curName: string;
971
+ renames: {
972
+ at: string;
973
+ from: string;
974
+ to: string;
975
+ }[];
976
+ owner: "std" | "io" | "workspace";
977
+ parent?: TraitId | undefined;
978
+ }>;
979
+ schemaVersion: 1;
980
+ }, {
981
+ entries: Record<string, {
982
+ id: string;
983
+ kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
984
+ bakedName: string;
985
+ curName: string;
986
+ renames: {
987
+ at: string;
988
+ from: string;
989
+ to: string;
990
+ }[];
991
+ owner: "std" | "io" | "workspace";
992
+ parent?: string | undefined;
993
+ }>;
994
+ schemaVersion: 1;
995
+ }>;
996
+
997
+ /**
998
+ * Field Types for Orbital Units
999
+ *
1000
+ * Extracted from schema/data-entities.ts for the orbitals module.
1001
+ * These types define the field structure within orbital entities.
1002
+ *
1003
+ * @packageDocumentation
1004
+ */
1005
+
1006
+ /**
1007
+ * Supported field types for entity fields.
1008
+ *
1009
+ * @example
1010
+ * { name: 'status', type: 'enum', values: ['draft', 'published'] }
1011
+ * { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
1012
+ */
1013
+ type FieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'email' | 'url' | 'phone' | 'uuid' | 'image' | 'array' | 'object' | 'enum' | 'relation' | 'trait' | 'slot' | 'pattern';
1014
+ /** Every `FieldType`, as a runtime array. Downstream imports this instead of
1015
+ * re-listing the union — five copies had already drifted apart. */
1016
+ declare const FIELD_TYPES: readonly ["string", "number", "boolean", "date", "timestamp", "datetime", "email", "url", "phone", "uuid", "image", "array", "object", "enum", "relation", "trait", "slot", "pattern"];
1017
+ /** The semantic string domains — constrained strings, validatable by value. */
1018
+ declare const SEMANTIC_STRING_TYPES: readonly ["email", "url", "phone", "uuid", "image"];
1019
+ type SemanticStringType = (typeof SEMANTIC_STRING_TYPES)[number];
1020
+ /** Is this a semantic string domain (as opposed to a bare `string`)? */
1021
+ declare function isSemanticStringType(type: FieldType): type is SemanticStringType;
1022
+ declare const FieldTypeSchema: z.ZodEnum<["string", "number", "boolean", "date", "timestamp", "datetime", "email", "url", "phone", "uuid", "image", "array", "object", "enum", "relation", "trait", "slot", "pattern"]>;
1023
+ /**
1024
+ * Cardinality for relation fields.
1025
+ * Matches Rust compiler's Cardinality enum.
1026
+ */
1027
+ type RelationCardinality = 'one' | 'many' | 'one-to-many' | 'many-to-one' | 'many-to-many';
1028
+ /**
1029
+ * Configuration for relation fields (foreign keys).
1030
+ * Matches Rust compiler's RelationDefinition format.
1031
+ */
1032
+ type RelationConfig = {
1033
+ /** Target entity name (e.g., 'User', 'Task') - matches Rust's `entity` field */
1034
+ entity: string;
1035
+ /** V4 dual-carry id sibling of `entity` — optional until the Phase-7 flip. */
1036
+ entityId?: EntityId;
1037
+ /** Field on target entity (defaults to 'id') */
1038
+ field?: string;
1039
+ /**
1040
+ * Cardinality: one, many, one-to-many, many-to-one, many-to-many
1041
+ * Matches Rust compiler's cardinality format
1042
+ */
1043
+ cardinality?: RelationCardinality;
1044
+ /** Delete behavior */
1045
+ onDelete?: 'cascade' | 'nullify' | 'restrict';
1046
+ /**
1047
+ * Foreign key field name (for legacy compatibility).
1048
+ * @deprecated Use field instead
1049
+ */
1050
+ foreignKey?: string;
1051
+ /**
1052
+ * Target entity name (for legacy compatibility).
1053
+ * @deprecated Use entity instead
1054
+ */
1055
+ target?: string;
1056
+ /**
1057
+ * Cardinality type alias (for legacy compatibility).
1058
+ * @deprecated Use cardinality instead
1059
+ */
1060
+ type?: RelationCardinality;
1061
+ };
1062
+ declare const RelationConfigSchema: z.ZodEffects<z.ZodObject<{
1063
+ entity: z.ZodString;
1064
+ entityId: z.ZodOptional<z.ZodEffects<z.ZodString, EntityId, string>>;
1065
+ field: z.ZodOptional<z.ZodString>;
1066
+ cardinality: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
1067
+ onDelete: z.ZodOptional<z.ZodEnum<["cascade", "nullify", "restrict"]>>;
1068
+ foreignKey: z.ZodOptional<z.ZodString>;
1069
+ target: z.ZodOptional<z.ZodString>;
1070
+ type: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
1071
+ }, "strip", z.ZodTypeAny, {
1072
+ entity: string;
1073
+ type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
1074
+ entityId?: EntityId | undefined;
1075
+ field?: string | undefined;
1076
+ cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
1077
+ onDelete?: "cascade" | "nullify" | "restrict" | undefined;
1078
+ foreignKey?: string | undefined;
1079
+ target?: string | undefined;
1080
+ }, {
1081
+ entity: string;
1082
+ type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
1083
+ entityId?: string | undefined;
1084
+ field?: string | undefined;
1085
+ cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
1086
+ onDelete?: "cascade" | "nullify" | "restrict" | undefined;
1087
+ foreignKey?: string | undefined;
1088
+ target?: string | undefined;
1089
+ }>, RelationConfig, {
1090
+ entity: string;
1091
+ type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
1092
+ entityId?: string | undefined;
1093
+ field?: string | undefined;
1094
+ cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
1095
+ onDelete?: "cascade" | "nullify" | "restrict" | undefined;
1096
+ foreignKey?: string | undefined;
1097
+ target?: string | undefined;
1098
+ }>;
1099
+ declare function isEmailValue(value: string): boolean;
1100
+ declare function isUrlValue(value: string): boolean;
1101
+ declare function isPhoneValue(value: string): boolean;
1102
+ declare function isUuidValue(value: string): boolean;
1103
+ /** Does `value` satisfy the declared semantic domain? `image` is a URL. */
1104
+ declare function isSemanticStringValue(type: SemanticStringType, value: string): boolean;
1105
+ /**
1106
+ * Field-type tags that don't carry a type-dependent payload. The base
1107
+ * `EntityField` shape applies as-is.
1108
+ */
1109
+ type ScalarFieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'email' | 'url' | 'phone' | 'uuid' | 'image' | 'trait' | 'slot' | 'pattern';
1110
+ /** Fields shared across every variant. */
1111
+ type EntityFieldBase = {
1112
+ /**
1113
+ * Field name (camelCase). Optional for nested item/property descriptors
1114
+ * where the name is implied by the parent (`items`, `properties[k]`).
1115
+ * Mirrors Rust's `FieldDefinition.name: Option<String>`.
1116
+ */
1117
+ name?: string;
1118
+ /** Whether the field is required */
1119
+ required?: boolean;
1120
+ /** Default value — parsed from `.orb`, always JSON-shaped. */
1121
+ default?: JsonValue;
1122
+ /** Minimum value (for number) or length (for string) */
1123
+ min?: number;
1124
+ /** Maximum value or length */
1125
+ max?: number;
1126
+ /** Object property schemas keyed by property name (for object type).
1127
+ * Mirrors Rust's `FieldDefinition.properties: Option<HashMap<String,
1128
+ * FieldDefinition>>`. Populated by the lolo lowerer when a field /
1129
+ * config slot's type expression resolves to a struct shape
1130
+ * (`TypeExpr::Object`), including named-type aliases like `[MetricSpec]`. */
1131
+ properties?: Record<string, EntityField>;
1132
+ /** Runtime-managed widget state (authored `@intrinsic` in `.lolo`). Exempt
1133
+ * from the explicit-binding rule and never a domain-data bind target. */
1134
+ intrinsic?: boolean;
1135
+ /** Human/semantic description (authored `@description "..."` in `.lolo`).
1136
+ * Authoring/build-time metadata — factory-signature catalog, embeddings,
1137
+ * curation field-matching; the runtime ignores it. */
1138
+ description?: string;
1139
+ /** User-vocabulary synonyms (authored `@synonyms "..."` in `.lolo`).
1140
+ * Free text feeding catalog search / curation field-matching. */
1141
+ synonyms?: string;
1142
+ };
1143
+ /**
1144
+ * Scalar / structural fields — no type-dependent payload required.
1145
+ * `values?` is permitted as an OPTIONAL UI/validation hint (e.g. lolo's
1146
+ * `'a' | 'b' | 'c'` string-union sugar lowers to `type: 'string', values:
1147
+ * [...]`). Only `EnumEntityField` MANDATES values.
1148
+ */
1149
+ type ScalarEntityField = EntityFieldBase & {
1150
+ type: ScalarFieldType;
1151
+ /** Optional vocabulary hint for scalar fields (e.g. string unions
1152
+ * authored as `'a'|'b'|'c'` in lolo). Not required at this variant. */
1153
+ values?: string[];
1154
+ };
1155
+ /** `type: 'enum'` REQUIRES the closed vocabulary in `values`. */
1156
+ type EnumEntityField = EntityFieldBase & {
1157
+ type: 'enum';
1158
+ /** Closed string vocabulary the field accepts. */
1159
+ values: string[];
1160
+ };
1161
+ /** `type: 'relation'` REQUIRES the relation target binding. */
1162
+ type RelationEntityField = EntityFieldBase & {
1163
+ type: 'relation';
1164
+ /** Relation target binding (entity + cardinality). */
1165
+ relation: RelationConfig;
1166
+ };
1167
+ /** `type: 'array'` — element schema in `items` strongly preferred but
1168
+ * optional for legacy compatibility with codegen-emitted scalar-array
1169
+ * fields (e.g. `{type: 'array', default: []}`). The lolo lowerer + Rust
1170
+ * validator catch typed-element-required cases downstream. */
1171
+ type ArrayEntityField = EntityFieldBase & {
1172
+ type: 'array';
1173
+ /** Element schema for the array. */
1174
+ items?: EntityField;
1175
+ };
1176
+ /**
1177
+ * `type: 'object'` — a fixed-key struct (fields in `properties`) OR a
1178
+ * dynamic-key map (`Map K V` in `.lolo`; the uniform value schema lives in
1179
+ * `items`, mirroring an array's element schema). A distinct variant so `items`
1180
+ * is statically allowed only on object/array fields, never on scalars.
1181
+ */
1182
+ type ObjectEntityField = EntityFieldBase & {
1183
+ type: 'object';
1184
+ /** Uniform value schema for a dynamic-key map (`Map K V`). */
1185
+ items?: EntityField;
1186
+ };
1187
+ /**
1188
+ * Entity field definition — discriminated union by `type`. Each variant
1189
+ * statically enforces its dependent payload (`values` for enum,
1190
+ * `relation` for relation, `items` for array) so TS / Zod / JSON Schema
1191
+ * consumers all agree on the dependency, not just the Rust validator.
1192
+ *
1193
+ * @example
1194
+ * { name: 'status', type: 'enum', values: ['draft', 'published'] }
1195
+ * { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
1196
+ * { name: 'tags', type: 'array', items: { type: 'string' } }
1197
+ */
1198
+ type EntityField = ScalarEntityField | EnumEntityField | RelationEntityField | ArrayEntityField | ObjectEntityField;
1199
+ /**
1200
+ * Zod schema for `EntityField`. Preprocess normalizes:
1201
+ * - legacy `type` aliases (text → string, int → number, etc.)
1202
+ * - legacy `enum: string[]` alias → `values: string[]`
1203
+ *
1204
+ * Branches on `type` so TS narrows the parsed output to the matching
1205
+ * discriminated-union variant.
1206
+ */
1207
+ declare const EntityFieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
1208
+ type EntityFieldInput = z.input<typeof EntityFieldSchema>;
1209
+ /** Alias for EntityField - preferred name */
1210
+ type Field = EntityField;
1211
+ /** Alias for EntityFieldSchema - preferred name */
1212
+ declare const FieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
1213
+
1214
+ /**
1215
+ * Asset Types for Semantic Asset References
1216
+ *
1217
+ * Defines types for abstracting asset paths into semantic references.
1218
+ * Assets are resolved from SemanticAssetRef to actual paths at compile time.
1219
+ *
1220
+ * @packageDocumentation
1221
+ */
1222
+
1223
+ /**
1224
+ * Entity roles in game contexts
1225
+ */
1226
+ declare const ENTITY_ROLES: readonly ["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"];
1227
+ type EntityRole = (typeof ENTITY_ROLES)[number];
1228
+ declare const EntityRoleSchema: z.ZodEnum<["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"]>;
1229
+ /**
1230
+ * Visual art styles for games
1231
+ */
1232
+ declare const VISUAL_STYLES: readonly ["pixel", "vector", "hd", "1-bit", "isometric"];
1233
+ type VisualStyle = (typeof VISUAL_STYLES)[number];
1234
+ declare const VisualStyleSchema: z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>;
1235
+ /**
1236
+ * Whether the asset is a 2D sprite/image or a 3D model. Set by the consuming
1237
+ * canvas: the same entity role is a 2D sprite-sheet on a tile board and a 3D
1238
+ * rigged model on a 3D board.
1239
+ */
1240
+ declare const ASSET_DIMENSIONS: readonly ["2d", "3d"];
1241
+ type AssetDimension = (typeof ASSET_DIMENSIONS)[number];
1242
+ declare const AssetDimensionSchema: z.ZodEnum<["2d", "3d"]>;
1243
+ /**
1244
+ * Rendering aspect ratio of an asset: square (tiles/sprites/portraits/icons),
1245
+ * 16:9 (scene backdrops), 5:7 (cards), 8:1 (effect frame strips).
1246
+ */
1247
+ declare const ASSET_ASPECTS: readonly ["1:1", "16:9", "5:7", "8:1"];
1248
+ type AssetAspect = (typeof ASSET_ASPECTS)[number];
1249
+ declare const AssetAspectSchema: z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>;
1250
+ /**
1251
+ * Animation names matching a sprite sheet's row layout. Canonical home for
1252
+ * this vocabulary — `@almadar/ui`'s `spriteAnimationTypes.ts` re-exports it
1253
+ * rather than redeclaring, so board `.lolo` config and the render library
1254
+ * agree on one enum.
1255
+ */
1256
+ declare const ANIMATION_NAMES: readonly ["idle", "walk", "attack", "hit", "death"];
1257
+ type AnimationName = (typeof ANIMATION_NAMES)[number];
1258
+ declare const AnimationNameSchema: z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>;
1259
+ /** Sheet file directions (physical PNG files a sprite sheet ships as). */
1260
+ declare const SPRITE_DIRECTIONS: readonly ["se", "sw"];
1261
+ type SpriteDirection = (typeof SPRITE_DIRECTIONS)[number];
1262
+ declare const SpriteDirectionSchema: z.ZodEnum<["se", "sw"]>;
1263
+ /**
1264
+ * Definition for a single named animation within a sprite sheet: which row
1265
+ * it occupies, how many frames it has, and its playback rate. This is the
1266
+ * shape actually consumed by `@almadar/ui`'s sprite-sheet renderer
1267
+ * (`spriteAnimation.ts`'s `frameRect`/`getCurrentFrameFromDef`) — moved here
1268
+ * verbatim rather than reconciled with a differently-shaped guess, since
1269
+ * `@almadar/ui`'s version is the one with real production consumers.
1270
+ */
1271
+ interface AnimationDef {
1272
+ /** Row index in the sprite sheet (0-based; each animation occupies one row). */
1273
+ row: number;
1274
+ /** Number of frames in this animation. */
1275
+ frames: number;
1276
+ /** Frames per second. */
1277
+ frameRate: number;
1278
+ /** Whether the animation loops. */
1279
+ loop: boolean;
1280
+ }
1281
+ declare const AnimationDefSchema: z.ZodObject<{
1282
+ row: z.ZodNumber;
1283
+ frames: z.ZodNumber;
1284
+ frameRate: z.ZodNumber;
1285
+ loop: z.ZodBoolean;
1286
+ }, "strip", z.ZodTypeAny, {
1287
+ row: number;
1288
+ frames: number;
1289
+ frameRate: number;
1290
+ loop: boolean;
1291
+ }, {
1292
+ row: number;
1293
+ frames: number;
1294
+ frameRate: number;
1295
+ loop: boolean;
1296
+ }>;
1297
+ /**
1298
+ * Parsed sprite-sheet atlas JSON — the contract a `spriteSheet`-role `Asset.url`
1299
+ * resolves to when fetched (see `Asset.url` usage in `@almadar/ui`'s
1300
+ * `useUnitSpriteAtlas`). A unit's `sprite?: Asset` stays the static single-pose
1301
+ * image; `spriteSheet?: Asset` is a SEPARATE reference whose URL points at a
1302
+ * `SpriteSheetAtlas`-shaped JSON manifest (e.g. `.../guardian-sprite-sheet.json`),
1303
+ * not a PNG. Frame-cutting geometry lives here, not inlined onto `Asset` — an
1304
+ * `Asset` traveling through `render-ui` every tick stays small.
1305
+ */
1306
+ interface SpriteSheetAtlas {
1307
+ /** Unit archetype key. */
1308
+ unit?: string;
1309
+ /** Visual type key. */
1310
+ type?: string;
1311
+ /** Width of a single frame in pixels. */
1312
+ frameWidth: number;
1313
+ /** Height of a single frame in pixels. */
1314
+ frameHeight: number;
1315
+ /** Number of columns (frames per row). */
1316
+ columns: number;
1317
+ /** Number of rows (animations). */
1318
+ rows: number;
1319
+ /** Directions present as physical PNG files. */
1320
+ directions: SpriteDirection[];
1321
+ /** Relative PNG sheet paths per direction. */
1322
+ sheets: Partial<Record<SpriteDirection, string>>;
1323
+ /** Animation row layout keyed by animation name. */
1324
+ animations: Partial<Record<AnimationName, AnimationDef>>;
1325
+ }
1326
+ declare const SpriteSheetAtlasSchema: z.ZodObject<{
1327
+ unit: z.ZodOptional<z.ZodString>;
1328
+ type: z.ZodOptional<z.ZodString>;
1329
+ frameWidth: z.ZodNumber;
1330
+ frameHeight: z.ZodNumber;
1331
+ columns: z.ZodNumber;
1332
+ rows: z.ZodNumber;
1333
+ directions: z.ZodArray<z.ZodEnum<["se", "sw"]>, "many">;
1334
+ sheets: z.ZodRecord<z.ZodEnum<["se", "sw"]>, z.ZodString>;
1335
+ animations: z.ZodRecord<z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>, z.ZodObject<{
1336
+ row: z.ZodNumber;
1337
+ frames: z.ZodNumber;
1338
+ frameRate: z.ZodNumber;
1339
+ loop: z.ZodBoolean;
1340
+ }, "strip", z.ZodTypeAny, {
1341
+ row: number;
1342
+ frames: number;
1343
+ frameRate: number;
1344
+ loop: boolean;
1345
+ }, {
1346
+ row: number;
1347
+ frames: number;
1348
+ frameRate: number;
1349
+ loop: boolean;
1350
+ }>>;
1351
+ }, "strip", z.ZodTypeAny, {
1352
+ frameWidth: number;
1353
+ frameHeight: number;
1354
+ columns: number;
1355
+ rows: number;
1356
+ directions: ("se" | "sw")[];
1357
+ sheets: Partial<Record<"se" | "sw", string>>;
1358
+ animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
1359
+ row: number;
1360
+ frames: number;
1361
+ frameRate: number;
1362
+ loop: boolean;
1363
+ }>>;
1364
+ type?: string | undefined;
1365
+ unit?: string | undefined;
1366
+ }, {
1367
+ frameWidth: number;
1368
+ frameHeight: number;
1369
+ columns: number;
1370
+ rows: number;
1371
+ directions: ("se" | "sw")[];
1372
+ sheets: Partial<Record<"se" | "sw", string>>;
1373
+ animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
1374
+ row: number;
1375
+ frames: number;
1376
+ frameRate: number;
1377
+ loop: boolean;
1378
+ }>>;
1379
+ type?: string | undefined;
1380
+ unit?: string | undefined;
1381
+ }>;
1382
+ /**
1383
+ * One named sub-rectangle inside a packed sheet. Mirrors the ShoeBox /
1384
+ * TexturePacker `<SubTexture>` element every Kenney `Spritesheet/*.xml` ships
1385
+ * (`x`/`y`/`width`/`height` = the rect in the sheet PNG; `frameX`/`frameY`/
1386
+ * `frameWidth`/`frameHeight` = the trim/pad offsets for sprites packed with
1387
+ * transparent edges removed — optional, present only on trimmed atlases).
1388
+ */
1389
+ interface SubTexture {
1390
+ x: number;
1391
+ y: number;
1392
+ width: number;
1393
+ height: number;
1394
+ frameX?: number;
1395
+ frameY?: number;
1396
+ frameWidth?: number;
1397
+ frameHeight?: number;
1398
+ }
1399
+ declare const SubTextureSchema: z.ZodObject<{
1400
+ x: z.ZodNumber;
1401
+ y: z.ZodNumber;
1402
+ width: z.ZodNumber;
1403
+ height: z.ZodNumber;
1404
+ frameX: z.ZodOptional<z.ZodNumber>;
1405
+ frameY: z.ZodOptional<z.ZodNumber>;
1406
+ frameWidth: z.ZodOptional<z.ZodNumber>;
1407
+ frameHeight: z.ZodOptional<z.ZodNumber>;
1408
+ }, "strip", z.ZodTypeAny, {
1409
+ x: number;
1410
+ y: number;
1411
+ width: number;
1412
+ height: number;
1413
+ frameWidth?: number | undefined;
1414
+ frameHeight?: number | undefined;
1415
+ frameX?: number | undefined;
1416
+ frameY?: number | undefined;
1417
+ }, {
1418
+ x: number;
1419
+ y: number;
1420
+ width: number;
1421
+ height: number;
1422
+ frameWidth?: number | undefined;
1423
+ frameHeight?: number | undefined;
1424
+ frameX?: number | undefined;
1425
+ frameY?: number | undefined;
1426
+ }>;
1427
+ /**
1428
+ * A packed sheet + its named sub-rectangles — the canonical parse target for a
1429
+ * Kenney `Spritesheet/*.xml` atlas. A STATIC tile/prop/UI Asset references one
1430
+ * of these: `{ url: <sheet.png>, atlas: <this.json>, sprite: "grass.png" }` →
1431
+ * the renderer fetches the sheet + atlas ONCE and blits the named sub-rect,
1432
+ * instead of loading N individual PNGs. (Animated actors use `SpriteSheetAtlas`
1433
+ * instead; a uniform-grid tile page uses `Tilesheet`.)
1434
+ */
1435
+ interface TextureAtlas {
1436
+ /** Relative path to the sheet PNG the sub-rects index into (the atlas's own `imagePath`). */
1437
+ imagePath: string;
1438
+ /** Sub-rectangles keyed by their atlas name (e.g. `"grass.png"`). */
1439
+ subTextures: Record<string, SubTexture>;
1440
+ }
1441
+ declare const TextureAtlasSchema: z.ZodObject<{
1442
+ imagePath: z.ZodString;
1443
+ subTextures: z.ZodRecord<z.ZodString, z.ZodObject<{
1444
+ x: z.ZodNumber;
1445
+ y: z.ZodNumber;
1446
+ width: z.ZodNumber;
1447
+ height: z.ZodNumber;
1448
+ frameX: z.ZodOptional<z.ZodNumber>;
1449
+ frameY: z.ZodOptional<z.ZodNumber>;
1450
+ frameWidth: z.ZodOptional<z.ZodNumber>;
1451
+ frameHeight: z.ZodOptional<z.ZodNumber>;
1452
+ }, "strip", z.ZodTypeAny, {
1453
+ x: number;
1454
+ y: number;
1455
+ width: number;
1456
+ height: number;
1457
+ frameWidth?: number | undefined;
1458
+ frameHeight?: number | undefined;
1459
+ frameX?: number | undefined;
1460
+ frameY?: number | undefined;
1461
+ }, {
1462
+ x: number;
1463
+ y: number;
1464
+ width: number;
1465
+ height: number;
1466
+ frameWidth?: number | undefined;
1467
+ frameHeight?: number | undefined;
1468
+ frameX?: number | undefined;
1469
+ frameY?: number | undefined;
1470
+ }>>;
1471
+ }, "strip", z.ZodTypeAny, {
1472
+ imagePath: string;
1473
+ subTextures: Record<string, {
1474
+ x: number;
1475
+ y: number;
1476
+ width: number;
1477
+ height: number;
1478
+ frameWidth?: number | undefined;
1479
+ frameHeight?: number | undefined;
1480
+ frameX?: number | undefined;
1481
+ frameY?: number | undefined;
1482
+ }>;
1483
+ }, {
1484
+ imagePath: string;
1485
+ subTextures: Record<string, {
1486
+ x: number;
1487
+ y: number;
1488
+ width: number;
1489
+ height: number;
1490
+ frameWidth?: number | undefined;
1491
+ frameHeight?: number | undefined;
1492
+ frameX?: number | undefined;
1493
+ frameY?: number | undefined;
1494
+ }>;
1495
+ }>;
1496
+ /**
1497
+ * A uniform-grid tile page — the shape a Kenney `Tilesheet/` sheet takes (e.g.
1498
+ * Pirate Pack: "each tile is 64×64, no margin"). Tiles are cut by `(col,row)`
1499
+ * index rather than by named rect. `names` is present only when a sibling
1500
+ * `.xml`/`.txt` supplies an index→name list; otherwise a tile is addressed by
1501
+ * its `"col,row"` (or flat index) via `Asset.sprite`.
1502
+ */
1503
+ interface Tilesheet {
1504
+ /** Relative path to the tile sheet PNG. */
1505
+ imagePath: string;
1506
+ /** Width of one tile cell in pixels. */
1507
+ tileWidth: number;
1508
+ /** Height of one tile cell in pixels. */
1509
+ tileHeight: number;
1510
+ /** Number of columns in the grid. */
1511
+ columns: number;
1512
+ /** Number of rows in the grid. */
1513
+ rows: number;
1514
+ /** Outer margin before the first tile, in pixels (default 0). */
1515
+ margin?: number;
1516
+ /** Gap between adjacent tiles, in pixels (default 0). */
1517
+ spacing?: number;
1518
+ /** Optional index→name labels when a descriptor supplies them. */
1519
+ names?: string[];
1520
+ }
1521
+ declare const TilesheetSchema: z.ZodObject<{
1522
+ imagePath: z.ZodString;
1523
+ tileWidth: z.ZodNumber;
1524
+ tileHeight: z.ZodNumber;
1525
+ columns: z.ZodNumber;
1526
+ rows: z.ZodNumber;
1527
+ margin: z.ZodOptional<z.ZodNumber>;
1528
+ spacing: z.ZodOptional<z.ZodNumber>;
1529
+ names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1530
+ }, "strip", z.ZodTypeAny, {
1531
+ columns: number;
1532
+ rows: number;
1533
+ imagePath: string;
1534
+ tileWidth: number;
1535
+ tileHeight: number;
1536
+ margin?: number | undefined;
1537
+ spacing?: number | undefined;
1538
+ names?: string[] | undefined;
1539
+ }, {
1540
+ columns: number;
1541
+ rows: number;
1542
+ imagePath: string;
1543
+ tileWidth: number;
1544
+ tileHeight: number;
1545
+ margin?: number | undefined;
1546
+ spacing?: number | undefined;
1547
+ names?: string[] | undefined;
1548
+ }>;
1549
+ /**
1550
+ * Semantic reference to an asset (not a hardcoded path).
1551
+ * Resolved to actual paths at compile time via asset maps.
1552
+ */
1553
+ type SemanticAssetRef = {
1554
+ /**
1555
+ * Entity role — a free string. Core no longer constrains the vocabulary to
1556
+ * `EntityRole` (that enum stays an exported shared reference for the asset
1557
+ * tool + renderer); genre boards may use their own roles (`boss`, `tower`, …).
1558
+ */
1559
+ role: string;
1560
+ /** Sub-category within role (hero, slime, coin, etc.) */
1561
+ category: string;
1562
+ /** Required animations for this entity */
1563
+ animations?: string[];
1564
+ /** Visual style preference */
1565
+ style?: VisualStyle;
1566
+ /** Variant identifier (for multiple versions) */
1567
+ variant?: string;
1568
+ /** 2D sprite vs 3D model — the rendering dimension the consuming canvas needs. */
1569
+ dimension?: AssetDimension;
1570
+ /** Rendering aspect ratio (square sprite/portrait/tile, 16:9 backdrop, 5:7 card, 8:1 fx-strip). */
1571
+ aspect?: AssetAspect;
1572
+ };
1573
+ declare const SemanticAssetRefSchema: z.ZodObject<{
1574
+ role: z.ZodString;
1575
+ category: z.ZodString;
1576
+ animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1577
+ style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1578
+ variant: z.ZodOptional<z.ZodString>;
1579
+ dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1580
+ aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1581
+ }, "strip", z.ZodTypeAny, {
1582
+ role: string;
1583
+ category: string;
1584
+ animations?: string[] | undefined;
1585
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1586
+ variant?: string | undefined;
1587
+ dimension?: "2d" | "3d" | undefined;
1588
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1589
+ }, {
1590
+ role: string;
1591
+ category: string;
1592
+ animations?: string[] | undefined;
1593
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1594
+ variant?: string | undefined;
1595
+ dimension?: "2d" | "3d" | undefined;
1596
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1597
+ }>;
1598
+ /**
1599
+ * The single asset type: a `SemanticAssetRef` (role/dimension/animations/aspect/style)
1600
+ * WITH its resolved URL folded in. Used everywhere an asset is referenced — a lolo
1601
+ * board `assetManifest` (`Map string Asset`), every `@almadar/ui` game prop, the
1602
+ * asset-workflow's resolved/pool assets, and the inspector picker. Replaces the bare
1603
+ * `AssetUrl`-string asset field so the render metadata travels WITH the asset (no
1604
+ * pixel-dimension or filename heuristics needed to know sheet-vs-frame / 2d-vs-3d).
1605
+ */
1606
+ interface Asset extends SemanticAssetRef {
1607
+ /** The resolved asset URL. When `atlas`/`sprite` are set this is the SHEET png; otherwise a standalone image. */
1608
+ url: AssetUrl;
1609
+ /**
1610
+ * Optional atlas JSON (a `TextureAtlas` or `Tilesheet`) that slices `url`.
1611
+ * When present with `sprite`, the renderer fetches sheet + atlas once and
1612
+ * blits one sub-rect instead of loading a standalone PNG. Absent → `url` is
1613
+ * a plain whole-image asset (the existing, non-atlas path).
1614
+ */
1615
+ atlas?: AssetUrl;
1616
+ /**
1617
+ * The sub-texture selector within `atlas`: a `SubTexture` name for a
1618
+ * `TextureAtlas` (e.g. `"grass.png"`), or a `"col,row"`/flat index for a
1619
+ * `Tilesheet`. Only meaningful alongside `atlas`.
1620
+ */
1621
+ sprite?: string;
1622
+ /** Optional display name (inspector picker). */
1623
+ name?: string;
1624
+ /** Optional thumbnail URL (inspector picker grid). */
1625
+ thumbnailUrl?: string;
1626
+ }
1627
+ declare const AssetSchema: z.ZodObject<{
1628
+ role: z.ZodString;
1629
+ category: z.ZodString;
1630
+ animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1631
+ style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1632
+ variant: z.ZodOptional<z.ZodString>;
1633
+ dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1634
+ aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1635
+ } & {
1636
+ url: z.ZodString;
1637
+ atlas: z.ZodOptional<z.ZodString>;
1638
+ sprite: z.ZodOptional<z.ZodString>;
1639
+ name: z.ZodOptional<z.ZodString>;
1640
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
1641
+ }, "strip", z.ZodTypeAny, {
1642
+ url: string;
1643
+ role: string;
1644
+ category: string;
1645
+ name?: string | undefined;
1646
+ animations?: string[] | undefined;
1647
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1648
+ variant?: string | undefined;
1649
+ dimension?: "2d" | "3d" | undefined;
1650
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1651
+ atlas?: string | undefined;
1652
+ sprite?: string | undefined;
1653
+ thumbnailUrl?: string | undefined;
1654
+ }, {
1655
+ url: string;
1656
+ role: string;
1657
+ category: string;
1658
+ name?: string | undefined;
1659
+ animations?: string[] | undefined;
1660
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1661
+ variant?: string | undefined;
1662
+ dimension?: "2d" | "3d" | undefined;
1663
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1664
+ atlas?: string | undefined;
1665
+ sprite?: string | undefined;
1666
+ thumbnailUrl?: string | undefined;
1667
+ }>;
1668
+ /**
1669
+ * Single browsable asset in the inspector picker catalog.
1670
+ * Backs the asset/icon pickers — a flat list the inspector renders for
1671
+ * the user to choose from when a config field's type is `'asset'`.
1672
+ */
1673
+ interface AssetCatalogEntry {
1674
+ /** Resolvable URL to the asset. */
1675
+ url: string;
1676
+ /** Display name for the asset. */
1677
+ name: string;
1678
+ /** Grouping category within the catalog. */
1679
+ category: string;
1680
+ /** Asset kind the picker dispatches on. */
1681
+ kind: 'image' | 'spritesheet' | 'audio' | 'scene' | 'portrait' | 'model' | 'other';
1682
+ /** Optional thumbnail URL for grid previews. */
1683
+ thumbnailUrl?: string;
1684
+ /** 2D sprite vs 3D model — the asset's actual rendering dimension. */
1685
+ dimension?: AssetDimension;
1686
+ /** The asset's actual rendering aspect ratio. */
1687
+ aspect?: AssetAspect;
1688
+ }
1689
+ declare const AssetCatalogEntrySchema: z.ZodObject<{
1690
+ url: z.ZodString;
1691
+ name: z.ZodString;
1692
+ category: z.ZodString;
1693
+ kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
1694
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
1695
+ dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1696
+ aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1697
+ }, "strip", z.ZodTypeAny, {
1698
+ kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1699
+ url: string;
1700
+ name: string;
1701
+ category: string;
1702
+ dimension?: "2d" | "3d" | undefined;
1703
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1704
+ thumbnailUrl?: string | undefined;
1705
+ }, {
1706
+ kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1707
+ url: string;
1708
+ name: string;
1709
+ category: string;
1710
+ dimension?: "2d" | "3d" | undefined;
1711
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1712
+ thumbnailUrl?: string | undefined;
1713
+ }>;
1714
+ /**
1715
+ * Flat list of browsable assets surfaced by the inspector pickers.
1716
+ */
1717
+ type AssetCatalog = AssetCatalogEntry[];
1718
+ declare const AssetCatalogSchema: z.ZodArray<z.ZodObject<{
1719
+ url: z.ZodString;
1720
+ name: z.ZodString;
1721
+ category: z.ZodString;
1722
+ kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
1723
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
1724
+ dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1725
+ aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1726
+ }, "strip", z.ZodTypeAny, {
1727
+ kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1728
+ url: string;
1729
+ name: string;
1730
+ category: string;
1731
+ dimension?: "2d" | "3d" | undefined;
1732
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1733
+ thumbnailUrl?: string | undefined;
1734
+ }, {
1735
+ kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1736
+ url: string;
1737
+ name: string;
1738
+ category: string;
1739
+ dimension?: "2d" | "3d" | undefined;
1740
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1741
+ thumbnailUrl?: string | undefined;
1742
+ }>, "many">;
1743
+ /**
1744
+ * Asset-reference URL marker. A plain alias over `string` — the value is a
1745
+ * resolvable asset URL — but the named type lets the pattern-sync tool
1746
+ * (`tools/almadar-pattern-sync/parser.ts`) detect a component prop as an asset
1747
+ * field (tagged `asset`) the same way `EventKey`/`LucideIcon` are detected by
1748
+ * type identity. Components annotate image/url props as `AssetUrl` (`src`,
1749
+ * `backgroundImage`, `avatar`, …); the generator emits a `string` config knob
1750
+ * declared as the `asset` config type, which the property inspector dispatches
1751
+ * an AssetPicker on. Not branded — asset urls originate from user data, so cast
1752
+ * friction would buy nothing; the value is the marker the tool finds.
1753
+ */
1754
+ type AssetUrl = string;
1755
+ /**
1756
+ * A neutral position in scene space: 2D (`x`,`y`) or optionally 3D (`x`,`y`,`z`).
1757
+ * The single coordinate type shared by every drawable descriptor and camera pose
1758
+ * across the 2D and 3D canvas hosts, so a scene composes from the same `{x,y,z?}`
1759
+ * regardless of projection or painter. Logical, not pixel — the host's projector
1760
+ * maps a `ScenePos` to screen space.
1761
+ */
1762
+ interface ScenePos {
1763
+ x: number;
1764
+ y: number;
1765
+ z?: number;
1766
+ }
1767
+ declare const ScenePosSchema: z.ZodObject<{
1768
+ x: z.ZodNumber;
1769
+ y: z.ZodNumber;
1770
+ z: z.ZodOptional<z.ZodNumber>;
1771
+ }, "strip", z.ZodTypeAny, {
1772
+ x: number;
1773
+ y: number;
1774
+ z?: number | undefined;
1775
+ }, {
1776
+ x: number;
1777
+ y: number;
1778
+ z?: number | undefined;
1779
+ }>;
1780
+ /**
1781
+ * Camera behaviors, unifying the former per-host vocab (2D `camera` string +
1782
+ * 3D `cameraMode`). `isometric`/`top-down` are fixed framings; `follow`/`chase`
1783
+ * track a target; `perspective` is the 3D dramatic framing.
1784
+ */
1785
+ declare const CAMERA_MODES: readonly ["isometric", "perspective", "top-down", "follow", "chase"];
1786
+ type CameraMode = (typeof CAMERA_MODES)[number];
1787
+ declare const CameraModeSchema: z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>;
1788
+ /**
1789
+ * A neutral camera pose shared by the 2D and 3D canvas hosts, so `type: canvas`
1790
+ * carries one camera object regardless of painter. `pos`/`target` are `ScenePos`
1791
+ * (logical scene space, not pixels); `zoom` scales the view (the former `scale`);
1792
+ * `fov` is the 3D field of view; `mode` selects the framing/tracking behavior.
1793
+ * Every field is optional — an omitted camera means the host's default framing.
1794
+ */
1795
+ interface Camera {
1796
+ pos?: ScenePos;
1797
+ target?: ScenePos;
1798
+ zoom?: number;
1799
+ fov?: number;
1800
+ mode?: CameraMode;
1801
+ }
1802
+ declare const CameraSchema: z.ZodObject<{
1803
+ pos: z.ZodOptional<z.ZodObject<{
1804
+ x: z.ZodNumber;
1805
+ y: z.ZodNumber;
1806
+ z: z.ZodOptional<z.ZodNumber>;
1807
+ }, "strip", z.ZodTypeAny, {
1808
+ x: number;
1809
+ y: number;
1810
+ z?: number | undefined;
1811
+ }, {
1812
+ x: number;
1813
+ y: number;
1814
+ z?: number | undefined;
1815
+ }>>;
1816
+ target: z.ZodOptional<z.ZodObject<{
1817
+ x: z.ZodNumber;
1818
+ y: z.ZodNumber;
1819
+ z: z.ZodOptional<z.ZodNumber>;
1820
+ }, "strip", z.ZodTypeAny, {
1821
+ x: number;
1822
+ y: number;
1823
+ z?: number | undefined;
1824
+ }, {
1825
+ x: number;
1826
+ y: number;
1827
+ z?: number | undefined;
1828
+ }>>;
1829
+ zoom: z.ZodOptional<z.ZodNumber>;
1830
+ fov: z.ZodOptional<z.ZodNumber>;
1831
+ mode: z.ZodOptional<z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>>;
1832
+ }, "strip", z.ZodTypeAny, {
1833
+ target?: {
1834
+ x: number;
1835
+ y: number;
1836
+ z?: number | undefined;
1837
+ } | undefined;
1838
+ pos?: {
1839
+ x: number;
1840
+ y: number;
1841
+ z?: number | undefined;
1842
+ } | undefined;
1843
+ zoom?: number | undefined;
1844
+ fov?: number | undefined;
1845
+ mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
1846
+ }, {
1847
+ target?: {
1848
+ x: number;
1849
+ y: number;
1850
+ z?: number | undefined;
1851
+ } | undefined;
1852
+ pos?: {
1853
+ x: number;
1854
+ y: number;
1855
+ z?: number | undefined;
1856
+ } | undefined;
1857
+ zoom?: number | undefined;
1858
+ fov?: number | undefined;
1859
+ mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
1860
+ }>;
1861
+ type SemanticAssetRefInput = z.input<typeof SemanticAssetRefSchema>;
1862
+ type AnimationDefInput = z.input<typeof AnimationDefSchema>;
1863
+ type AssetCatalogEntryInput = z.input<typeof AssetCatalogEntrySchema>;
1864
+ type SpriteSheetAtlasInput = z.input<typeof SpriteSheetAtlasSchema>;
1865
+ /**
1866
+ * Creates a semantic asset key from role and category.
1867
+ *
1868
+ * Generates a unique asset identifier by combining role and category
1869
+ * with a colon separator. Used for asset management and lookup.
1870
+ *
1871
+ * @param {EntityRole} role - Entity role (e.g., 'player', 'enemy')
1872
+ * @param {string} category - Asset category (e.g., 'sprite', 'animation')
1873
+ * @returns {string} Asset key in format 'role:category'
1874
+ *
1875
+ * @example
1876
+ * createAssetKey('player', 'sprite'); // returns 'player:sprite'
1877
+ * createAssetKey('enemy', 'animation'); // returns 'enemy:animation'
1878
+ */
1879
+ declare function createAssetKey(role: EntityRole, category: string): string;
1880
+ /**
1881
+ * Parses an asset key into role and category components.
1882
+ *
1883
+ * Deconstructs an asset key string (format 'role:category') into its
1884
+ * constituent parts. Returns null if the key format is invalid.
1885
+ *
1886
+ * @param {string} key - Asset key in format 'role:category'
1887
+ * @returns {{ role: string; category: string } | null} Parsed components or null
1888
+ *
1889
+ * @example
1890
+ * parseAssetKey('player:sprite'); // returns { role: 'player', category: 'sprite' }
1891
+ * parseAssetKey('enemy:animation'); // returns { role: 'enemy', category: 'animation' }
1892
+ * parseAssetKey('invalid'); // returns null
1893
+ */
1894
+ declare function parseAssetKey(key: string): {
1895
+ role: string;
1896
+ category: string;
1897
+ } | null;
1898
+ /**
1899
+ * Gets common animations for an entity role.
1900
+ *
1901
+ * Returns an array of default animation names appropriate for the
1902
+ * specified entity role. Used for asset configuration and validation.
1903
+ *
1904
+ * @param {EntityRole} role - Entity role
1905
+ * @returns {string[]} Array of default animation names
1906
+ *
1907
+ * @example
1908
+ * getDefaultAnimationsForRole('player'); // returns ['idle', 'run', 'jump', 'fall', 'attack', 'hurt', 'die']
1909
+ * getDefaultAnimationsForRole('enemy'); // returns ['idle', 'walk', 'attack', 'hurt', 'die']
1910
+ */
1911
+ declare function getDefaultAnimationsForRole(role: EntityRole): string[];
1912
+ /**
1913
+ * Validates that an asset reference has required animations.
1914
+ *
1915
+ * Checks if an asset reference contains all required animations.
1916
+ * Returns an error message if validation fails, or null if valid.
1917
+ *
1918
+ * @param {SemanticAssetRef} assetRef - Asset reference to validate
1919
+ * @param {string[]} requiredAnimations - Required animation names
1920
+ * @returns {string | null} Error message or null if valid
1921
+ *
1922
+ * @example
1923
+ * validateAssetAnimations(assetRef, ['idle', 'run']); // returns null if valid
1924
+ * validateAssetAnimations(assetRef, ['missing-animation']); // returns error message
1925
+ */
1926
+ declare function validateAssetAnimations(assetRef: SemanticAssetRef, requiredAnimations: string[]): {
1927
+ valid: boolean;
1928
+ missing: string[];
1929
+ };
1930
+
1931
+ /**
1932
+ * Entity persistence types.
1933
+ *
1934
+ * - persistent: Stored in database (has collection)
1935
+ * - runtime: Exists only at runtime (not persisted)
1936
+ */
1937
+ type EntityPersistence = 'persistent' | 'runtime';
1938
+ declare const EntityPersistenceSchema: z.ZodEnum<["persistent", "runtime"]>;
1939
+ /**
1940
+ * OrbitalEntity - the nucleus of an Orbital Unit.
1941
+ *
1942
+ * This is a simplified entity definition optimized for orbital composition.
1943
+ * Collection names are derived automatically from persistence type if not provided.
1944
+ */
1945
+ type OrbitalEntity = {
1946
+ /** V4 dual-carry id sibling of `name` — optional until the Phase-7 flip. */
1947
+ id?: EntityId;
1948
+ /** Entity name (PascalCase, e.g., "Task", "User") */
1949
+ name: string;
1950
+ /** Entity persistence type (defaults to 'persistent' if not specified) */
1951
+ persistence?: EntityPersistence;
1952
+ /** Whether this entity's state is shared across all bound traits (vs per-trait copy). Orthogonal to persistence. */
1953
+ shared?: boolean;
1954
+ /**
1955
+ * Whether this entity types the ambient `@user` viewer. Orthogonal to both
1956
+ * `persistence` and `shared`: `[persistent: people, identity]` is an
1957
+ * app-owned user directory, `[runtime, identity]` the provider-supplied
1958
+ * current viewer. At most one per composed program.
1959
+ */
1960
+ identity?: boolean;
1961
+ /** Collection name (auto-derived if not provided for persistent entities) */
1962
+ collection?: string;
1963
+ /** Entity fields */
1964
+ fields: EntityField[];
1965
+ /** Pre-authored instances (seed data or static reference data) */
1966
+ instances?: EntityRow[];
1967
+ /** Auto-add createdAt/updatedAt timestamps */
1968
+ timestamps?: boolean;
1969
+ /** Soft delete support */
1970
+ softDelete?: boolean;
1971
+ /** Human-readable description */
1972
+ description?: string;
1973
+ /** Visual prompt for AI generation */
1974
+ visual_prompt?: string;
1975
+ /** Semantic asset reference for visual representation (games) */
1976
+ assetRef?: SemanticAssetRef;
1977
+ };
1978
+ declare const OrbitalEntitySchema: z.ZodObject<{
1979
+ name: z.ZodString;
1980
+ persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
1981
+ shared: z.ZodOptional<z.ZodBoolean>;
1982
+ identity: z.ZodOptional<z.ZodBoolean>;
1983
+ collection: z.ZodOptional<z.ZodString>;
1984
+ fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
1985
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>, "many">>;
1986
+ timestamps: z.ZodOptional<z.ZodBoolean>;
1987
+ softDelete: z.ZodOptional<z.ZodBoolean>;
1988
+ description: z.ZodOptional<z.ZodString>;
1989
+ visual_prompt: z.ZodOptional<z.ZodString>;
1990
+ assetRef: z.ZodOptional<z.ZodObject<{
1991
+ role: z.ZodString;
1992
+ category: z.ZodString;
1993
+ animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1994
+ style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1995
+ variant: z.ZodOptional<z.ZodString>;
1996
+ dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1997
+ aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1998
+ }, "strip", z.ZodTypeAny, {
1999
+ role: string;
2000
+ category: string;
2001
+ animations?: string[] | undefined;
2002
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2003
+ variant?: string | undefined;
2004
+ dimension?: "2d" | "3d" | undefined;
2005
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2006
+ }, {
2007
+ role: string;
2008
+ category: string;
2009
+ animations?: string[] | undefined;
2010
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2011
+ variant?: string | undefined;
2012
+ dimension?: "2d" | "3d" | undefined;
2013
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2014
+ }>>;
2015
+ }, "strip", z.ZodTypeAny, {
2016
+ name: string;
2017
+ persistence: "persistent" | "runtime";
2018
+ fields: EntityField[];
2019
+ description?: string | undefined;
2020
+ shared?: boolean | undefined;
2021
+ identity?: boolean | undefined;
2022
+ collection?: string | undefined;
2023
+ instances?: Record<string, JsonValue>[] | undefined;
2024
+ timestamps?: boolean | undefined;
2025
+ softDelete?: boolean | undefined;
2026
+ visual_prompt?: string | undefined;
2027
+ assetRef?: {
2028
+ role: string;
2029
+ category: string;
2030
+ animations?: string[] | undefined;
2031
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2032
+ variant?: string | undefined;
2033
+ dimension?: "2d" | "3d" | undefined;
2034
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2035
+ } | undefined;
2036
+ }, {
2037
+ name: string;
2038
+ fields: unknown[];
2039
+ description?: string | undefined;
2040
+ persistence?: "persistent" | "runtime" | undefined;
2041
+ shared?: boolean | undefined;
2042
+ identity?: boolean | undefined;
2043
+ collection?: string | undefined;
2044
+ instances?: Record<string, JsonValue>[] | undefined;
2045
+ timestamps?: boolean | undefined;
2046
+ softDelete?: boolean | undefined;
2047
+ visual_prompt?: string | undefined;
2048
+ assetRef?: {
2049
+ role: string;
2050
+ category: string;
2051
+ animations?: string[] | undefined;
2052
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2053
+ variant?: string | undefined;
2054
+ dimension?: "2d" | "3d" | undefined;
2055
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2056
+ } | undefined;
2057
+ }>;
2058
+ type OrbitalEntityInput = z.input<typeof OrbitalEntitySchema>;
2059
+ /** Alias for OrbitalEntity - preferred name */
2060
+ type Entity = OrbitalEntity;
2061
+ /** Alias for OrbitalEntitySchema - preferred name */
2062
+ declare const EntitySchema: z.ZodObject<{
2063
+ name: z.ZodString;
2064
+ persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
2065
+ shared: z.ZodOptional<z.ZodBoolean>;
2066
+ identity: z.ZodOptional<z.ZodBoolean>;
2067
+ collection: z.ZodOptional<z.ZodString>;
2068
+ fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
2069
+ instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>, "many">>;
2070
+ timestamps: z.ZodOptional<z.ZodBoolean>;
2071
+ softDelete: z.ZodOptional<z.ZodBoolean>;
2072
+ description: z.ZodOptional<z.ZodString>;
2073
+ visual_prompt: z.ZodOptional<z.ZodString>;
2074
+ assetRef: z.ZodOptional<z.ZodObject<{
2075
+ role: z.ZodString;
2076
+ category: z.ZodString;
2077
+ animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2078
+ style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
2079
+ variant: z.ZodOptional<z.ZodString>;
2080
+ dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
2081
+ aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
2082
+ }, "strip", z.ZodTypeAny, {
2083
+ role: string;
2084
+ category: string;
2085
+ animations?: string[] | undefined;
2086
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2087
+ variant?: string | undefined;
2088
+ dimension?: "2d" | "3d" | undefined;
2089
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2090
+ }, {
2091
+ role: string;
2092
+ category: string;
2093
+ animations?: string[] | undefined;
2094
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2095
+ variant?: string | undefined;
2096
+ dimension?: "2d" | "3d" | undefined;
2097
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2098
+ }>>;
2099
+ }, "strip", z.ZodTypeAny, {
2100
+ name: string;
2101
+ persistence: "persistent" | "runtime";
2102
+ fields: EntityField[];
2103
+ description?: string | undefined;
2104
+ shared?: boolean | undefined;
2105
+ identity?: boolean | undefined;
2106
+ collection?: string | undefined;
2107
+ instances?: Record<string, JsonValue>[] | undefined;
2108
+ timestamps?: boolean | undefined;
2109
+ softDelete?: boolean | undefined;
2110
+ visual_prompt?: string | undefined;
2111
+ assetRef?: {
2112
+ role: string;
2113
+ category: string;
2114
+ animations?: string[] | undefined;
2115
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2116
+ variant?: string | undefined;
2117
+ dimension?: "2d" | "3d" | undefined;
2118
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2119
+ } | undefined;
2120
+ }, {
2121
+ name: string;
2122
+ fields: unknown[];
2123
+ description?: string | undefined;
2124
+ persistence?: "persistent" | "runtime" | undefined;
2125
+ shared?: boolean | undefined;
2126
+ identity?: boolean | undefined;
2127
+ collection?: string | undefined;
2128
+ instances?: Record<string, JsonValue>[] | undefined;
2129
+ timestamps?: boolean | undefined;
2130
+ softDelete?: boolean | undefined;
2131
+ visual_prompt?: string | undefined;
2132
+ assetRef?: {
2133
+ role: string;
2134
+ category: string;
2135
+ animations?: string[] | undefined;
2136
+ style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
2137
+ variant?: string | undefined;
2138
+ dimension?: "2d" | "3d" | undefined;
2139
+ aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
2140
+ } | undefined;
2141
+ }>;
2142
+ /**
2143
+ * Derives the collection name for a persistent entity.
2144
+ *
2145
+ * Generates the database collection name by converting the entity name
2146
+ * to lowercase and adding an 's' suffix (simple pluralization).
2147
+ * Returns undefined for non-persistent (runtime) entities.
2148
+ *
2149
+ * @param {OrbitalEntity} entity - Entity to derive collection name for
2150
+ * @returns {string | undefined} Collection name or undefined for non-persistent entities
2151
+ *
2152
+ * @example
2153
+ * deriveCollection({ name: 'User', persistence: 'persistent' }); // returns 'users'
2154
+ * deriveCollection({ name: 'Task', persistence: 'runtime' }); // returns undefined
2155
+ */
2156
+ declare function deriveCollection(entity: OrbitalEntity): string | undefined;
2157
+ /**
2158
+ * Checks if an entity is runtime-only (not persisted).
2159
+ *
2160
+ * Type guard to determine if an entity exists only at runtime
2161
+ * and is not stored in the database.
2162
+ *
2163
+ * @param {OrbitalEntity} entity - Entity to check
2164
+ * @returns {boolean} True if entity is runtime-only, false otherwise
2165
+ *
2166
+ * @example
2167
+ * isRuntimeEntity({ persistence: 'runtime' }); // returns true
2168
+ * isRuntimeEntity({ persistence: 'persistent' }); // returns false
2169
+ */
2170
+ declare function isRuntimeEntity(entity: OrbitalEntity): boolean;
2171
+ /**
2172
+ * Checks whether an entity's persistence mode allows `persistence` /
2173
+ * `collection` overrides at the factory call site.
2174
+ *
2175
+ * Only `persistent` entities (explicit or default) support these overrides.
2176
+ * Runtime entities are fixed; callers must not expose `persistence` or
2177
+ * `collection` params for them.
2178
+ *
2179
+ * @param persistence - The entity persistence mode (undefined = default persistent)
2180
+ * @returns True when overrides are allowed, false otherwise
2181
+ *
2182
+ * @example
2183
+ * persistenceModeAllowsOverrides('persistent'); // returns true
2184
+ * persistenceModeAllowsOverrides('runtime'); // returns false
2185
+ * persistenceModeAllowsOverrides(undefined); // returns true (default persistent)
2186
+ */
2187
+ declare function persistenceModeAllowsOverrides(persistence: EntityPersistence | undefined): boolean;
2188
+ /**
2189
+ * A single field value at runtime.
2190
+ * Union of all possible types from FieldType: string, number, boolean, date, array, nested.
2191
+ * The nested-record branch's index signature tolerates `undefined` so that
2192
+ * TypeScript optional properties (`x?: string`, carrying `string | undefined`)
2193
+ * on EntityRow extenders typecheck without ceremony. At JSON serialization
2194
+ * time `undefined` is equivalent to "key absent" and never appears on the
2195
+ * wire; the inclusion here is a pure type-surface accommodation.
2196
+ */
2197
+ type FieldValue = string | number | boolean | Date | null | string[] | FieldValue[] | {
2198
+ [key: string]: FieldValue | undefined;
2199
+ };
2200
+ /**
2201
+ * Runtime guard for `FieldValue` — narrows interpreter-produced `unknown`
2202
+ * values at typed substrate boundaries (e.g. `IntegrationContext.http` body).
2203
+ */
2204
+ declare function isFieldValue(value: RuntimeValue): value is FieldValue;
2205
+ /**
2206
+ * One instance of an entity with actual field values.
2207
+ * The shape is determined by the Entity definition at schema time.
2208
+ *
2209
+ * @example
2210
+ * // Entity defines: Patient { fullName: string, age: number, active: boolean }
2211
+ * // EntityRow is: { id: "p1", fullName: "Sarah", age: 34, active: true }
2212
+ */
2213
+ type EntityRow = {
2214
+ id?: string;
2215
+ } & Record<string, FieldValue | undefined>;
2216
+ /**
2217
+ * A field-TYPED `EntityRow` — the SINGLE entity type, refined with a concrete
2218
+ * field SHAPE `S`. Non-optional members of `S` are REQUIRED, each with its real
2219
+ * type; the result stays `& EntityRow`, so the index signature is intact and
2220
+ * every other field is still field-open — any domain entity that provides those
2221
+ * fields satisfies it.
2222
+ *
2223
+ * One declaration, two jobs: (1) TypeScript enforces the bound entity has the
2224
+ * fields WITH their types (a behavior binding a thinner/mistyped entity fails to
2225
+ * typecheck); and (2) pattern-sync reads the same type and writes the entity
2226
+ * prop's field shape (`properties` + `requiredFields`) onto the registry, so
2227
+ * lolo-ui emits a COMPLETE `entity { … }` (every field, typed + demo-seeded) and
2228
+ * the `ORB_X_ENTITY_PROP_CONTRACT` validator rejects an incompatible bind at
2229
+ * `orbital validate`. (A raw `EntityRow & { rating: number }` intersection is
2230
+ * equivalent for one-off shapes.)
2231
+ *
2232
+ * @example
2233
+ * // HeroOrganism renders entity.title / entity.subtitle:
2234
+ * entity?: EntityWith<{ title: string; subtitle?: string }>;
2235
+ * // entity.title → string (required)
2236
+ * // entity.subtitle → string | undefined (optional)
2237
+ * // entity.other → FieldValue | undefined (still field-open)
2238
+ */
2239
+ type EntityWith<S extends object> = EntityRow & S;
2240
+ /**
2241
+ * Collection of entity instances keyed by entity name.
2242
+ * Used by OrbPreview mockData, OrbitalServerRuntime state, data grids, etc.
2243
+ *
2244
+ * @example
2245
+ * const data: EntityData = {
2246
+ * Patient: [{ id: "1", fullName: "Sarah", age: 34 }],
2247
+ * QueueEntry: [{ id: "1", patientName: "Sarah", waitMinutes: 12 }],
2248
+ * };
2249
+ */
2250
+ type EntityData = Record<string, EntityRow[]>;
2251
+
749
2252
  /**
750
2253
  * Pattern Types (Auto-Generated)
751
2254
  *
752
2255
  * DO NOT EDIT MANUALLY — regenerated by almadar-pattern-sync `patterns` command.
753
2256
  *
754
- * Generated: 2026-07-28T14:48:23.870Z
755
- * Pattern count: 271
2257
+ * Generated: 2026-07-29T19:32:01.969Z
2258
+ * Pattern count: 268
756
2259
  */
757
2260
 
758
2261
  /**
@@ -764,7 +2267,7 @@ type PatternPropValue = Record<string, FieldValue | undefined>;
764
2267
  * All valid pattern type names from @almadar/core/patterns registry.
765
2268
  * Use this type in render-ui effects for compile-time validation.
766
2269
  */
767
- type PatternType = 'about-page-template' | 'accordion' | 'action-palette' | 'action-tile' | 'activation-block' | 'alert' | 'algorithm-canvas' | 'animated-counter' | 'animated-graphic' | 'animated-reveal' | 'article-section' | 'aside' | 'atlas-image' | 'atlas-panel' | 'auth-layout' | 'avatar' | 'badge' | 'behavior-view' | 'biology-canvas' | 'bloom-quiz-block' | 'book-chapter-view' | 'book-cover-page' | 'book-nav-bar' | 'book-table-of-contents' | 'book-viewer' | 'box' | 'branching-logic-builder' | 'breadcrumb' | 'button' | 'calendar-grid' | 'canvas' | 'canvas-2d' | 'card' | 'carousel' | 'case-study-card' | 'case-study-organism' | 'center' | 'chart' | 'chart-legend' | 'chat-bar' | 'checkbox' | 'chemistry-canvas' | 'choice-button' | 'code-block' | 'code-runner-panel' | 'community-links' | 'conditional-wrapper' | 'confetti-effect' | 'confirm-dialog' | 'connection-block' | 'container' | 'content-renderer' | 'content-section' | 'control-button' | 'control-grid' | 'counter-template' | 'cta-banner' | 'dashboard-grid' | 'dashboard-layout' | 'data-grid' | 'data-list' | 'date-range-picker' | 'date-range-selector' | 'day-cell' | 'detail-panel' | 'dialog' | 'dialogue-bubble' | 'divider' | 'doc-breadcrumb' | 'doc-pagination' | 'doc-search' | 'doc-sidebar' | 'doc-toc' | 'document-viewer' | 'draw-shape' | 'draw-shape-layer' | 'draw-sprite' | 'draw-sprite-layer' | 'draw-text' | 'draw-text-layer' | 'drawer' | 'drawer-slot' | 'edge-decoration' | 'empty-state' | 'entity-cards' | 'entity-list' | 'entity-table' | 'error-boundary' | 'error-state' | 'feature-card' | 'feature-detail-page-template' | 'feature-grid' | 'feature-grid-organism' | 'file-tree' | 'filter-group' | 'filter-pill' | 'flex' | 'flip-card' | 'flip-container' | 'floating-action-button' | 'form' | 'form-actions' | 'form-field' | 'form-layout' | 'form-section' | 'form-section-header' | 'game-audio-toggle' | 'game-hud' | 'game-icon' | 'game-menu' | 'game-shell' | 'generic-app-template' | 'geometric-pattern' | 'gradient-divider' | 'graph-canvas' | 'graph-view' | 'grid' | 'header' | 'health-bar' | 'hero-organism' | 'hero-section' | 'hstack' | 'icon' | 'import-preview-tree' | 'import-progress' | 'import-source-picker' | 'infinite-scroll-sentinel' | 'input' | 'input-group' | 'install-box' | 'jazari-state-machine' | 'label' | 'landing-page-template' | 'law-reference-tooltip' | 'learning-canvas' | 'lightbox' | 'likert-scale' | 'line-chart' | 'loading-state' | 'map-view' | 'markdown-content' | 'marketing-footer' | 'marketing-stat-card' | 'master-detail' | 'master-detail-layout' | 'math-canvas' | 'matrix-question' | 'media-gallery' | 'menu' | 'meter' | 'modal' | 'modal-slot' | 'module-card' | 'navigation' | 'notification' | 'number-stepper' | 'option-constraint-group' | 'orbital-visualization' | 'overlay' | 'page-header' | 'page-transition' | 'pagination' | 'pattern-tile' | 'physics-canvas' | 'popover' | 'positioned-canvas' | 'presence' | 'pricing-card' | 'pricing-grid' | 'pricing-organism' | 'pricing-page-template' | 'progress-bar' | 'progress-dots' | 'pull-quote' | 'pull-to-refresh' | 'qr-scanner' | 'quiz-block' | 'radio' | 'range-slider' | 'reflection-block' | 'relation-select' | 'repeatable-form-section' | 'reply-tree' | 'rich-block-editor' | 'runtime-debugger' | 'scaled-diagram' | 'score-display' | 'search-input' | 'section' | 'section-header' | 'segment-renderer' | 'select' | 'sequence-bar' | 'service-catalog' | 'showcase-card' | 'showcase-organism' | 'side-panel' | 'sidebar' | 'signature-pad' | 'simple-grid' | 'skeleton' | 'social-proof' | 'sortable-list' | 'spacer' | 'sparkline' | 'spinner' | 'split' | 'split-pane' | 'split-section' | 'stack' | 'star-rating' | 'stat-badge' | 'stat-card' | 'stat-display' | 'state-graph' | 'state-json-view' | 'state-machine-view' | 'stats-grid' | 'stats-organism' | 'status-dot' | 'step-flow' | 'step-flow-organism' | 'subagent-trace-panel' | 'svg-branch' | 'svg-connection' | 'svg-draw-group' | 'svg-draw-shape' | 'svg-draw-shape-layer' | 'svg-draw-text' | 'svg-flow' | 'svg-grid' | 'svg-lobe' | 'svg-mesh' | 'svg-morph' | 'svg-node' | 'svg-pulse' | 'svg-ring' | 'svg-shield' | 'svg-stack' | 'svg-stage' | 'swipeable-row' | 'switch' | 'tabbed-container' | 'table-view' | 'tabs' | 'tag-cloud' | 'tag-input' | 'team-card' | 'team-organism' | 'text-highlight' | 'textarea' | 'theme-toggle' | 'time-slot-cell' | 'timeline' | 'timer-display' | 'toast-slot' | 'tooltip' | 'trait-frame' | 'trait-slot' | 'trend-indicator' | 'typewriter-text' | 'typography' | 'ui-slot-renderer' | 'upload-drop-zone' | 'version-diff' | 'violation-alert' | 'vote-stack' | 'vstack' | 'wizard-container' | 'wizard-navigation' | 'wizard-progress';
2270
+ type PatternType = 'about-page-template' | 'accordion' | 'action-palette' | 'action-tile' | 'activation-block' | 'alert' | 'algorithm-canvas' | 'animated-counter' | 'animated-graphic' | 'animated-reveal' | 'article-section' | 'aside' | 'atlas-image' | 'atlas-panel' | 'auth-layout' | 'avatar' | 'badge' | 'behavior-view' | 'biology-canvas' | 'bloom-quiz-block' | 'book-chapter-view' | 'book-cover-page' | 'book-nav-bar' | 'book-table-of-contents' | 'book-viewer' | 'box' | 'branching-logic-builder' | 'breadcrumb' | 'button' | 'calendar-grid' | 'canvas' | 'canvas-2d' | 'card' | 'carousel' | 'case-study-card' | 'case-study-organism' | 'center' | 'chart' | 'chart-legend' | 'chat-bar' | 'checkbox' | 'chemistry-canvas' | 'choice-button' | 'code-block' | 'code-runner-panel' | 'community-links' | 'conditional-wrapper' | 'confetti-effect' | 'confirm-dialog' | 'connection-block' | 'container' | 'content-renderer' | 'content-section' | 'control-button' | 'control-grid' | 'counter-template' | 'cta-banner' | 'dashboard-grid' | 'dashboard-layout' | 'data-grid' | 'data-list' | 'date-range-picker' | 'date-range-selector' | 'day-cell' | 'detail-panel' | 'dialog' | 'dialogue-bubble' | 'divider' | 'doc-breadcrumb' | 'doc-pagination' | 'doc-search' | 'doc-sidebar' | 'doc-toc' | 'document-viewer' | 'draw-group' | 'draw-shape' | 'draw-shape-layer' | 'draw-sprite' | 'draw-sprite-layer' | 'draw-text' | 'draw-text-layer' | 'drawer' | 'drawer-slot' | 'edge-decoration' | 'emoji-picker' | 'empty-state' | 'entity-cards' | 'entity-list' | 'entity-table' | 'error-boundary' | 'error-state' | 'feature-card' | 'feature-detail-page-template' | 'feature-grid' | 'feature-grid-organism' | 'file-tree' | 'filter-group' | 'filter-pill' | 'flex' | 'flip-card' | 'flip-container' | 'floating-action-button' | 'form' | 'form-actions' | 'form-field' | 'form-layout' | 'form-section' | 'form-section-header' | 'game-audio-toggle' | 'game-hud' | 'game-icon' | 'game-menu' | 'game-shell' | 'generic-app-template' | 'geometric-pattern' | 'gradient-divider' | 'graph-canvas' | 'graph-view' | 'grid' | 'header' | 'health-bar' | 'hero-organism' | 'hero-section' | 'hstack' | 'icon' | 'import-preview-tree' | 'import-progress' | 'import-source-picker' | 'infinite-scroll-sentinel' | 'input' | 'input-group' | 'install-box' | 'jazari-state-machine' | 'label' | 'landing-page-template' | 'law-reference-tooltip' | 'learning-canvas' | 'lightbox' | 'likert-scale' | 'line-chart' | 'loading-state' | 'map-view' | 'markdown-content' | 'marketing-footer' | 'marketing-stat-card' | 'master-detail' | 'master-detail-layout' | 'math-canvas' | 'matrix-question' | 'media-gallery' | 'menu' | 'meter' | 'modal' | 'modal-slot' | 'module-card' | 'navigation' | 'notification' | 'number-stepper' | 'option-constraint-group' | 'orbital-visualization' | 'overlay' | 'page-header' | 'page-transition' | 'pagination' | 'pattern-tile' | 'physics-canvas' | 'popover' | 'positioned-canvas' | 'presence' | 'pricing-card' | 'pricing-grid' | 'pricing-organism' | 'pricing-page-template' | 'progress-bar' | 'progress-dots' | 'pull-quote' | 'pull-to-refresh' | 'qr-scanner' | 'quiz-block' | 'radio' | 'range-slider' | 'reflection-block' | 'relation-select' | 'repeatable-form-section' | 'reply-tree' | 'rich-block-editor' | 'runtime-debugger' | 'scaled-diagram' | 'score-display' | 'search-input' | 'section' | 'section-header' | 'segment-renderer' | 'select' | 'sequence-bar' | 'service-catalog' | 'showcase-card' | 'showcase-organism' | 'side-panel' | 'sidebar' | 'signature-pad' | 'simple-grid' | 'skeleton' | 'social-proof' | 'sortable-list' | 'spacer' | 'sparkline' | 'spinner' | 'split' | 'split-pane' | 'split-section' | 'stack' | 'star-rating' | 'stat-badge' | 'stat-card' | 'stat-display' | 'state-graph' | 'state-json-view' | 'state-machine-view' | 'stats-grid' | 'stats-organism' | 'status-dot' | 'step-flow' | 'step-flow-organism' | 'subagent-trace-panel' | 'svg-branch' | 'svg-connection' | 'svg-flow' | 'svg-grid' | 'svg-lobe' | 'svg-mesh' | 'svg-morph' | 'svg-node' | 'svg-pulse' | 'svg-ring' | 'svg-shield' | 'svg-stack' | 'swipeable-row' | 'switch' | 'tabbed-container' | 'table-view' | 'tabs' | 'tag-cloud' | 'tag-input' | 'team-card' | 'team-organism' | 'text-highlight' | 'textarea' | 'theme-toggle' | 'time-slot-cell' | 'timeline' | 'timer-display' | 'toast-slot' | 'tooltip' | 'trait-frame' | 'trait-slot' | 'trend-indicator' | 'typewriter-text' | 'typography' | 'ui-slot-renderer' | 'upload-drop-zone' | 'version-diff' | 'violation-alert' | 'vote-stack' | 'vstack' | 'wizard-container' | 'wizard-navigation' | 'wizard-progress';
768
2271
  /**
769
2272
  * Pattern props map — each pattern type maps to its valid props interface.
770
2273
  */
@@ -1127,6 +2630,8 @@ interface PatternPropsMap {
1127
2630
  isLoading?: boolean | string | SExpr;
1128
2631
  unitScale?: number | string | SExpr;
1129
2632
  showMinimap?: boolean | string | SExpr;
2633
+ fit?: boolean | string | SExpr;
2634
+ tileWidth?: number | string | SExpr;
1130
2635
  backgroundImage?: unknown | PatternPropValue | string | SExpr;
1131
2636
  backgroundColor?: string | SExpr;
1132
2637
  worldWidth?: number | string | SExpr;
@@ -1161,6 +2666,8 @@ interface PatternPropsMap {
1161
2666
  keyUpMap?: PatternPropValue | string | SExpr;
1162
2667
  camera?: string | SExpr;
1163
2668
  scale?: number | string | SExpr;
2669
+ tileWidth?: number | string | SExpr;
2670
+ fit?: boolean | string | SExpr;
1164
2671
  showMinimap?: boolean | string | SExpr;
1165
2672
  followTarget?: PatternPropValue | string | SExpr;
1166
2673
  cameraPos?: PatternPropValue | string | SExpr;
@@ -1599,6 +3106,8 @@ interface PatternPropsMap {
1599
3106
  children?: ((...args: unknown[]) => unknown) | string | SExpr;
1600
3107
  renderItem?: ((...args: unknown[]) => unknown) | string | SExpr;
1601
3108
  pageSize?: number | string | SExpr;
3109
+ sortBy?: string | SExpr;
3110
+ sortDirection?: string | SExpr;
1602
3111
  look?: string | SExpr;
1603
3112
  };
1604
3113
  'date-range-picker': {
@@ -1725,6 +3234,15 @@ interface PatternPropsMap {
1725
3234
  error?: PatternPropValue | string | SExpr;
1726
3235
  className?: string | SExpr;
1727
3236
  };
3237
+ 'draw-group': {
3238
+ type: 'draw-group';
3239
+ id?: string | SExpr;
3240
+ position: PatternPropValue | string | SExpr;
3241
+ scale?: number | string | SExpr;
3242
+ rotate?: number | string | SExpr;
3243
+ opacity?: number | string | SExpr;
3244
+ items: unknown[] | string | SExpr;
3245
+ };
1728
3246
  'draw-shape': {
1729
3247
  type: 'draw-shape';
1730
3248
  id?: string | SExpr;
@@ -1738,6 +3256,7 @@ interface PatternPropsMap {
1738
3256
  offsetX?: number | string | SExpr;
1739
3257
  offsetY?: number | string | SExpr;
1740
3258
  points?: unknown[] | string | SExpr;
3259
+ d?: string | SExpr;
1741
3260
  fill?: string | SExpr;
1742
3261
  stroke?: string | SExpr;
1743
3262
  strokeWidth?: number | string | SExpr;
@@ -1824,6 +3343,14 @@ interface PatternPropsMap {
1824
3343
  width?: number | string | SExpr;
1825
3344
  className?: string | SExpr;
1826
3345
  };
3346
+ 'emoji-picker': {
3347
+ type: 'emoji-picker';
3348
+ pickEvent?: string | SExpr;
3349
+ position?: string | SExpr;
3350
+ triggerIcon?: unknown | string | SExpr;
3351
+ triggerLabel?: string | SExpr;
3352
+ className?: string | SExpr;
3353
+ };
1827
3354
  'empty-state': {
1828
3355
  type: 'empty-state';
1829
3356
  icon?: unknown | string | SExpr;
@@ -2906,6 +4433,8 @@ interface PatternPropsMap {
2906
4433
  position?: string | SExpr;
2907
4434
  trigger?: string | SExpr;
2908
4435
  showArrow?: boolean | string | SExpr;
4436
+ open?: boolean | string | SExpr;
4437
+ onOpenChange?: ((...args: unknown[]) => unknown) | string | SExpr;
2909
4438
  className?: string | SExpr;
2910
4439
  };
2911
4440
  'positioned-canvas': {
@@ -3633,53 +5162,6 @@ interface PatternPropsMap {
3633
5162
  width?: number | string | SExpr;
3634
5163
  height?: number | string | SExpr;
3635
5164
  };
3636
- 'svg-draw-group': {
3637
- type: 'svg-draw-group';
3638
- x?: number | string | SExpr;
3639
- y?: number | string | SExpr;
3640
- scale?: number | string | SExpr;
3641
- rotate?: number | string | SExpr;
3642
- opacity?: number | string | SExpr;
3643
- className?: string | SExpr;
3644
- children?: unknown | string | SExpr;
3645
- };
3646
- 'svg-draw-shape': {
3647
- type: 'svg-draw-shape';
3648
- shape: string | SExpr;
3649
- x: number | string | SExpr;
3650
- y: number | string | SExpr;
3651
- width?: number | string | SExpr;
3652
- height?: number | string | SExpr;
3653
- radius?: number | string | SExpr;
3654
- radiusY?: number | string | SExpr;
3655
- points?: string | SExpr;
3656
- d?: string | SExpr;
3657
- x2?: number | string | SExpr;
3658
- y2?: number | string | SExpr;
3659
- fill?: string | SExpr;
3660
- stroke?: string | SExpr;
3661
- strokeWidth?: number | string | SExpr;
3662
- opacity?: number | string | SExpr;
3663
- className?: string | SExpr;
3664
- };
3665
- 'svg-draw-shape-layer': {
3666
- type: 'svg-draw-shape-layer';
3667
- items: unknown[] | string | SExpr;
3668
- fill?: string | SExpr;
3669
- stroke?: string | SExpr;
3670
- strokeWidth?: number | string | SExpr;
3671
- opacity?: number | string | SExpr;
3672
- };
3673
- 'svg-draw-text': {
3674
- type: 'svg-draw-text';
3675
- x: number | string | SExpr;
3676
- y: number | string | SExpr;
3677
- text: string | SExpr;
3678
- size?: number | string | SExpr;
3679
- fill?: string | SExpr;
3680
- anchor?: string | SExpr;
3681
- className?: string | SExpr;
3682
- };
3683
5165
  'svg-flow': {
3684
5166
  type: 'svg-flow';
3685
5167
  points?: unknown[] | string | SExpr;
@@ -3821,20 +5303,6 @@ interface PatternPropsMap {
3821
5303
  svgWidth?: number | string | SExpr;
3822
5304
  svgHeight?: number | string | SExpr;
3823
5305
  };
3824
- 'svg-stage': {
3825
- type: 'svg-stage';
3826
- cols: number | string | SExpr;
3827
- rows: number | string | SExpr;
3828
- tileSize?: number | string | SExpr;
3829
- background?: string | SExpr;
3830
- tileClickEvent?: string | SExpr;
3831
- tileHoverEvent?: string | SExpr;
3832
- tileLeaveEvent?: string | SExpr;
3833
- keyMap?: PatternPropValue | string | SExpr;
3834
- keyUpMap?: PatternPropValue | string | SExpr;
3835
- className?: string | SExpr;
3836
- children?: unknown | string | SExpr;
3837
- };
3838
5306
  'swipeable-row': {
3839
5307
  type: 'swipeable-row';
3840
5308
  leftActions?: unknown[] | string | SExpr;
@@ -3879,6 +5347,7 @@ interface PatternPropsMap {
3879
5347
  fields?: unknown[] | string | SExpr;
3880
5348
  itemActions?: unknown[] | string | SExpr;
3881
5349
  maxInlineActions?: number | string | SExpr;
5350
+ itemClickEvent?: string | SExpr;
3882
5351
  selectable?: boolean | string | SExpr;
3883
5352
  selectEvent?: string | SExpr;
3884
5353
  selectedIds?: unknown[] | string | SExpr;
@@ -4376,7 +5845,7 @@ interface EmitConfig {
4376
5845
  * @example ['set', '@entity.id', 'health', 100] // 4-element
4377
5846
  * @example ['set', '@entity.id', 'count', ['+', '@entity.count', 1]]
4378
5847
  */
4379
- type SetEffect = ['set', string, unknown] | ['set', string, string, unknown];
5848
+ type SetEffect = ['set', string, SExpr] | ['set', string, string, SExpr];
4380
5849
  /**
4381
5850
  * Trailing config object on persist effects. When present, it carries the
4382
5851
  * `emit` map specifying which events to fire on persist success/failure.
@@ -4391,12 +5860,14 @@ type PersistEmitConfig = {
4391
5860
  };
4392
5861
  };
4393
5862
  /**
4394
- * Persist effect data argument: either an entity row literal (field map)
4395
- * or a binding string referencing a row in scope (e.g. `@payload.data`,
4396
- * `@entity`). At runtime, binding strings resolve to `EntityRow` values
4397
- * before the persist op runs.
5863
+ * Persist effect data argument: an entity row literal (field map), a
5864
+ * binding string referencing a row in scope (e.g. `@payload.data`,
5865
+ * `@entity`), or an expression form that evaluates to a row (e.g.
5866
+ * `["object/merge", "@payload.data", { sender: "@user.id" }]`). At
5867
+ * runtime, binding strings and expressions resolve to `EntityRow` values
5868
+ * before the persist op runs — both paths evaluate the expression first.
4398
5869
  */
4399
- type PersistData = EntityRow | string;
5870
+ type PersistData = EntityRow | string | SExpr[];
4400
5871
  /**
4401
5872
  * Persist effect - creates, updates, deletes, or clears entities.
4402
5873
  *
@@ -4508,12 +5979,12 @@ type WhenEffect = ['when', Expression, SExpr];
4508
5979
  * Uses SExpr to allow deeply nested conditionals.
4509
5980
  * @example ['let', ['temp', ['get', '@payload.value']], ['set', '@entity.value', 'temp']]
4510
5981
  */
4511
- type LetEffect = ['let', [string, unknown][], ...SExpr[]];
5982
+ type LetEffect = ['let', [string, SExpr][], ...SExpr[]];
4512
5983
  /**
4513
5984
  * Log effect - logs a message for debugging.
4514
5985
  * @example ['log', 'User created:', '@entity.name']
4515
5986
  */
4516
- type LogEffect = ['log', ...unknown[]];
5987
+ type LogEffect = ['log', ...SExpr[]];
4517
5988
  /**
4518
5989
  * Wait effect - delays execution.
4519
5990
  * @example ['wait', 1000] - wait 1 second
@@ -4633,7 +6104,7 @@ type EvaluateEffect = ['evaluate', EvaluateConfig];
4633
6104
  * Checkpoint save effect - saves model weights.
4634
6105
  * @example ['checkpoint/save', '/path/to/model.pt', '@entity.weights']
4635
6106
  */
4636
- type CheckpointSaveEffect = ['checkpoint/save', string, unknown];
6107
+ type CheckpointSaveEffect = ['checkpoint/save', string, SExpr];
4637
6108
  /**
4638
6109
  * Checkpoint load effect - loads model weights.
4639
6110
  * @example ['checkpoint/load', '/path/to/model.pt']
@@ -4767,9 +6238,12 @@ type TypedEffect = RenderUIEffect | NavigateEffect | EmitEffect | SetEffect | Pe
4767
6238
  */
4768
6239
  type Effect = TypedEffect;
4769
6240
  /**
4770
- * Schema for Effect - validates S-expression format
6241
+ * Schema for Effect - validates S-expression format. Arguments validate as
6242
+ * s-expr-shaped DATA (`SExprDataSchema`) — literal data arrays (empty or
6243
+ * non-operator-headed) are valid argument values; the operator-head refine
6244
+ * applies to the effect itself, not to every argument.
4771
6245
  */
4772
- declare const EffectSchema: z.ZodEffects<z.ZodArray<z.ZodUnknown, "many">, unknown[], unknown[]>;
6246
+ declare const EffectSchema: z.ZodEffects<z.ZodArray<z.ZodType<SExpr, z.ZodTypeDef, SExpr>, "many">, SExpr[], SExpr[]>;
4773
6247
  type EffectInput = z.input<typeof EffectSchema>;
4774
6248
  /**
4775
6249
  * Type guard to check if a value is a valid Effect (S-expression).
@@ -4779,7 +6253,7 @@ type EffectInput = z.input<typeof EffectSchema>;
4779
6253
  * and subsequent elements are parameters. Used for runtime validation
4780
6254
  * of effect structures.
4781
6255
  *
4782
- * @param {unknown} value - Value to check
6256
+ * @param {RuntimeValue} value - Value to check
4783
6257
  * @returns {boolean} True if value is a valid Effect, false otherwise
4784
6258
  *
4785
6259
  * @example
@@ -4787,7 +6261,7 @@ type EffectInput = z.input<typeof EffectSchema>;
4787
6261
  * isEffect('not-an-effect'); // returns false
4788
6262
  * isEffect([]); // returns false
4789
6263
  */
4790
- declare function isEffect(value: unknown): value is Effect;
6264
+ declare function isEffect(value: RuntimeValue): value is Effect;
4791
6265
  /**
4792
6266
  * Alias for isEffect (for clarity when working with S-expressions)
4793
6267
  */
@@ -4955,4 +6429,4 @@ interface RenderUINode {
4955
6429
  renderItem?: RenderUINode;
4956
6430
  }
4957
6431
 
4958
- export { RestServiceDefSchema as $, type AnyPatternConfig as A, type BehaviorEffect as B, type CallServiceConfig as C, type DerefEffect as D, type Effect as E, type FetchEffect as F, type PatternProps as G, type PatternPropsMap as H, type PatternType as I, type PersistData as J, type PersistEffect as K, type LlmEffect as L, type McpServiceDef as M, type NavigateEffect as N, type OsEffect as O, PATTERN_TYPES as P, type PersistEmitConfig as Q, type RefEffect as R, type RenderBinding as S, type RenderChildrenMap as T, type RenderItemLambda as U, type RenderUIEffect as V, type RenderUINode as W, type ResolvedPatternProps as X, type RestAuthConfig as Y, RestAuthConfigSchema as Z, type RestServiceDef as _, type AgentEffect as a, SERVICE_TYPES as a0, type ServiceDefinition as a1, ServiceDefinitionSchema as a2, type ServiceParams as a3, type ServiceParamsValue as a4, type ServiceRef as a5, type ServiceRefObject as a6, ServiceRefObjectSchema as a7, ServiceRefSchema as a8, ServiceRefStringSchema as a9, findService as aA, getServiceNames as aB, hasService as aC, isEffect as aD, isMcpService as aE, isRestService as aF, isSExprEffect as aG, isServiceReference as aH, isServiceReferenceObject as aI, isSocketService as aJ, isValidPatternType as aK, navigate as aL, notify as aM, parseServiceRef as aN, persist as aO, ref as aP, renderUI as aQ, set as aR, spawn as aS, swap as aT, watch as aU, type ServiceType as aa, ServiceTypeSchema as ab, type SessionEffect as ac, type SetEffect as ad, type SocketEvents as ae, SocketEventsSchema as af, type SocketServiceDef as ag, SocketServiceDefSchema as ah, type SpawnEffect as ai, type SwapEffect as aj, type TraceEffect as ak, type TrainConfig as al, type TrainEffect as am, type TypedEffect as an, type UISlot as ao, UISlotSchema as ap, UI_SLOTS as aq, type ValidateEffect as ar, type WatchEffect as as, type WatchOptions as at, atomic as au, callService as av, deref as aw, despawn as ax, doEffects as ay, emit as az, type ApplicationEffect as b, type AtomicEffect as c, type CallServiceEffect as d, type CheckpointLoadEffect as e, type CheckpointSaveEffect as f, type ComposeEffect as g, type DespawnEffect as h, type DoEffect as i, type EffectInput as j, EffectSchema as k, type EmitConfig as l, type EmitEffect as m, type EvaluateConfig as n, type EvaluateEffect as o, type FetchOptions as p, type FetchResult as q, type ForwardConfig as r, type ForwardEffect as s, type LogEffect as t, McpServiceDefSchema as u, type MemoryEffect as v, type NnConfig as w, type NnLayer as x, type NotifyEffect as y, type PatternConfig as z };
6432
+ export { type ComposeEffect as $, type AnyPatternConfig as A, AssetCatalogEntrySchema as B, AssetCatalogSchema as C, type AssetDimension as D, type EntityField as E, type FieldValue as F, AssetDimensionSchema as G, AssetSchema as H, type IdentityLedger as I, type AssetUrl as J, type AtomicEffect as K, type BehaviorEffect as L, CAMERA_MODES as M, type CallServiceConfig as N, type OrbitalId as O, type PageId as P, type CallServiceEffect as Q, type RelationConfig as R, type ServiceRef as S, type TraitId as T, type UISlot as U, type Camera as V, type CameraMode as W, CameraModeSchema as X, CameraSchema as Y, type CheckpointLoadEffect as Z, type CheckpointSaveEffect as _, type EntityPersistence as a, type PersistEmitConfig as a$, type DerefEffect as a0, type DespawnEffect as a1, type DoEffect as a2, ENTITY_ROLES as a3, type EffectInput as a4, EffectSchema as a5, type EmitConfig as a6, type EmitEffect as a7, type EntityData as a8, type EntityFieldInput as a9, type LedgerKind as aA, LedgerKindSchema as aB, type LlmEffect as aC, type LogEffect as aD, type McpServiceDef as aE, McpServiceDefSchema as aF, type MemoryEffect as aG, type NavigateEffect as aH, type NnConfig as aI, type NnLayer as aJ, type NotifyEffect as aK, type ObjectEntityField as aL, type OrbitalEntity as aM, type OrbitalEntityInput as aN, OrbitalEntitySchema as aO, OrbitalIdSchema as aP, type OsEffect as aQ, PATTERN_TYPES as aR, PageIdSchema as aS, type PaletteEntryId as aT, PaletteEntryIdSchema as aU, type PatternConfig as aV, type PatternProps as aW, type PatternPropsMap as aX, type PatternType as aY, type PersistData as aZ, type PersistEffect as a_, EntityFieldSchema as aa, EntityIdSchema as ab, EntityPersistenceSchema as ac, type EntityRole as ad, EntityRoleSchema as ae, EntitySchema as af, type EntityWith as ag, type EnumEntityField as ah, type EvaluateConfig as ai, type EvaluateEffect as aj, EventIdSchema as ak, FIELD_TYPES as al, type FetchEffect as am, type FetchOptions as an, type FetchResult as ao, type Field as ap, FieldSchema as aq, type FieldType as ar, FieldTypeSchema as as, type ForwardConfig as at, type ForwardEffect as au, type IdForKind as av, type IdKind as aw, IdentityLedgerSchema as ax, type LedgerEntry as ay, LedgerEntrySchema as az, type EventId as b, VisualStyleSchema as b$, type RefEffect as b0, RelationConfigSchema as b1, type RelationEntityField as b2, type RenderChildrenMap as b3, type RenderItemLambda as b4, type RenderUINode as b5, type ResolvedPatternProps as b6, type RestAuthConfig as b7, RestAuthConfigSchema as b8, type RestServiceDef as b9, type SocketServiceDef as bA, SocketServiceDefSchema as bB, type SpawnEffect as bC, type SpriteDirection as bD, SpriteDirectionSchema as bE, type SpriteSheetAtlas as bF, type SpriteSheetAtlasInput as bG, SpriteSheetAtlasSchema as bH, type SubTexture as bI, SubTextureSchema as bJ, type SwapEffect as bK, type TextureAtlas as bL, TextureAtlasSchema as bM, type ThemeId as bN, ThemeIdSchema as bO, type Tilesheet as bP, TilesheetSchema as bQ, type TraceEffect as bR, type TrainConfig as bS, type TrainEffect as bT, TraitIdSchema as bU, type TypedEffect as bV, UISlotSchema as bW, UI_SLOTS as bX, VISUAL_STYLES as bY, type ValidateEffect as bZ, type VisualStyle as b_, RestServiceDefSchema as ba, SEMANTIC_STRING_TYPES as bb, SERVICE_TYPES as bc, SPRITE_DIRECTIONS as bd, type ScalarEntityField as be, type ScenePos as bf, ScenePosSchema as bg, type SemanticAssetRef as bh, type SemanticAssetRefInput as bi, SemanticAssetRefSchema as bj, type SemanticStringType as bk, ServiceDefinitionSchema as bl, type ServiceId as bm, ServiceIdSchema as bn, type ServiceParams as bo, type ServiceParamsValue as bp, type ServiceRefObject as bq, ServiceRefObjectSchema as br, ServiceRefSchema as bs, ServiceRefStringSchema as bt, type ServiceType as bu, ServiceTypeSchema as bv, type SessionEffect as bw, type SetEffect as bx, type SocketEvents as by, SocketEventsSchema as bz, type Effect as c, validateAssetAnimations as c$, type WatchEffect as c0, type WatchOptions as c1, asEntityId as c2, asEventId as c3, asOrbitalId as c4, asPageId as c5, asPaletteEntryId as c6, asServiceId as c7, asThemeId as c8, asTraitId as c9, isSExprEffect as cA, isSemanticStringType as cB, isSemanticStringValue as cC, isServiceId as cD, isServiceReference as cE, isServiceReferenceObject as cF, isSocketService as cG, isThemeId as cH, isTraitId as cI, isUrlValue as cJ, isUuidValue as cK, isValidPatternType as cL, ledgerCurName as cM, ledgerRename as cN, ledgerResolveName as cO, mintId as cP, navigate as cQ, notify as cR, parseAssetKey as cS, parseServiceRef as cT, persist as cU, persistenceModeAllowsOverrides as cV, ref as cW, renderUI as cX, set as cY, spawn as cZ, swap as c_, atomic as ca, callService as cb, createAssetKey as cc, deref as cd, deriveCollection as ce, despawn as cf, doEffects as cg, emit as ch, findService as ci, getDefaultAnimationsForRole as cj, getServiceNames as ck, hasService as cl, idKindOf as cm, idPrefix as cn, isEffect as co, isEmailValue as cp, isEntityId as cq, isEventId as cr, isFieldValue as cs, isMcpService as ct, isOrbitalId as cu, isPageId as cv, isPaletteEntryId as cw, isPhoneValue as cx, isRestService as cy, isRuntimeEntity as cz, type EntityId as d, watch as d0, type Entity as e, type EntityRow as f, type ServiceDefinition as g, type RenderBinding as h, type RenderUIEffect as i, ANIMATION_NAMES as j, ASSET_ASPECTS as k, ASSET_DIMENSIONS as l, type AgentEffect as m, type AnimationDef as n, type AnimationDefInput as o, AnimationDefSchema as p, type AnimationName as q, AnimationNameSchema as r, type ApplicationEffect as s, type ArrayEntityField as t, type Asset as u, type AssetAspect as v, AssetAspectSchema as w, type AssetCatalog as x, type AssetCatalogEntry as y, type AssetCatalogEntryInput as z };