@almadar/core 10.36.0 → 10.38.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.
- package/dist/{builders-CBL9rED-.d.ts → builders-BoyWDFfH.d.ts} +175 -174
- package/dist/builders.d.ts +4 -3
- package/dist/builders.js +30 -17
- package/dist/builders.js.map +1 -1
- package/dist/{effect-Cd6ibbZc.d.ts → effect-5kg4MCeB.d.ts} +33 -1561
- package/dist/entity-CVylqnAf.d.ts +1559 -0
- package/dist/factory/index.d.ts +6 -5
- package/dist/factory/index.js +7 -0
- package/dist/factory/index.js.map +1 -1
- package/dist/factory-runtime/index.d.ts +4 -3
- package/dist/factory-runtime/index.js +30 -17
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +471 -22
- package/dist/index.js.map +1 -1
- package/dist/mock/index.d.ts +119 -0
- package/dist/mock/index.js +695 -0
- package/dist/mock/index.js.map +1 -0
- package/dist/patterns/component-mapping.json +16 -1
- package/dist/patterns/event-contracts.json +1 -1
- package/dist/patterns/index.d.ts +897 -6
- package/dist/patterns/index.js +396 -4
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/integrators-registry.json +21 -1
- package/dist/patterns/patterns-registry.json +355 -1
- package/dist/patterns/registry.json +355 -1
- package/dist/patterns/services-registry.json +104 -0
- package/dist/{trait-X5mQAMtW.d.ts → trait-Bnd3i_2G.d.ts} +69 -40
- package/dist/types/index.d.ts +11 -9
- package/dist/types/index.js +71 -18
- package/dist/types/index.js.map +1 -1
- package/dist/{types-DujRcijG.d.ts → types-BE598tvP.d.ts} +3 -3
- package/package.json +6 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
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-CVylqnAf.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Service Types for Orbital Schema
|
|
@@ -745,1570 +746,13 @@ type ServiceParams = {
|
|
|
745
746
|
[key: string]: ServiceParamsValue;
|
|
746
747
|
};
|
|
747
748
|
|
|
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
|
-
* JSON primitives — the universal "data crossed a boundary" type.
|
|
999
|
-
*
|
|
1000
|
-
* Every value that arrives over the wire from an LLM (tool-call args),
|
|
1001
|
-
* from disk (workspace files), or from an HTTP body before
|
|
1002
|
-
* domain-specific validation is a `JsonValue`. Narrow with a typed
|
|
1003
|
-
* predicate (`is`-guard) at the boundary; don't widen back to `unknown`.
|
|
1004
|
-
*
|
|
1005
|
-
* `JsonObject` and `ToolArgs` are aliases for the common
|
|
1006
|
-
* `Record<string, JsonValue>` shape. `ToolArgs` is the name the
|
|
1007
|
-
* agent surface uses for LLM-emitted tool-call arguments; `JsonObject`
|
|
1008
|
-
* is the general-purpose alias. They are the same type — the alias
|
|
1009
|
-
* exists so call sites read at the right semantic level.
|
|
1010
|
-
*
|
|
1011
|
-
* Why not `Record<string, unknown>`? Two reasons. (1) `unknown` widens
|
|
1012
|
-
* back to anything, which defeats the purpose of typing the boundary.
|
|
1013
|
-
* (2) The `@almadar/eslint-plugin/no-record-string-unknown` rule blocks
|
|
1014
|
-
* the wider form — `JsonValue`-based records are the typed answer.
|
|
1015
|
-
*
|
|
1016
|
-
* @packageDocumentation
|
|
1017
|
-
*/
|
|
1018
|
-
|
|
1019
|
-
/**
|
|
1020
|
-
* Recursive JSON value union — every shape JSON can carry.
|
|
1021
|
-
*/
|
|
1022
|
-
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
1023
|
-
[key: string]: JsonValue;
|
|
1024
|
-
};
|
|
1025
|
-
/**
|
|
1026
|
-
* JSON object — keyed string→JsonValue. The wire form of arbitrary
|
|
1027
|
-
* structured data. Replaces `Record<string, unknown>` at typed
|
|
1028
|
-
* boundaries (LLM emits, file reads, HTTP bodies).
|
|
1029
|
-
*/
|
|
1030
|
-
type JsonObject = {
|
|
1031
|
-
[key: string]: JsonValue;
|
|
1032
|
-
};
|
|
1033
|
-
/**
|
|
1034
|
-
* LLM tool-call arguments — same shape as `JsonObject`, named for the
|
|
1035
|
-
* agent-surface call site. Each tool's `execute(args: ToolArgs)`
|
|
1036
|
-
* receives this and narrows via an `is`-guard predicate before any
|
|
1037
|
-
* field access.
|
|
1038
|
-
*/
|
|
1039
|
-
type ToolArgs = JsonObject;
|
|
1040
|
-
/**
|
|
1041
|
-
* Type guard: is the given value a JSON primitive (non-array,
|
|
1042
|
-
* non-object)? Used by walkers that decide whether to recurse.
|
|
1043
|
-
*/
|
|
1044
|
-
declare function isJsonPrimitive(value: JsonValue): value is string | number | boolean | null;
|
|
1045
|
-
/**
|
|
1046
|
-
* Type guard: is the given value a JSON object (non-array, non-null)?
|
|
1047
|
-
*/
|
|
1048
|
-
declare function isJsonObject(value: JsonValue): value is JsonObject;
|
|
1049
|
-
/**
|
|
1050
|
-
* Type guard: is the given value a JSON array?
|
|
1051
|
-
*/
|
|
1052
|
-
declare function isJsonArray(value: JsonValue): value is JsonValue[];
|
|
1053
|
-
|
|
1054
|
-
/**
|
|
1055
|
-
* Field Types for Orbital Units
|
|
1056
|
-
*
|
|
1057
|
-
* Extracted from schema/data-entities.ts for the orbitals module.
|
|
1058
|
-
* These types define the field structure within orbital entities.
|
|
1059
|
-
*
|
|
1060
|
-
* @packageDocumentation
|
|
1061
|
-
*/
|
|
1062
|
-
|
|
1063
|
-
/**
|
|
1064
|
-
* Supported field types for entity fields.
|
|
1065
|
-
*
|
|
1066
|
-
* @example
|
|
1067
|
-
* { name: 'status', type: 'enum', values: ['draft', 'published'] }
|
|
1068
|
-
* { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
|
|
1069
|
-
*/
|
|
1070
|
-
type FieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'array' | 'object' | 'enum' | 'relation' | 'trait' | 'slot' | 'pattern';
|
|
1071
|
-
declare const FieldTypeSchema: z.ZodEnum<["string", "number", "boolean", "date", "timestamp", "datetime", "array", "object", "enum", "relation", "trait", "slot", "pattern"]>;
|
|
1072
|
-
/**
|
|
1073
|
-
* Cardinality for relation fields.
|
|
1074
|
-
* Matches Rust compiler's Cardinality enum.
|
|
1075
|
-
*/
|
|
1076
|
-
type RelationCardinality = 'one' | 'many' | 'one-to-many' | 'many-to-one' | 'many-to-many';
|
|
1077
|
-
/**
|
|
1078
|
-
* Configuration for relation fields (foreign keys).
|
|
1079
|
-
* Matches Rust compiler's RelationDefinition format.
|
|
1080
|
-
*/
|
|
1081
|
-
type RelationConfig = {
|
|
1082
|
-
/** Target entity name (e.g., 'User', 'Task') - matches Rust's `entity` field */
|
|
1083
|
-
entity: string;
|
|
1084
|
-
/** V4 dual-carry id sibling of `entity` — optional until the Phase-7 flip. */
|
|
1085
|
-
entityId?: EntityId;
|
|
1086
|
-
/** Field on target entity (defaults to 'id') */
|
|
1087
|
-
field?: string;
|
|
1088
|
-
/**
|
|
1089
|
-
* Cardinality: one, many, one-to-many, many-to-one, many-to-many
|
|
1090
|
-
* Matches Rust compiler's cardinality format
|
|
1091
|
-
*/
|
|
1092
|
-
cardinality?: RelationCardinality;
|
|
1093
|
-
/** Delete behavior */
|
|
1094
|
-
onDelete?: 'cascade' | 'nullify' | 'restrict';
|
|
1095
|
-
/**
|
|
1096
|
-
* Foreign key field name (for legacy compatibility).
|
|
1097
|
-
* @deprecated Use field instead
|
|
1098
|
-
*/
|
|
1099
|
-
foreignKey?: string;
|
|
1100
|
-
/**
|
|
1101
|
-
* Target entity name (for legacy compatibility).
|
|
1102
|
-
* @deprecated Use entity instead
|
|
1103
|
-
*/
|
|
1104
|
-
target?: string;
|
|
1105
|
-
/**
|
|
1106
|
-
* Cardinality type alias (for legacy compatibility).
|
|
1107
|
-
* @deprecated Use cardinality instead
|
|
1108
|
-
*/
|
|
1109
|
-
type?: RelationCardinality;
|
|
1110
|
-
};
|
|
1111
|
-
declare const RelationConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
1112
|
-
entity: z.ZodString;
|
|
1113
|
-
entityId: z.ZodOptional<z.ZodEffects<z.ZodString, EntityId, string>>;
|
|
1114
|
-
field: z.ZodOptional<z.ZodString>;
|
|
1115
|
-
cardinality: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
|
|
1116
|
-
onDelete: z.ZodOptional<z.ZodEnum<["cascade", "nullify", "restrict"]>>;
|
|
1117
|
-
foreignKey: z.ZodOptional<z.ZodString>;
|
|
1118
|
-
target: z.ZodOptional<z.ZodString>;
|
|
1119
|
-
type: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
|
|
1120
|
-
}, "strip", z.ZodTypeAny, {
|
|
1121
|
-
entity: string;
|
|
1122
|
-
type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
|
|
1123
|
-
entityId?: EntityId | undefined;
|
|
1124
|
-
field?: string | undefined;
|
|
1125
|
-
cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
|
|
1126
|
-
onDelete?: "cascade" | "nullify" | "restrict" | undefined;
|
|
1127
|
-
foreignKey?: string | undefined;
|
|
1128
|
-
target?: string | undefined;
|
|
1129
|
-
}, {
|
|
1130
|
-
entity: string;
|
|
1131
|
-
type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
|
|
1132
|
-
entityId?: string | undefined;
|
|
1133
|
-
field?: string | undefined;
|
|
1134
|
-
cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
|
|
1135
|
-
onDelete?: "cascade" | "nullify" | "restrict" | undefined;
|
|
1136
|
-
foreignKey?: string | undefined;
|
|
1137
|
-
target?: string | undefined;
|
|
1138
|
-
}>, RelationConfig, {
|
|
1139
|
-
entity: string;
|
|
1140
|
-
type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
|
|
1141
|
-
entityId?: string | undefined;
|
|
1142
|
-
field?: string | undefined;
|
|
1143
|
-
cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
|
|
1144
|
-
onDelete?: "cascade" | "nullify" | "restrict" | undefined;
|
|
1145
|
-
foreignKey?: string | undefined;
|
|
1146
|
-
target?: string | undefined;
|
|
1147
|
-
}>;
|
|
1148
|
-
/**
|
|
1149
|
-
* Field format validators for string fields.
|
|
1150
|
-
*/
|
|
1151
|
-
type FieldFormat = 'email' | 'url' | 'phone' | 'date' | 'datetime' | 'uuid'
|
|
1152
|
-
/** Render hint: this string field stores an image URL. Mock adapters
|
|
1153
|
-
* generate a deterministic picsum.photos URL; UI patterns can branch
|
|
1154
|
-
* to an `<img>` instead of a `<typography>`. */
|
|
1155
|
-
| 'image'
|
|
1156
|
-
/** Render hint: avatar-shaped image (square, small). */
|
|
1157
|
-
| 'avatar'
|
|
1158
|
-
/** Render hint: thumbnail image (small landscape). */
|
|
1159
|
-
| 'thumbnail';
|
|
1160
|
-
declare const FieldFormatSchema: z.ZodEnum<["email", "url", "phone", "date", "datetime", "uuid", "image", "avatar", "thumbnail"]>;
|
|
1161
|
-
/**
|
|
1162
|
-
* Field-type tags that don't carry a type-dependent payload. The base
|
|
1163
|
-
* `EntityField` shape applies as-is.
|
|
1164
|
-
*/
|
|
1165
|
-
type ScalarFieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'trait' | 'slot' | 'pattern';
|
|
1166
|
-
/** Fields shared across every variant. */
|
|
1167
|
-
type EntityFieldBase = {
|
|
1168
|
-
/**
|
|
1169
|
-
* Field name (camelCase). Optional for nested item/property descriptors
|
|
1170
|
-
* where the name is implied by the parent (`items`, `properties[k]`).
|
|
1171
|
-
* Mirrors Rust's `FieldDefinition.name: Option<String>`.
|
|
1172
|
-
*/
|
|
1173
|
-
name?: string;
|
|
1174
|
-
/** Whether the field is required */
|
|
1175
|
-
required?: boolean;
|
|
1176
|
-
/** Default value — parsed from `.orb`, always JSON-shaped. */
|
|
1177
|
-
default?: JsonValue;
|
|
1178
|
-
/** Validation format */
|
|
1179
|
-
format?: FieldFormat;
|
|
1180
|
-
/** Minimum value (for number) or length (for string) */
|
|
1181
|
-
min?: number;
|
|
1182
|
-
/** Maximum value or length */
|
|
1183
|
-
max?: number;
|
|
1184
|
-
/** Object property schemas keyed by property name (for object type).
|
|
1185
|
-
* Mirrors Rust's `FieldDefinition.properties: Option<HashMap<String,
|
|
1186
|
-
* FieldDefinition>>`. Populated by the lolo lowerer when a field /
|
|
1187
|
-
* config slot's type expression resolves to a struct shape
|
|
1188
|
-
* (`TypeExpr::Object`), including named-type aliases like `[MetricSpec]`. */
|
|
1189
|
-
properties?: Record<string, EntityField>;
|
|
1190
|
-
/** Runtime-managed widget state (authored `@intrinsic` in `.lolo`). Exempt
|
|
1191
|
-
* from the explicit-binding rule and never a domain-data bind target. */
|
|
1192
|
-
intrinsic?: boolean;
|
|
1193
|
-
/** Human/semantic description (authored `@description "..."` in `.lolo`).
|
|
1194
|
-
* Authoring/build-time metadata — factory-signature catalog, embeddings,
|
|
1195
|
-
* curation field-matching; the runtime ignores it. */
|
|
1196
|
-
description?: string;
|
|
1197
|
-
/** User-vocabulary synonyms (authored `@synonyms "..."` in `.lolo`).
|
|
1198
|
-
* Free text feeding catalog search / curation field-matching. */
|
|
1199
|
-
synonyms?: string;
|
|
1200
|
-
};
|
|
1201
|
-
/**
|
|
1202
|
-
* Scalar / structural fields — no type-dependent payload required.
|
|
1203
|
-
* `values?` is permitted as an OPTIONAL UI/validation hint (e.g. lolo's
|
|
1204
|
-
* `'a' | 'b' | 'c'` string-union sugar lowers to `type: 'string', values:
|
|
1205
|
-
* [...]`). Only `EnumEntityField` MANDATES values.
|
|
1206
|
-
*/
|
|
1207
|
-
type ScalarEntityField = EntityFieldBase & {
|
|
1208
|
-
type: ScalarFieldType;
|
|
1209
|
-
/** Optional vocabulary hint for scalar fields (e.g. string unions
|
|
1210
|
-
* authored as `'a'|'b'|'c'` in lolo). Not required at this variant. */
|
|
1211
|
-
values?: string[];
|
|
1212
|
-
};
|
|
1213
|
-
/** `type: 'enum'` REQUIRES the closed vocabulary in `values`. */
|
|
1214
|
-
type EnumEntityField = EntityFieldBase & {
|
|
1215
|
-
type: 'enum';
|
|
1216
|
-
/** Closed string vocabulary the field accepts. */
|
|
1217
|
-
values: string[];
|
|
1218
|
-
};
|
|
1219
|
-
/** `type: 'relation'` REQUIRES the relation target binding. */
|
|
1220
|
-
type RelationEntityField = EntityFieldBase & {
|
|
1221
|
-
type: 'relation';
|
|
1222
|
-
/** Relation target binding (entity + cardinality). */
|
|
1223
|
-
relation: RelationConfig;
|
|
1224
|
-
};
|
|
1225
|
-
/** `type: 'array'` — element schema in `items` strongly preferred but
|
|
1226
|
-
* optional for legacy compatibility with codegen-emitted scalar-array
|
|
1227
|
-
* fields (e.g. `{type: 'array', default: []}`). The lolo lowerer + Rust
|
|
1228
|
-
* validator catch typed-element-required cases downstream. */
|
|
1229
|
-
type ArrayEntityField = EntityFieldBase & {
|
|
1230
|
-
type: 'array';
|
|
1231
|
-
/** Element schema for the array. */
|
|
1232
|
-
items?: EntityField;
|
|
1233
|
-
};
|
|
1234
|
-
/**
|
|
1235
|
-
* `type: 'object'` — a fixed-key struct (fields in `properties`) OR a
|
|
1236
|
-
* dynamic-key map (`Map K V` in `.lolo`; the uniform value schema lives in
|
|
1237
|
-
* `items`, mirroring an array's element schema). A distinct variant so `items`
|
|
1238
|
-
* is statically allowed only on object/array fields, never on scalars.
|
|
1239
|
-
*/
|
|
1240
|
-
type ObjectEntityField = EntityFieldBase & {
|
|
1241
|
-
type: 'object';
|
|
1242
|
-
/** Uniform value schema for a dynamic-key map (`Map K V`). */
|
|
1243
|
-
items?: EntityField;
|
|
1244
|
-
};
|
|
1245
|
-
/**
|
|
1246
|
-
* Entity field definition — discriminated union by `type`. Each variant
|
|
1247
|
-
* statically enforces its dependent payload (`values` for enum,
|
|
1248
|
-
* `relation` for relation, `items` for array) so TS / Zod / JSON Schema
|
|
1249
|
-
* consumers all agree on the dependency, not just the Rust validator.
|
|
1250
|
-
*
|
|
1251
|
-
* @example
|
|
1252
|
-
* { name: 'status', type: 'enum', values: ['draft', 'published'] }
|
|
1253
|
-
* { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
|
|
1254
|
-
* { name: 'tags', type: 'array', items: { type: 'string' } }
|
|
1255
|
-
*/
|
|
1256
|
-
type EntityField = ScalarEntityField | EnumEntityField | RelationEntityField | ArrayEntityField | ObjectEntityField;
|
|
1257
|
-
/**
|
|
1258
|
-
* Zod schema for `EntityField`. Preprocess normalizes:
|
|
1259
|
-
* - legacy `type` aliases (text → string, int → number, etc.)
|
|
1260
|
-
* - legacy `enum: string[]` alias → `values: string[]`
|
|
1261
|
-
*
|
|
1262
|
-
* Branches on `type` so TS narrows the parsed output to the matching
|
|
1263
|
-
* discriminated-union variant.
|
|
1264
|
-
*/
|
|
1265
|
-
declare const EntityFieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
|
|
1266
|
-
type EntityFieldInput = z.input<typeof EntityFieldSchema>;
|
|
1267
|
-
/** Alias for EntityField - preferred name */
|
|
1268
|
-
type Field = EntityField;
|
|
1269
|
-
/** Alias for EntityFieldSchema - preferred name */
|
|
1270
|
-
declare const FieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
|
|
1271
|
-
|
|
1272
|
-
/**
|
|
1273
|
-
* Asset Types for Semantic Asset References
|
|
1274
|
-
*
|
|
1275
|
-
* Defines types for abstracting asset paths into semantic references.
|
|
1276
|
-
* Assets are resolved from SemanticAssetRef to actual paths at compile time.
|
|
1277
|
-
*
|
|
1278
|
-
* @packageDocumentation
|
|
1279
|
-
*/
|
|
1280
|
-
|
|
1281
|
-
/**
|
|
1282
|
-
* Entity roles in game contexts
|
|
1283
|
-
*/
|
|
1284
|
-
declare const ENTITY_ROLES: readonly ["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"];
|
|
1285
|
-
type EntityRole = (typeof ENTITY_ROLES)[number];
|
|
1286
|
-
declare const EntityRoleSchema: z.ZodEnum<["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"]>;
|
|
1287
|
-
/**
|
|
1288
|
-
* Visual art styles for games
|
|
1289
|
-
*/
|
|
1290
|
-
declare const VISUAL_STYLES: readonly ["pixel", "vector", "hd", "1-bit", "isometric"];
|
|
1291
|
-
type VisualStyle = (typeof VISUAL_STYLES)[number];
|
|
1292
|
-
declare const VisualStyleSchema: z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>;
|
|
1293
|
-
/**
|
|
1294
|
-
* Whether the asset is a 2D sprite/image or a 3D model. Set by the consuming
|
|
1295
|
-
* canvas: the same entity role is a 2D sprite-sheet on a tile board and a 3D
|
|
1296
|
-
* rigged model on a 3D board.
|
|
1297
|
-
*/
|
|
1298
|
-
declare const ASSET_DIMENSIONS: readonly ["2d", "3d"];
|
|
1299
|
-
type AssetDimension = (typeof ASSET_DIMENSIONS)[number];
|
|
1300
|
-
declare const AssetDimensionSchema: z.ZodEnum<["2d", "3d"]>;
|
|
1301
|
-
/**
|
|
1302
|
-
* Rendering aspect ratio of an asset: square (tiles/sprites/portraits/icons),
|
|
1303
|
-
* 16:9 (scene backdrops), 5:7 (cards), 8:1 (effect frame strips).
|
|
1304
|
-
*/
|
|
1305
|
-
declare const ASSET_ASPECTS: readonly ["1:1", "16:9", "5:7", "8:1"];
|
|
1306
|
-
type AssetAspect = (typeof ASSET_ASPECTS)[number];
|
|
1307
|
-
declare const AssetAspectSchema: z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>;
|
|
1308
|
-
/**
|
|
1309
|
-
* Animation names matching a sprite sheet's row layout. Canonical home for
|
|
1310
|
-
* this vocabulary — `@almadar/ui`'s `spriteAnimationTypes.ts` re-exports it
|
|
1311
|
-
* rather than redeclaring, so board `.lolo` config and the render library
|
|
1312
|
-
* agree on one enum.
|
|
1313
|
-
*/
|
|
1314
|
-
declare const ANIMATION_NAMES: readonly ["idle", "walk", "attack", "hit", "death"];
|
|
1315
|
-
type AnimationName = (typeof ANIMATION_NAMES)[number];
|
|
1316
|
-
declare const AnimationNameSchema: z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>;
|
|
1317
|
-
/** Sheet file directions (physical PNG files a sprite sheet ships as). */
|
|
1318
|
-
declare const SPRITE_DIRECTIONS: readonly ["se", "sw"];
|
|
1319
|
-
type SpriteDirection = (typeof SPRITE_DIRECTIONS)[number];
|
|
1320
|
-
declare const SpriteDirectionSchema: z.ZodEnum<["se", "sw"]>;
|
|
1321
|
-
/**
|
|
1322
|
-
* Definition for a single named animation within a sprite sheet: which row
|
|
1323
|
-
* it occupies, how many frames it has, and its playback rate. This is the
|
|
1324
|
-
* shape actually consumed by `@almadar/ui`'s sprite-sheet renderer
|
|
1325
|
-
* (`spriteAnimation.ts`'s `frameRect`/`getCurrentFrameFromDef`) — moved here
|
|
1326
|
-
* verbatim rather than reconciled with a differently-shaped guess, since
|
|
1327
|
-
* `@almadar/ui`'s version is the one with real production consumers.
|
|
1328
|
-
*/
|
|
1329
|
-
interface AnimationDef {
|
|
1330
|
-
/** Row index in the sprite sheet (0-based; each animation occupies one row). */
|
|
1331
|
-
row: number;
|
|
1332
|
-
/** Number of frames in this animation. */
|
|
1333
|
-
frames: number;
|
|
1334
|
-
/** Frames per second. */
|
|
1335
|
-
frameRate: number;
|
|
1336
|
-
/** Whether the animation loops. */
|
|
1337
|
-
loop: boolean;
|
|
1338
|
-
}
|
|
1339
|
-
declare const AnimationDefSchema: z.ZodObject<{
|
|
1340
|
-
row: z.ZodNumber;
|
|
1341
|
-
frames: z.ZodNumber;
|
|
1342
|
-
frameRate: z.ZodNumber;
|
|
1343
|
-
loop: z.ZodBoolean;
|
|
1344
|
-
}, "strip", z.ZodTypeAny, {
|
|
1345
|
-
row: number;
|
|
1346
|
-
frames: number;
|
|
1347
|
-
frameRate: number;
|
|
1348
|
-
loop: boolean;
|
|
1349
|
-
}, {
|
|
1350
|
-
row: number;
|
|
1351
|
-
frames: number;
|
|
1352
|
-
frameRate: number;
|
|
1353
|
-
loop: boolean;
|
|
1354
|
-
}>;
|
|
1355
|
-
/**
|
|
1356
|
-
* Parsed sprite-sheet atlas JSON — the contract a `spriteSheet`-role `Asset.url`
|
|
1357
|
-
* resolves to when fetched (see `Asset.url` usage in `@almadar/ui`'s
|
|
1358
|
-
* `useUnitSpriteAtlas`). A unit's `sprite?: Asset` stays the static single-pose
|
|
1359
|
-
* image; `spriteSheet?: Asset` is a SEPARATE reference whose URL points at a
|
|
1360
|
-
* `SpriteSheetAtlas`-shaped JSON manifest (e.g. `.../guardian-sprite-sheet.json`),
|
|
1361
|
-
* not a PNG. Frame-cutting geometry lives here, not inlined onto `Asset` — an
|
|
1362
|
-
* `Asset` traveling through `render-ui` every tick stays small.
|
|
1363
|
-
*/
|
|
1364
|
-
interface SpriteSheetAtlas {
|
|
1365
|
-
/** Unit archetype key. */
|
|
1366
|
-
unit?: string;
|
|
1367
|
-
/** Visual type key. */
|
|
1368
|
-
type?: string;
|
|
1369
|
-
/** Width of a single frame in pixels. */
|
|
1370
|
-
frameWidth: number;
|
|
1371
|
-
/** Height of a single frame in pixels. */
|
|
1372
|
-
frameHeight: number;
|
|
1373
|
-
/** Number of columns (frames per row). */
|
|
1374
|
-
columns: number;
|
|
1375
|
-
/** Number of rows (animations). */
|
|
1376
|
-
rows: number;
|
|
1377
|
-
/** Directions present as physical PNG files. */
|
|
1378
|
-
directions: SpriteDirection[];
|
|
1379
|
-
/** Relative PNG sheet paths per direction. */
|
|
1380
|
-
sheets: Partial<Record<SpriteDirection, string>>;
|
|
1381
|
-
/** Animation row layout keyed by animation name. */
|
|
1382
|
-
animations: Partial<Record<AnimationName, AnimationDef>>;
|
|
1383
|
-
}
|
|
1384
|
-
declare const SpriteSheetAtlasSchema: z.ZodObject<{
|
|
1385
|
-
unit: z.ZodOptional<z.ZodString>;
|
|
1386
|
-
type: z.ZodOptional<z.ZodString>;
|
|
1387
|
-
frameWidth: z.ZodNumber;
|
|
1388
|
-
frameHeight: z.ZodNumber;
|
|
1389
|
-
columns: z.ZodNumber;
|
|
1390
|
-
rows: z.ZodNumber;
|
|
1391
|
-
directions: z.ZodArray<z.ZodEnum<["se", "sw"]>, "many">;
|
|
1392
|
-
sheets: z.ZodRecord<z.ZodEnum<["se", "sw"]>, z.ZodString>;
|
|
1393
|
-
animations: z.ZodRecord<z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>, z.ZodObject<{
|
|
1394
|
-
row: z.ZodNumber;
|
|
1395
|
-
frames: z.ZodNumber;
|
|
1396
|
-
frameRate: z.ZodNumber;
|
|
1397
|
-
loop: z.ZodBoolean;
|
|
1398
|
-
}, "strip", z.ZodTypeAny, {
|
|
1399
|
-
row: number;
|
|
1400
|
-
frames: number;
|
|
1401
|
-
frameRate: number;
|
|
1402
|
-
loop: boolean;
|
|
1403
|
-
}, {
|
|
1404
|
-
row: number;
|
|
1405
|
-
frames: number;
|
|
1406
|
-
frameRate: number;
|
|
1407
|
-
loop: boolean;
|
|
1408
|
-
}>>;
|
|
1409
|
-
}, "strip", z.ZodTypeAny, {
|
|
1410
|
-
frameWidth: number;
|
|
1411
|
-
frameHeight: number;
|
|
1412
|
-
columns: number;
|
|
1413
|
-
rows: number;
|
|
1414
|
-
directions: ("se" | "sw")[];
|
|
1415
|
-
sheets: Partial<Record<"se" | "sw", string>>;
|
|
1416
|
-
animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
|
|
1417
|
-
row: number;
|
|
1418
|
-
frames: number;
|
|
1419
|
-
frameRate: number;
|
|
1420
|
-
loop: boolean;
|
|
1421
|
-
}>>;
|
|
1422
|
-
type?: string | undefined;
|
|
1423
|
-
unit?: string | undefined;
|
|
1424
|
-
}, {
|
|
1425
|
-
frameWidth: number;
|
|
1426
|
-
frameHeight: number;
|
|
1427
|
-
columns: number;
|
|
1428
|
-
rows: number;
|
|
1429
|
-
directions: ("se" | "sw")[];
|
|
1430
|
-
sheets: Partial<Record<"se" | "sw", string>>;
|
|
1431
|
-
animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
|
|
1432
|
-
row: number;
|
|
1433
|
-
frames: number;
|
|
1434
|
-
frameRate: number;
|
|
1435
|
-
loop: boolean;
|
|
1436
|
-
}>>;
|
|
1437
|
-
type?: string | undefined;
|
|
1438
|
-
unit?: string | undefined;
|
|
1439
|
-
}>;
|
|
1440
|
-
/**
|
|
1441
|
-
* One named sub-rectangle inside a packed sheet. Mirrors the ShoeBox /
|
|
1442
|
-
* TexturePacker `<SubTexture>` element every Kenney `Spritesheet/*.xml` ships
|
|
1443
|
-
* (`x`/`y`/`width`/`height` = the rect in the sheet PNG; `frameX`/`frameY`/
|
|
1444
|
-
* `frameWidth`/`frameHeight` = the trim/pad offsets for sprites packed with
|
|
1445
|
-
* transparent edges removed — optional, present only on trimmed atlases).
|
|
1446
|
-
*/
|
|
1447
|
-
interface SubTexture {
|
|
1448
|
-
x: number;
|
|
1449
|
-
y: number;
|
|
1450
|
-
width: number;
|
|
1451
|
-
height: number;
|
|
1452
|
-
frameX?: number;
|
|
1453
|
-
frameY?: number;
|
|
1454
|
-
frameWidth?: number;
|
|
1455
|
-
frameHeight?: number;
|
|
1456
|
-
}
|
|
1457
|
-
declare const SubTextureSchema: z.ZodObject<{
|
|
1458
|
-
x: z.ZodNumber;
|
|
1459
|
-
y: z.ZodNumber;
|
|
1460
|
-
width: z.ZodNumber;
|
|
1461
|
-
height: z.ZodNumber;
|
|
1462
|
-
frameX: z.ZodOptional<z.ZodNumber>;
|
|
1463
|
-
frameY: z.ZodOptional<z.ZodNumber>;
|
|
1464
|
-
frameWidth: z.ZodOptional<z.ZodNumber>;
|
|
1465
|
-
frameHeight: z.ZodOptional<z.ZodNumber>;
|
|
1466
|
-
}, "strip", z.ZodTypeAny, {
|
|
1467
|
-
x: number;
|
|
1468
|
-
y: number;
|
|
1469
|
-
width: number;
|
|
1470
|
-
height: number;
|
|
1471
|
-
frameWidth?: number | undefined;
|
|
1472
|
-
frameHeight?: number | undefined;
|
|
1473
|
-
frameX?: number | undefined;
|
|
1474
|
-
frameY?: number | undefined;
|
|
1475
|
-
}, {
|
|
1476
|
-
x: number;
|
|
1477
|
-
y: number;
|
|
1478
|
-
width: number;
|
|
1479
|
-
height: number;
|
|
1480
|
-
frameWidth?: number | undefined;
|
|
1481
|
-
frameHeight?: number | undefined;
|
|
1482
|
-
frameX?: number | undefined;
|
|
1483
|
-
frameY?: number | undefined;
|
|
1484
|
-
}>;
|
|
1485
|
-
/**
|
|
1486
|
-
* A packed sheet + its named sub-rectangles — the canonical parse target for a
|
|
1487
|
-
* Kenney `Spritesheet/*.xml` atlas. A STATIC tile/prop/UI Asset references one
|
|
1488
|
-
* of these: `{ url: <sheet.png>, atlas: <this.json>, sprite: "grass.png" }` →
|
|
1489
|
-
* the renderer fetches the sheet + atlas ONCE and blits the named sub-rect,
|
|
1490
|
-
* instead of loading N individual PNGs. (Animated actors use `SpriteSheetAtlas`
|
|
1491
|
-
* instead; a uniform-grid tile page uses `Tilesheet`.)
|
|
1492
|
-
*/
|
|
1493
|
-
interface TextureAtlas {
|
|
1494
|
-
/** Relative path to the sheet PNG the sub-rects index into (the atlas's own `imagePath`). */
|
|
1495
|
-
imagePath: string;
|
|
1496
|
-
/** Sub-rectangles keyed by their atlas name (e.g. `"grass.png"`). */
|
|
1497
|
-
subTextures: Record<string, SubTexture>;
|
|
1498
|
-
}
|
|
1499
|
-
declare const TextureAtlasSchema: z.ZodObject<{
|
|
1500
|
-
imagePath: z.ZodString;
|
|
1501
|
-
subTextures: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1502
|
-
x: z.ZodNumber;
|
|
1503
|
-
y: z.ZodNumber;
|
|
1504
|
-
width: z.ZodNumber;
|
|
1505
|
-
height: z.ZodNumber;
|
|
1506
|
-
frameX: z.ZodOptional<z.ZodNumber>;
|
|
1507
|
-
frameY: z.ZodOptional<z.ZodNumber>;
|
|
1508
|
-
frameWidth: z.ZodOptional<z.ZodNumber>;
|
|
1509
|
-
frameHeight: z.ZodOptional<z.ZodNumber>;
|
|
1510
|
-
}, "strip", z.ZodTypeAny, {
|
|
1511
|
-
x: number;
|
|
1512
|
-
y: number;
|
|
1513
|
-
width: number;
|
|
1514
|
-
height: number;
|
|
1515
|
-
frameWidth?: number | undefined;
|
|
1516
|
-
frameHeight?: number | undefined;
|
|
1517
|
-
frameX?: number | undefined;
|
|
1518
|
-
frameY?: number | undefined;
|
|
1519
|
-
}, {
|
|
1520
|
-
x: number;
|
|
1521
|
-
y: number;
|
|
1522
|
-
width: number;
|
|
1523
|
-
height: number;
|
|
1524
|
-
frameWidth?: number | undefined;
|
|
1525
|
-
frameHeight?: number | undefined;
|
|
1526
|
-
frameX?: number | undefined;
|
|
1527
|
-
frameY?: number | undefined;
|
|
1528
|
-
}>>;
|
|
1529
|
-
}, "strip", z.ZodTypeAny, {
|
|
1530
|
-
imagePath: string;
|
|
1531
|
-
subTextures: Record<string, {
|
|
1532
|
-
x: number;
|
|
1533
|
-
y: number;
|
|
1534
|
-
width: number;
|
|
1535
|
-
height: number;
|
|
1536
|
-
frameWidth?: number | undefined;
|
|
1537
|
-
frameHeight?: number | undefined;
|
|
1538
|
-
frameX?: number | undefined;
|
|
1539
|
-
frameY?: number | undefined;
|
|
1540
|
-
}>;
|
|
1541
|
-
}, {
|
|
1542
|
-
imagePath: string;
|
|
1543
|
-
subTextures: Record<string, {
|
|
1544
|
-
x: number;
|
|
1545
|
-
y: number;
|
|
1546
|
-
width: number;
|
|
1547
|
-
height: number;
|
|
1548
|
-
frameWidth?: number | undefined;
|
|
1549
|
-
frameHeight?: number | undefined;
|
|
1550
|
-
frameX?: number | undefined;
|
|
1551
|
-
frameY?: number | undefined;
|
|
1552
|
-
}>;
|
|
1553
|
-
}>;
|
|
1554
|
-
/**
|
|
1555
|
-
* A uniform-grid tile page — the shape a Kenney `Tilesheet/` sheet takes (e.g.
|
|
1556
|
-
* Pirate Pack: "each tile is 64×64, no margin"). Tiles are cut by `(col,row)`
|
|
1557
|
-
* index rather than by named rect. `names` is present only when a sibling
|
|
1558
|
-
* `.xml`/`.txt` supplies an index→name list; otherwise a tile is addressed by
|
|
1559
|
-
* its `"col,row"` (or flat index) via `Asset.sprite`.
|
|
1560
|
-
*/
|
|
1561
|
-
interface Tilesheet {
|
|
1562
|
-
/** Relative path to the tile sheet PNG. */
|
|
1563
|
-
imagePath: string;
|
|
1564
|
-
/** Width of one tile cell in pixels. */
|
|
1565
|
-
tileWidth: number;
|
|
1566
|
-
/** Height of one tile cell in pixels. */
|
|
1567
|
-
tileHeight: number;
|
|
1568
|
-
/** Number of columns in the grid. */
|
|
1569
|
-
columns: number;
|
|
1570
|
-
/** Number of rows in the grid. */
|
|
1571
|
-
rows: number;
|
|
1572
|
-
/** Outer margin before the first tile, in pixels (default 0). */
|
|
1573
|
-
margin?: number;
|
|
1574
|
-
/** Gap between adjacent tiles, in pixels (default 0). */
|
|
1575
|
-
spacing?: number;
|
|
1576
|
-
/** Optional index→name labels when a descriptor supplies them. */
|
|
1577
|
-
names?: string[];
|
|
1578
|
-
}
|
|
1579
|
-
declare const TilesheetSchema: z.ZodObject<{
|
|
1580
|
-
imagePath: z.ZodString;
|
|
1581
|
-
tileWidth: z.ZodNumber;
|
|
1582
|
-
tileHeight: z.ZodNumber;
|
|
1583
|
-
columns: z.ZodNumber;
|
|
1584
|
-
rows: z.ZodNumber;
|
|
1585
|
-
margin: z.ZodOptional<z.ZodNumber>;
|
|
1586
|
-
spacing: z.ZodOptional<z.ZodNumber>;
|
|
1587
|
-
names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1588
|
-
}, "strip", z.ZodTypeAny, {
|
|
1589
|
-
columns: number;
|
|
1590
|
-
rows: number;
|
|
1591
|
-
imagePath: string;
|
|
1592
|
-
tileWidth: number;
|
|
1593
|
-
tileHeight: number;
|
|
1594
|
-
margin?: number | undefined;
|
|
1595
|
-
spacing?: number | undefined;
|
|
1596
|
-
names?: string[] | undefined;
|
|
1597
|
-
}, {
|
|
1598
|
-
columns: number;
|
|
1599
|
-
rows: number;
|
|
1600
|
-
imagePath: string;
|
|
1601
|
-
tileWidth: number;
|
|
1602
|
-
tileHeight: number;
|
|
1603
|
-
margin?: number | undefined;
|
|
1604
|
-
spacing?: number | undefined;
|
|
1605
|
-
names?: string[] | undefined;
|
|
1606
|
-
}>;
|
|
1607
|
-
/**
|
|
1608
|
-
* Semantic reference to an asset (not a hardcoded path).
|
|
1609
|
-
* Resolved to actual paths at compile time via asset maps.
|
|
1610
|
-
*/
|
|
1611
|
-
type SemanticAssetRef = {
|
|
1612
|
-
/**
|
|
1613
|
-
* Entity role — a free string. Core no longer constrains the vocabulary to
|
|
1614
|
-
* `EntityRole` (that enum stays an exported shared reference for the asset
|
|
1615
|
-
* tool + renderer); genre boards may use their own roles (`boss`, `tower`, …).
|
|
1616
|
-
*/
|
|
1617
|
-
role: string;
|
|
1618
|
-
/** Sub-category within role (hero, slime, coin, etc.) */
|
|
1619
|
-
category: string;
|
|
1620
|
-
/** Required animations for this entity */
|
|
1621
|
-
animations?: string[];
|
|
1622
|
-
/** Visual style preference */
|
|
1623
|
-
style?: VisualStyle;
|
|
1624
|
-
/** Variant identifier (for multiple versions) */
|
|
1625
|
-
variant?: string;
|
|
1626
|
-
/** 2D sprite vs 3D model — the rendering dimension the consuming canvas needs. */
|
|
1627
|
-
dimension?: AssetDimension;
|
|
1628
|
-
/** Rendering aspect ratio (square sprite/portrait/tile, 16:9 backdrop, 5:7 card, 8:1 fx-strip). */
|
|
1629
|
-
aspect?: AssetAspect;
|
|
1630
|
-
};
|
|
1631
|
-
declare const SemanticAssetRefSchema: z.ZodObject<{
|
|
1632
|
-
role: z.ZodString;
|
|
1633
|
-
category: z.ZodString;
|
|
1634
|
-
animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1635
|
-
style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
|
|
1636
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
1637
|
-
dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
|
|
1638
|
-
aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
|
|
1639
|
-
}, "strip", z.ZodTypeAny, {
|
|
1640
|
-
role: string;
|
|
1641
|
-
category: string;
|
|
1642
|
-
animations?: string[] | undefined;
|
|
1643
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
1644
|
-
variant?: string | undefined;
|
|
1645
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1646
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1647
|
-
}, {
|
|
1648
|
-
role: string;
|
|
1649
|
-
category: string;
|
|
1650
|
-
animations?: string[] | undefined;
|
|
1651
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
1652
|
-
variant?: string | undefined;
|
|
1653
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1654
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1655
|
-
}>;
|
|
1656
|
-
/**
|
|
1657
|
-
* The single asset type: a `SemanticAssetRef` (role/dimension/animations/aspect/style)
|
|
1658
|
-
* WITH its resolved URL folded in. Used everywhere an asset is referenced — a lolo
|
|
1659
|
-
* board `assetManifest` (`Map string Asset`), every `@almadar/ui` game prop, the
|
|
1660
|
-
* asset-workflow's resolved/pool assets, and the inspector picker. Replaces the bare
|
|
1661
|
-
* `AssetUrl`-string asset field so the render metadata travels WITH the asset (no
|
|
1662
|
-
* pixel-dimension or filename heuristics needed to know sheet-vs-frame / 2d-vs-3d).
|
|
1663
|
-
*/
|
|
1664
|
-
interface Asset extends SemanticAssetRef {
|
|
1665
|
-
/** The resolved asset URL. When `atlas`/`sprite` are set this is the SHEET png; otherwise a standalone image. */
|
|
1666
|
-
url: AssetUrl;
|
|
1667
|
-
/**
|
|
1668
|
-
* Optional atlas JSON (a `TextureAtlas` or `Tilesheet`) that slices `url`.
|
|
1669
|
-
* When present with `sprite`, the renderer fetches sheet + atlas once and
|
|
1670
|
-
* blits one sub-rect instead of loading a standalone PNG. Absent → `url` is
|
|
1671
|
-
* a plain whole-image asset (the existing, non-atlas path).
|
|
1672
|
-
*/
|
|
1673
|
-
atlas?: AssetUrl;
|
|
1674
|
-
/**
|
|
1675
|
-
* The sub-texture selector within `atlas`: a `SubTexture` name for a
|
|
1676
|
-
* `TextureAtlas` (e.g. `"grass.png"`), or a `"col,row"`/flat index for a
|
|
1677
|
-
* `Tilesheet`. Only meaningful alongside `atlas`.
|
|
1678
|
-
*/
|
|
1679
|
-
sprite?: string;
|
|
1680
|
-
/** Optional display name (inspector picker). */
|
|
1681
|
-
name?: string;
|
|
1682
|
-
/** Optional thumbnail URL (inspector picker grid). */
|
|
1683
|
-
thumbnailUrl?: string;
|
|
1684
|
-
}
|
|
1685
|
-
declare const AssetSchema: z.ZodObject<{
|
|
1686
|
-
role: z.ZodString;
|
|
1687
|
-
category: z.ZodString;
|
|
1688
|
-
animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1689
|
-
style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
|
|
1690
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
1691
|
-
dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
|
|
1692
|
-
aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
|
|
1693
|
-
} & {
|
|
1694
|
-
url: z.ZodString;
|
|
1695
|
-
atlas: z.ZodOptional<z.ZodString>;
|
|
1696
|
-
sprite: z.ZodOptional<z.ZodString>;
|
|
1697
|
-
name: z.ZodOptional<z.ZodString>;
|
|
1698
|
-
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
1699
|
-
}, "strip", z.ZodTypeAny, {
|
|
1700
|
-
url: string;
|
|
1701
|
-
role: string;
|
|
1702
|
-
category: string;
|
|
1703
|
-
name?: string | undefined;
|
|
1704
|
-
animations?: string[] | undefined;
|
|
1705
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
1706
|
-
variant?: string | undefined;
|
|
1707
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1708
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1709
|
-
atlas?: string | undefined;
|
|
1710
|
-
sprite?: string | undefined;
|
|
1711
|
-
thumbnailUrl?: string | undefined;
|
|
1712
|
-
}, {
|
|
1713
|
-
url: string;
|
|
1714
|
-
role: string;
|
|
1715
|
-
category: string;
|
|
1716
|
-
name?: string | undefined;
|
|
1717
|
-
animations?: string[] | undefined;
|
|
1718
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
1719
|
-
variant?: string | undefined;
|
|
1720
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1721
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1722
|
-
atlas?: string | undefined;
|
|
1723
|
-
sprite?: string | undefined;
|
|
1724
|
-
thumbnailUrl?: string | undefined;
|
|
1725
|
-
}>;
|
|
1726
|
-
/**
|
|
1727
|
-
* Single browsable asset in the inspector picker catalog.
|
|
1728
|
-
* Backs the asset/icon pickers — a flat list the inspector renders for
|
|
1729
|
-
* the user to choose from when a config field's type is `'asset'`.
|
|
1730
|
-
*/
|
|
1731
|
-
interface AssetCatalogEntry {
|
|
1732
|
-
/** Resolvable URL to the asset. */
|
|
1733
|
-
url: string;
|
|
1734
|
-
/** Display name for the asset. */
|
|
1735
|
-
name: string;
|
|
1736
|
-
/** Grouping category within the catalog. */
|
|
1737
|
-
category: string;
|
|
1738
|
-
/** Asset kind the picker dispatches on. */
|
|
1739
|
-
kind: 'image' | 'spritesheet' | 'audio' | 'scene' | 'portrait' | 'model' | 'other';
|
|
1740
|
-
/** Optional thumbnail URL for grid previews. */
|
|
1741
|
-
thumbnailUrl?: string;
|
|
1742
|
-
/** 2D sprite vs 3D model — the asset's actual rendering dimension. */
|
|
1743
|
-
dimension?: AssetDimension;
|
|
1744
|
-
/** The asset's actual rendering aspect ratio. */
|
|
1745
|
-
aspect?: AssetAspect;
|
|
1746
|
-
}
|
|
1747
|
-
declare const AssetCatalogEntrySchema: z.ZodObject<{
|
|
1748
|
-
url: z.ZodString;
|
|
1749
|
-
name: z.ZodString;
|
|
1750
|
-
category: z.ZodString;
|
|
1751
|
-
kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
|
|
1752
|
-
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
1753
|
-
dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
|
|
1754
|
-
aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
|
|
1755
|
-
}, "strip", z.ZodTypeAny, {
|
|
1756
|
-
kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
|
|
1757
|
-
url: string;
|
|
1758
|
-
name: string;
|
|
1759
|
-
category: string;
|
|
1760
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1761
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1762
|
-
thumbnailUrl?: string | undefined;
|
|
1763
|
-
}, {
|
|
1764
|
-
kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
|
|
1765
|
-
url: string;
|
|
1766
|
-
name: string;
|
|
1767
|
-
category: string;
|
|
1768
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1769
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1770
|
-
thumbnailUrl?: string | undefined;
|
|
1771
|
-
}>;
|
|
1772
|
-
/**
|
|
1773
|
-
* Flat list of browsable assets surfaced by the inspector pickers.
|
|
1774
|
-
*/
|
|
1775
|
-
type AssetCatalog = AssetCatalogEntry[];
|
|
1776
|
-
declare const AssetCatalogSchema: z.ZodArray<z.ZodObject<{
|
|
1777
|
-
url: z.ZodString;
|
|
1778
|
-
name: z.ZodString;
|
|
1779
|
-
category: z.ZodString;
|
|
1780
|
-
kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
|
|
1781
|
-
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
1782
|
-
dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
|
|
1783
|
-
aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
|
|
1784
|
-
}, "strip", z.ZodTypeAny, {
|
|
1785
|
-
kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
|
|
1786
|
-
url: string;
|
|
1787
|
-
name: string;
|
|
1788
|
-
category: string;
|
|
1789
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1790
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1791
|
-
thumbnailUrl?: string | undefined;
|
|
1792
|
-
}, {
|
|
1793
|
-
kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
|
|
1794
|
-
url: string;
|
|
1795
|
-
name: string;
|
|
1796
|
-
category: string;
|
|
1797
|
-
dimension?: "2d" | "3d" | undefined;
|
|
1798
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
1799
|
-
thumbnailUrl?: string | undefined;
|
|
1800
|
-
}>, "many">;
|
|
1801
|
-
/**
|
|
1802
|
-
* Asset-reference URL marker. A plain alias over `string` — the value is a
|
|
1803
|
-
* resolvable asset URL — but the named type lets the pattern-sync tool
|
|
1804
|
-
* (`tools/almadar-pattern-sync/parser.ts`) detect a component prop as an asset
|
|
1805
|
-
* field (tagged `asset`) the same way `EventKey`/`LucideIcon` are detected by
|
|
1806
|
-
* type identity. Components annotate image/url props as `AssetUrl` (`src`,
|
|
1807
|
-
* `backgroundImage`, `avatar`, …); the generator emits a `string` config knob
|
|
1808
|
-
* declared as the `asset` config type, which the property inspector dispatches
|
|
1809
|
-
* an AssetPicker on. Not branded — asset urls originate from user data, so cast
|
|
1810
|
-
* friction would buy nothing; the value is the marker the tool finds.
|
|
1811
|
-
*/
|
|
1812
|
-
type AssetUrl = string;
|
|
1813
|
-
/**
|
|
1814
|
-
* A neutral position in scene space: 2D (`x`,`y`) or optionally 3D (`x`,`y`,`z`).
|
|
1815
|
-
* The single coordinate type shared by every drawable descriptor and camera pose
|
|
1816
|
-
* across the 2D and 3D canvas hosts, so a scene composes from the same `{x,y,z?}`
|
|
1817
|
-
* regardless of projection or painter. Logical, not pixel — the host's projector
|
|
1818
|
-
* maps a `ScenePos` to screen space.
|
|
1819
|
-
*/
|
|
1820
|
-
interface ScenePos {
|
|
1821
|
-
x: number;
|
|
1822
|
-
y: number;
|
|
1823
|
-
z?: number;
|
|
1824
|
-
}
|
|
1825
|
-
declare const ScenePosSchema: z.ZodObject<{
|
|
1826
|
-
x: z.ZodNumber;
|
|
1827
|
-
y: z.ZodNumber;
|
|
1828
|
-
z: z.ZodOptional<z.ZodNumber>;
|
|
1829
|
-
}, "strip", z.ZodTypeAny, {
|
|
1830
|
-
x: number;
|
|
1831
|
-
y: number;
|
|
1832
|
-
z?: number | undefined;
|
|
1833
|
-
}, {
|
|
1834
|
-
x: number;
|
|
1835
|
-
y: number;
|
|
1836
|
-
z?: number | undefined;
|
|
1837
|
-
}>;
|
|
1838
|
-
/**
|
|
1839
|
-
* Camera behaviors, unifying the former per-host vocab (2D `camera` string +
|
|
1840
|
-
* 3D `cameraMode`). `isometric`/`top-down` are fixed framings; `follow`/`chase`
|
|
1841
|
-
* track a target; `perspective` is the 3D dramatic framing.
|
|
1842
|
-
*/
|
|
1843
|
-
declare const CAMERA_MODES: readonly ["isometric", "perspective", "top-down", "follow", "chase"];
|
|
1844
|
-
type CameraMode = (typeof CAMERA_MODES)[number];
|
|
1845
|
-
declare const CameraModeSchema: z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>;
|
|
1846
|
-
/**
|
|
1847
|
-
* A neutral camera pose shared by the 2D and 3D canvas hosts, so `type: canvas`
|
|
1848
|
-
* carries one camera object regardless of painter. `pos`/`target` are `ScenePos`
|
|
1849
|
-
* (logical scene space, not pixels); `zoom` scales the view (the former `scale`);
|
|
1850
|
-
* `fov` is the 3D field of view; `mode` selects the framing/tracking behavior.
|
|
1851
|
-
* Every field is optional — an omitted camera means the host's default framing.
|
|
1852
|
-
*/
|
|
1853
|
-
interface Camera {
|
|
1854
|
-
pos?: ScenePos;
|
|
1855
|
-
target?: ScenePos;
|
|
1856
|
-
zoom?: number;
|
|
1857
|
-
fov?: number;
|
|
1858
|
-
mode?: CameraMode;
|
|
1859
|
-
}
|
|
1860
|
-
declare const CameraSchema: z.ZodObject<{
|
|
1861
|
-
pos: z.ZodOptional<z.ZodObject<{
|
|
1862
|
-
x: z.ZodNumber;
|
|
1863
|
-
y: z.ZodNumber;
|
|
1864
|
-
z: z.ZodOptional<z.ZodNumber>;
|
|
1865
|
-
}, "strip", z.ZodTypeAny, {
|
|
1866
|
-
x: number;
|
|
1867
|
-
y: number;
|
|
1868
|
-
z?: number | undefined;
|
|
1869
|
-
}, {
|
|
1870
|
-
x: number;
|
|
1871
|
-
y: number;
|
|
1872
|
-
z?: number | undefined;
|
|
1873
|
-
}>>;
|
|
1874
|
-
target: z.ZodOptional<z.ZodObject<{
|
|
1875
|
-
x: z.ZodNumber;
|
|
1876
|
-
y: z.ZodNumber;
|
|
1877
|
-
z: z.ZodOptional<z.ZodNumber>;
|
|
1878
|
-
}, "strip", z.ZodTypeAny, {
|
|
1879
|
-
x: number;
|
|
1880
|
-
y: number;
|
|
1881
|
-
z?: number | undefined;
|
|
1882
|
-
}, {
|
|
1883
|
-
x: number;
|
|
1884
|
-
y: number;
|
|
1885
|
-
z?: number | undefined;
|
|
1886
|
-
}>>;
|
|
1887
|
-
zoom: z.ZodOptional<z.ZodNumber>;
|
|
1888
|
-
fov: z.ZodOptional<z.ZodNumber>;
|
|
1889
|
-
mode: z.ZodOptional<z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>>;
|
|
1890
|
-
}, "strip", z.ZodTypeAny, {
|
|
1891
|
-
target?: {
|
|
1892
|
-
x: number;
|
|
1893
|
-
y: number;
|
|
1894
|
-
z?: number | undefined;
|
|
1895
|
-
} | undefined;
|
|
1896
|
-
pos?: {
|
|
1897
|
-
x: number;
|
|
1898
|
-
y: number;
|
|
1899
|
-
z?: number | undefined;
|
|
1900
|
-
} | undefined;
|
|
1901
|
-
zoom?: number | undefined;
|
|
1902
|
-
fov?: number | undefined;
|
|
1903
|
-
mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
|
|
1904
|
-
}, {
|
|
1905
|
-
target?: {
|
|
1906
|
-
x: number;
|
|
1907
|
-
y: number;
|
|
1908
|
-
z?: number | undefined;
|
|
1909
|
-
} | undefined;
|
|
1910
|
-
pos?: {
|
|
1911
|
-
x: number;
|
|
1912
|
-
y: number;
|
|
1913
|
-
z?: number | undefined;
|
|
1914
|
-
} | undefined;
|
|
1915
|
-
zoom?: number | undefined;
|
|
1916
|
-
fov?: number | undefined;
|
|
1917
|
-
mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
|
|
1918
|
-
}>;
|
|
1919
|
-
type SemanticAssetRefInput = z.input<typeof SemanticAssetRefSchema>;
|
|
1920
|
-
type AnimationDefInput = z.input<typeof AnimationDefSchema>;
|
|
1921
|
-
type AssetCatalogEntryInput = z.input<typeof AssetCatalogEntrySchema>;
|
|
1922
|
-
type SpriteSheetAtlasInput = z.input<typeof SpriteSheetAtlasSchema>;
|
|
1923
|
-
/**
|
|
1924
|
-
* Creates a semantic asset key from role and category.
|
|
1925
|
-
*
|
|
1926
|
-
* Generates a unique asset identifier by combining role and category
|
|
1927
|
-
* with a colon separator. Used for asset management and lookup.
|
|
1928
|
-
*
|
|
1929
|
-
* @param {EntityRole} role - Entity role (e.g., 'player', 'enemy')
|
|
1930
|
-
* @param {string} category - Asset category (e.g., 'sprite', 'animation')
|
|
1931
|
-
* @returns {string} Asset key in format 'role:category'
|
|
1932
|
-
*
|
|
1933
|
-
* @example
|
|
1934
|
-
* createAssetKey('player', 'sprite'); // returns 'player:sprite'
|
|
1935
|
-
* createAssetKey('enemy', 'animation'); // returns 'enemy:animation'
|
|
1936
|
-
*/
|
|
1937
|
-
declare function createAssetKey(role: EntityRole, category: string): string;
|
|
1938
|
-
/**
|
|
1939
|
-
* Parses an asset key into role and category components.
|
|
1940
|
-
*
|
|
1941
|
-
* Deconstructs an asset key string (format 'role:category') into its
|
|
1942
|
-
* constituent parts. Returns null if the key format is invalid.
|
|
1943
|
-
*
|
|
1944
|
-
* @param {string} key - Asset key in format 'role:category'
|
|
1945
|
-
* @returns {{ role: string; category: string } | null} Parsed components or null
|
|
1946
|
-
*
|
|
1947
|
-
* @example
|
|
1948
|
-
* parseAssetKey('player:sprite'); // returns { role: 'player', category: 'sprite' }
|
|
1949
|
-
* parseAssetKey('enemy:animation'); // returns { role: 'enemy', category: 'animation' }
|
|
1950
|
-
* parseAssetKey('invalid'); // returns null
|
|
1951
|
-
*/
|
|
1952
|
-
declare function parseAssetKey(key: string): {
|
|
1953
|
-
role: string;
|
|
1954
|
-
category: string;
|
|
1955
|
-
} | null;
|
|
1956
|
-
/**
|
|
1957
|
-
* Gets common animations for an entity role.
|
|
1958
|
-
*
|
|
1959
|
-
* Returns an array of default animation names appropriate for the
|
|
1960
|
-
* specified entity role. Used for asset configuration and validation.
|
|
1961
|
-
*
|
|
1962
|
-
* @param {EntityRole} role - Entity role
|
|
1963
|
-
* @returns {string[]} Array of default animation names
|
|
1964
|
-
*
|
|
1965
|
-
* @example
|
|
1966
|
-
* getDefaultAnimationsForRole('player'); // returns ['idle', 'run', 'jump', 'fall', 'attack', 'hurt', 'die']
|
|
1967
|
-
* getDefaultAnimationsForRole('enemy'); // returns ['idle', 'walk', 'attack', 'hurt', 'die']
|
|
1968
|
-
*/
|
|
1969
|
-
declare function getDefaultAnimationsForRole(role: EntityRole): string[];
|
|
1970
|
-
/**
|
|
1971
|
-
* Validates that an asset reference has required animations.
|
|
1972
|
-
*
|
|
1973
|
-
* Checks if an asset reference contains all required animations.
|
|
1974
|
-
* Returns an error message if validation fails, or null if valid.
|
|
1975
|
-
*
|
|
1976
|
-
* @param {SemanticAssetRef} assetRef - Asset reference to validate
|
|
1977
|
-
* @param {string[]} requiredAnimations - Required animation names
|
|
1978
|
-
* @returns {string | null} Error message or null if valid
|
|
1979
|
-
*
|
|
1980
|
-
* @example
|
|
1981
|
-
* validateAssetAnimations(assetRef, ['idle', 'run']); // returns null if valid
|
|
1982
|
-
* validateAssetAnimations(assetRef, ['missing-animation']); // returns error message
|
|
1983
|
-
*/
|
|
1984
|
-
declare function validateAssetAnimations(assetRef: SemanticAssetRef, requiredAnimations: string[]): {
|
|
1985
|
-
valid: boolean;
|
|
1986
|
-
missing: string[];
|
|
1987
|
-
};
|
|
1988
|
-
|
|
1989
|
-
/**
|
|
1990
|
-
* Entity Types for Orbital Units
|
|
1991
|
-
*
|
|
1992
|
-
* Defines the OrbitalEntity type - the nucleus of an Orbital Unit.
|
|
1993
|
-
*
|
|
1994
|
-
* @packageDocumentation
|
|
1995
|
-
*/
|
|
1996
|
-
|
|
1997
|
-
/**
|
|
1998
|
-
* Entity persistence types.
|
|
1999
|
-
*
|
|
2000
|
-
* - persistent: Stored in database (has collection)
|
|
2001
|
-
* - runtime: Exists only at runtime (not persisted)
|
|
2002
|
-
*/
|
|
2003
|
-
type EntityPersistence = 'persistent' | 'runtime';
|
|
2004
|
-
declare const EntityPersistenceSchema: z.ZodEnum<["persistent", "runtime"]>;
|
|
2005
|
-
/**
|
|
2006
|
-
* OrbitalEntity - the nucleus of an Orbital Unit.
|
|
2007
|
-
*
|
|
2008
|
-
* This is a simplified entity definition optimized for orbital composition.
|
|
2009
|
-
* Collection names are derived automatically from persistence type if not provided.
|
|
2010
|
-
*/
|
|
2011
|
-
type OrbitalEntity = {
|
|
2012
|
-
/** V4 dual-carry id sibling of `name` — optional until the Phase-7 flip. */
|
|
2013
|
-
id?: EntityId;
|
|
2014
|
-
/** Entity name (PascalCase, e.g., "Task", "User") */
|
|
2015
|
-
name: string;
|
|
2016
|
-
/** Entity persistence type (defaults to 'persistent' if not specified) */
|
|
2017
|
-
persistence?: EntityPersistence;
|
|
2018
|
-
/** Whether this entity's state is shared across all bound traits (vs per-trait copy). Orthogonal to persistence. */
|
|
2019
|
-
shared?: boolean;
|
|
2020
|
-
/** Collection name (auto-derived if not provided for persistent entities) */
|
|
2021
|
-
collection?: string;
|
|
2022
|
-
/** Entity fields */
|
|
2023
|
-
fields: EntityField[];
|
|
2024
|
-
/** Pre-authored instances (seed data or static reference data) */
|
|
2025
|
-
instances?: EntityRow[];
|
|
2026
|
-
/** Auto-add createdAt/updatedAt timestamps */
|
|
2027
|
-
timestamps?: boolean;
|
|
2028
|
-
/** Soft delete support */
|
|
2029
|
-
softDelete?: boolean;
|
|
2030
|
-
/** Human-readable description */
|
|
2031
|
-
description?: string;
|
|
2032
|
-
/** Visual prompt for AI generation */
|
|
2033
|
-
visual_prompt?: string;
|
|
2034
|
-
/** Semantic asset reference for visual representation (games) */
|
|
2035
|
-
assetRef?: SemanticAssetRef;
|
|
2036
|
-
};
|
|
2037
|
-
declare const OrbitalEntitySchema: z.ZodObject<{
|
|
2038
|
-
name: z.ZodString;
|
|
2039
|
-
persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
|
|
2040
|
-
shared: z.ZodOptional<z.ZodBoolean>;
|
|
2041
|
-
collection: z.ZodOptional<z.ZodString>;
|
|
2042
|
-
fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
|
|
2043
|
-
instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
2044
|
-
timestamps: z.ZodOptional<z.ZodBoolean>;
|
|
2045
|
-
softDelete: z.ZodOptional<z.ZodBoolean>;
|
|
2046
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2047
|
-
visual_prompt: z.ZodOptional<z.ZodString>;
|
|
2048
|
-
assetRef: z.ZodOptional<z.ZodObject<{
|
|
2049
|
-
role: z.ZodString;
|
|
2050
|
-
category: z.ZodString;
|
|
2051
|
-
animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2052
|
-
style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
|
|
2053
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
2054
|
-
dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
|
|
2055
|
-
aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
|
|
2056
|
-
}, "strip", z.ZodTypeAny, {
|
|
2057
|
-
role: string;
|
|
2058
|
-
category: string;
|
|
2059
|
-
animations?: string[] | undefined;
|
|
2060
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2061
|
-
variant?: string | undefined;
|
|
2062
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2063
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2064
|
-
}, {
|
|
2065
|
-
role: string;
|
|
2066
|
-
category: string;
|
|
2067
|
-
animations?: string[] | undefined;
|
|
2068
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2069
|
-
variant?: string | undefined;
|
|
2070
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2071
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2072
|
-
}>>;
|
|
2073
|
-
}, "strip", z.ZodTypeAny, {
|
|
2074
|
-
name: string;
|
|
2075
|
-
persistence: "persistent" | "runtime";
|
|
2076
|
-
fields: EntityField[];
|
|
2077
|
-
description?: string | undefined;
|
|
2078
|
-
shared?: boolean | undefined;
|
|
2079
|
-
collection?: string | undefined;
|
|
2080
|
-
instances?: Record<string, unknown>[] | undefined;
|
|
2081
|
-
timestamps?: boolean | undefined;
|
|
2082
|
-
softDelete?: boolean | undefined;
|
|
2083
|
-
visual_prompt?: string | undefined;
|
|
2084
|
-
assetRef?: {
|
|
2085
|
-
role: string;
|
|
2086
|
-
category: string;
|
|
2087
|
-
animations?: string[] | undefined;
|
|
2088
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2089
|
-
variant?: string | undefined;
|
|
2090
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2091
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2092
|
-
} | undefined;
|
|
2093
|
-
}, {
|
|
2094
|
-
name: string;
|
|
2095
|
-
fields: unknown[];
|
|
2096
|
-
description?: string | undefined;
|
|
2097
|
-
persistence?: "persistent" | "runtime" | undefined;
|
|
2098
|
-
shared?: boolean | undefined;
|
|
2099
|
-
collection?: string | undefined;
|
|
2100
|
-
instances?: Record<string, unknown>[] | undefined;
|
|
2101
|
-
timestamps?: boolean | undefined;
|
|
2102
|
-
softDelete?: boolean | undefined;
|
|
2103
|
-
visual_prompt?: string | undefined;
|
|
2104
|
-
assetRef?: {
|
|
2105
|
-
role: string;
|
|
2106
|
-
category: string;
|
|
2107
|
-
animations?: string[] | undefined;
|
|
2108
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2109
|
-
variant?: string | undefined;
|
|
2110
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2111
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2112
|
-
} | undefined;
|
|
2113
|
-
}>;
|
|
2114
|
-
type OrbitalEntityInput = z.input<typeof OrbitalEntitySchema>;
|
|
2115
|
-
/** Alias for OrbitalEntity - preferred name */
|
|
2116
|
-
type Entity = OrbitalEntity;
|
|
2117
|
-
/** Alias for OrbitalEntitySchema - preferred name */
|
|
2118
|
-
declare const EntitySchema: z.ZodObject<{
|
|
2119
|
-
name: z.ZodString;
|
|
2120
|
-
persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
|
|
2121
|
-
shared: z.ZodOptional<z.ZodBoolean>;
|
|
2122
|
-
collection: z.ZodOptional<z.ZodString>;
|
|
2123
|
-
fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
|
|
2124
|
-
instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
2125
|
-
timestamps: z.ZodOptional<z.ZodBoolean>;
|
|
2126
|
-
softDelete: z.ZodOptional<z.ZodBoolean>;
|
|
2127
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2128
|
-
visual_prompt: z.ZodOptional<z.ZodString>;
|
|
2129
|
-
assetRef: z.ZodOptional<z.ZodObject<{
|
|
2130
|
-
role: z.ZodString;
|
|
2131
|
-
category: z.ZodString;
|
|
2132
|
-
animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2133
|
-
style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
|
|
2134
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
2135
|
-
dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
|
|
2136
|
-
aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
|
|
2137
|
-
}, "strip", z.ZodTypeAny, {
|
|
2138
|
-
role: string;
|
|
2139
|
-
category: string;
|
|
2140
|
-
animations?: string[] | undefined;
|
|
2141
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2142
|
-
variant?: string | undefined;
|
|
2143
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2144
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2145
|
-
}, {
|
|
2146
|
-
role: string;
|
|
2147
|
-
category: string;
|
|
2148
|
-
animations?: string[] | undefined;
|
|
2149
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2150
|
-
variant?: string | undefined;
|
|
2151
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2152
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2153
|
-
}>>;
|
|
2154
|
-
}, "strip", z.ZodTypeAny, {
|
|
2155
|
-
name: string;
|
|
2156
|
-
persistence: "persistent" | "runtime";
|
|
2157
|
-
fields: EntityField[];
|
|
2158
|
-
description?: string | undefined;
|
|
2159
|
-
shared?: boolean | undefined;
|
|
2160
|
-
collection?: string | undefined;
|
|
2161
|
-
instances?: Record<string, unknown>[] | undefined;
|
|
2162
|
-
timestamps?: boolean | undefined;
|
|
2163
|
-
softDelete?: boolean | undefined;
|
|
2164
|
-
visual_prompt?: string | undefined;
|
|
2165
|
-
assetRef?: {
|
|
2166
|
-
role: string;
|
|
2167
|
-
category: string;
|
|
2168
|
-
animations?: string[] | undefined;
|
|
2169
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2170
|
-
variant?: string | undefined;
|
|
2171
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2172
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2173
|
-
} | undefined;
|
|
2174
|
-
}, {
|
|
2175
|
-
name: string;
|
|
2176
|
-
fields: unknown[];
|
|
2177
|
-
description?: string | undefined;
|
|
2178
|
-
persistence?: "persistent" | "runtime" | undefined;
|
|
2179
|
-
shared?: boolean | undefined;
|
|
2180
|
-
collection?: string | undefined;
|
|
2181
|
-
instances?: Record<string, unknown>[] | undefined;
|
|
2182
|
-
timestamps?: boolean | undefined;
|
|
2183
|
-
softDelete?: boolean | undefined;
|
|
2184
|
-
visual_prompt?: string | undefined;
|
|
2185
|
-
assetRef?: {
|
|
2186
|
-
role: string;
|
|
2187
|
-
category: string;
|
|
2188
|
-
animations?: string[] | undefined;
|
|
2189
|
-
style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
|
|
2190
|
-
variant?: string | undefined;
|
|
2191
|
-
dimension?: "2d" | "3d" | undefined;
|
|
2192
|
-
aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
|
|
2193
|
-
} | undefined;
|
|
2194
|
-
}>;
|
|
2195
|
-
/**
|
|
2196
|
-
* Derives the collection name for a persistent entity.
|
|
2197
|
-
*
|
|
2198
|
-
* Generates the database collection name by converting the entity name
|
|
2199
|
-
* to lowercase and adding an 's' suffix (simple pluralization).
|
|
2200
|
-
* Returns undefined for non-persistent (runtime) entities.
|
|
2201
|
-
*
|
|
2202
|
-
* @param {OrbitalEntity} entity - Entity to derive collection name for
|
|
2203
|
-
* @returns {string | undefined} Collection name or undefined for non-persistent entities
|
|
2204
|
-
*
|
|
2205
|
-
* @example
|
|
2206
|
-
* deriveCollection({ name: 'User', persistence: 'persistent' }); // returns 'users'
|
|
2207
|
-
* deriveCollection({ name: 'Task', persistence: 'runtime' }); // returns undefined
|
|
2208
|
-
*/
|
|
2209
|
-
declare function deriveCollection(entity: OrbitalEntity): string | undefined;
|
|
2210
|
-
/**
|
|
2211
|
-
* Checks if an entity is runtime-only (not persisted).
|
|
2212
|
-
*
|
|
2213
|
-
* Type guard to determine if an entity exists only at runtime
|
|
2214
|
-
* and is not stored in the database.
|
|
2215
|
-
*
|
|
2216
|
-
* @param {OrbitalEntity} entity - Entity to check
|
|
2217
|
-
* @returns {boolean} True if entity is runtime-only, false otherwise
|
|
2218
|
-
*
|
|
2219
|
-
* @example
|
|
2220
|
-
* isRuntimeEntity({ persistence: 'runtime' }); // returns true
|
|
2221
|
-
* isRuntimeEntity({ persistence: 'persistent' }); // returns false
|
|
2222
|
-
*/
|
|
2223
|
-
declare function isRuntimeEntity(entity: OrbitalEntity): boolean;
|
|
2224
|
-
/**
|
|
2225
|
-
* Checks whether an entity's persistence mode allows `persistence` /
|
|
2226
|
-
* `collection` overrides at the factory call site.
|
|
2227
|
-
*
|
|
2228
|
-
* Only `persistent` entities (explicit or default) support these overrides.
|
|
2229
|
-
* Runtime entities are fixed; callers must not expose `persistence` or
|
|
2230
|
-
* `collection` params for them.
|
|
2231
|
-
*
|
|
2232
|
-
* @param persistence - The entity persistence mode (undefined = default persistent)
|
|
2233
|
-
* @returns True when overrides are allowed, false otherwise
|
|
2234
|
-
*
|
|
2235
|
-
* @example
|
|
2236
|
-
* persistenceModeAllowsOverrides('persistent'); // returns true
|
|
2237
|
-
* persistenceModeAllowsOverrides('runtime'); // returns false
|
|
2238
|
-
* persistenceModeAllowsOverrides(undefined); // returns true (default persistent)
|
|
2239
|
-
*/
|
|
2240
|
-
declare function persistenceModeAllowsOverrides(persistence: EntityPersistence | undefined): boolean;
|
|
2241
|
-
/**
|
|
2242
|
-
* A single field value at runtime.
|
|
2243
|
-
* Union of all possible types from FieldType: string, number, boolean, date, array, nested.
|
|
2244
|
-
* The nested-record branch's index signature tolerates `undefined` so that
|
|
2245
|
-
* TypeScript optional properties (`x?: string`, carrying `string | undefined`)
|
|
2246
|
-
* on EntityRow extenders typecheck without ceremony. At JSON serialization
|
|
2247
|
-
* time `undefined` is equivalent to "key absent" and never appears on the
|
|
2248
|
-
* wire; the inclusion here is a pure type-surface accommodation.
|
|
2249
|
-
*/
|
|
2250
|
-
type FieldValue = string | number | boolean | Date | null | string[] | FieldValue[] | {
|
|
2251
|
-
[key: string]: FieldValue | undefined;
|
|
2252
|
-
};
|
|
2253
|
-
/**
|
|
2254
|
-
* Runtime guard for `FieldValue` — narrows interpreter-produced `unknown`
|
|
2255
|
-
* values at typed substrate boundaries (e.g. `IntegrationContext.http` body).
|
|
2256
|
-
*/
|
|
2257
|
-
declare function isFieldValue(value: unknown): value is FieldValue;
|
|
2258
|
-
/**
|
|
2259
|
-
* One instance of an entity with actual field values.
|
|
2260
|
-
* The shape is determined by the Entity definition at schema time.
|
|
2261
|
-
*
|
|
2262
|
-
* @example
|
|
2263
|
-
* // Entity defines: Patient { fullName: string, age: number, active: boolean }
|
|
2264
|
-
* // EntityRow is: { id: "p1", fullName: "Sarah", age: 34, active: true }
|
|
2265
|
-
*/
|
|
2266
|
-
type EntityRow = {
|
|
2267
|
-
id?: string;
|
|
2268
|
-
} & Record<string, FieldValue | undefined>;
|
|
2269
|
-
/**
|
|
2270
|
-
* A field-TYPED `EntityRow` — the SINGLE entity type, refined with a concrete
|
|
2271
|
-
* field SHAPE `S`. Non-optional members of `S` are REQUIRED, each with its real
|
|
2272
|
-
* type; the result stays `& EntityRow`, so the index signature is intact and
|
|
2273
|
-
* every other field is still field-open — any domain entity that provides those
|
|
2274
|
-
* fields satisfies it.
|
|
2275
|
-
*
|
|
2276
|
-
* One declaration, two jobs: (1) TypeScript enforces the bound entity has the
|
|
2277
|
-
* fields WITH their types (a behavior binding a thinner/mistyped entity fails to
|
|
2278
|
-
* typecheck); and (2) pattern-sync reads the same type and writes the entity
|
|
2279
|
-
* prop's field shape (`properties` + `requiredFields`) onto the registry, so
|
|
2280
|
-
* lolo-ui emits a COMPLETE `entity { … }` (every field, typed + demo-seeded) and
|
|
2281
|
-
* the `ORB_X_ENTITY_PROP_CONTRACT` validator rejects an incompatible bind at
|
|
2282
|
-
* `orbital validate`. (A raw `EntityRow & { rating: number }` intersection is
|
|
2283
|
-
* equivalent for one-off shapes.)
|
|
2284
|
-
*
|
|
2285
|
-
* @example
|
|
2286
|
-
* // HeroOrganism renders entity.title / entity.subtitle:
|
|
2287
|
-
* entity?: EntityWith<{ title: string; subtitle?: string }>;
|
|
2288
|
-
* // entity.title → string (required)
|
|
2289
|
-
* // entity.subtitle → string | undefined (optional)
|
|
2290
|
-
* // entity.other → FieldValue | undefined (still field-open)
|
|
2291
|
-
*/
|
|
2292
|
-
type EntityWith<S extends object> = EntityRow & S;
|
|
2293
|
-
/**
|
|
2294
|
-
* Collection of entity instances keyed by entity name.
|
|
2295
|
-
* Used by OrbPreview mockData, OrbitalServerRuntime state, data grids, etc.
|
|
2296
|
-
*
|
|
2297
|
-
* @example
|
|
2298
|
-
* const data: EntityData = {
|
|
2299
|
-
* Patient: [{ id: "1", fullName: "Sarah", age: 34 }],
|
|
2300
|
-
* QueueEntry: [{ id: "1", patientName: "Sarah", waitMinutes: 12 }],
|
|
2301
|
-
* };
|
|
2302
|
-
*/
|
|
2303
|
-
type EntityData = Record<string, EntityRow[]>;
|
|
2304
|
-
|
|
2305
749
|
/**
|
|
2306
750
|
* Pattern Types (Auto-Generated)
|
|
2307
751
|
*
|
|
2308
752
|
* DO NOT EDIT MANUALLY — regenerated by almadar-pattern-sync `patterns` command.
|
|
2309
753
|
*
|
|
2310
|
-
* Generated: 2026-07-
|
|
2311
|
-
* Pattern count:
|
|
754
|
+
* Generated: 2026-07-26T06:18:14.200Z
|
|
755
|
+
* Pattern count: 266
|
|
2312
756
|
*/
|
|
2313
757
|
|
|
2314
758
|
/**
|
|
@@ -2320,7 +764,7 @@ type PatternPropValue = Record<string, FieldValue | undefined>;
|
|
|
2320
764
|
* All valid pattern type names from @almadar/core/patterns registry.
|
|
2321
765
|
* Use this type in render-ui effects for compile-time validation.
|
|
2322
766
|
*/
|
|
2323
|
-
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' | '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';
|
|
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-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';
|
|
2324
768
|
/**
|
|
2325
769
|
* Pattern props map — each pattern type maps to its valid props interface.
|
|
2326
770
|
*/
|
|
@@ -3959,6 +2403,34 @@ interface PatternPropsMap {
|
|
|
3959
2403
|
strokeWidth?: number | string | SExpr;
|
|
3960
2404
|
style?: PatternPropValue | string | SExpr;
|
|
3961
2405
|
};
|
|
2406
|
+
'import-preview-tree': {
|
|
2407
|
+
type: 'import-preview-tree';
|
|
2408
|
+
units: unknown[] | string | SExpr;
|
|
2409
|
+
skipped?: unknown[] | string | SExpr;
|
|
2410
|
+
entityDisplay: PatternPropValue | string | SExpr;
|
|
2411
|
+
onConfirm?: ((...args: unknown[]) => unknown) | string | SExpr;
|
|
2412
|
+
onCancel?: ((...args: unknown[]) => unknown) | string | SExpr;
|
|
2413
|
+
confirmLabel?: string | SExpr;
|
|
2414
|
+
cancelLabel?: string | SExpr;
|
|
2415
|
+
indent?: number | string | SExpr;
|
|
2416
|
+
className?: string | SExpr;
|
|
2417
|
+
};
|
|
2418
|
+
'import-progress': {
|
|
2419
|
+
type: 'import-progress';
|
|
2420
|
+
step: string | SExpr;
|
|
2421
|
+
counts?: PatternPropValue | string | SExpr;
|
|
2422
|
+
labels?: PatternPropValue | string | SExpr;
|
|
2423
|
+
className?: string | SExpr;
|
|
2424
|
+
};
|
|
2425
|
+
'import-source-picker': {
|
|
2426
|
+
type: 'import-source-picker';
|
|
2427
|
+
sources: unknown[] | string | SExpr;
|
|
2428
|
+
onSelect?: ((...args: unknown[]) => unknown) | string | SExpr;
|
|
2429
|
+
onFilesSelected?: ((...args: unknown[]) => unknown) | string | SExpr;
|
|
2430
|
+
title?: string | SExpr;
|
|
2431
|
+
moreSources?: unknown | string | SExpr;
|
|
2432
|
+
className?: string | SExpr;
|
|
2433
|
+
};
|
|
3962
2434
|
'infinite-scroll-sentinel': {
|
|
3963
2435
|
type: 'infinite-scroll-sentinel';
|
|
3964
2436
|
loadMoreEvent: string | SExpr;
|
|
@@ -6417,4 +4889,4 @@ interface RenderUINode {
|
|
|
6417
4889
|
renderItem?: RenderUINode;
|
|
6418
4890
|
}
|
|
6419
4891
|
|
|
6420
|
-
export {
|
|
4892
|
+
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 };
|