@almadar/core 10.40.0 → 10.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1572 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * Identity model (Almadar Rabit V4, Phase 1 — types only).
5
- *
6
- * Branded, prefix-tagged node ids + a workspace-scoped name ledger. Ids are
7
- * the durable edge keys of the identity-keyed schema graph; the ledger is the
8
- * sole name↔id map (names are display labels, one row per rename). This module
9
- * is pure: no I/O, no side effects. Minting is the only impurity (clock +
10
- * crypto randomness for the ULID suffix).
11
- *
12
- * @packageDocumentation
13
- */
14
-
15
- type Branded<K extends string> = string & {
16
- readonly __idBrand: K;
17
- };
18
- type OrbitalId = Branded<'OrbitalId'>;
19
- type EntityId = Branded<'EntityId'>;
20
- type TraitId = Branded<'TraitId'>;
21
- type EventId = Branded<'EventId'>;
22
- type PageId = Branded<'PageId'>;
23
- type ServiceId = Branded<'ServiceId'>;
24
- type ThemeId = Branded<'ThemeId'>;
25
- type PaletteEntryId = Branded<'PaletteEntryId'>;
26
- /** Node kind ↔ id-prefix table. The single source of truth for every prefix. */
27
- declare const ID_PREFIXES: {
28
- readonly orbital: "orb_";
29
- readonly entity: "ent_";
30
- readonly trait: "trt_";
31
- readonly event: "evt_";
32
- readonly page: "pag_";
33
- readonly service: "svc_";
34
- readonly theme: "thm_";
35
- readonly palette: "pal_";
36
- };
37
- type IdKind = keyof typeof ID_PREFIXES;
38
- /** Compile-time map from kind to its branded id type. */
39
- interface IdForKind {
40
- orbital: OrbitalId;
41
- entity: EntityId;
42
- trait: TraitId;
43
- event: EventId;
44
- page: PageId;
45
- service: ServiceId;
46
- theme: ThemeId;
47
- palette: PaletteEntryId;
48
- }
49
- declare const isOrbitalId: (value: string) => value is OrbitalId;
50
- declare const asOrbitalId: (value: string) => OrbitalId;
51
- declare const isEntityId: (value: string) => value is EntityId;
52
- declare const asEntityId: (value: string) => EntityId;
53
- declare const isTraitId: (value: string) => value is TraitId;
54
- declare const asTraitId: (value: string) => TraitId;
55
- declare const isEventId: (value: string) => value is EventId;
56
- declare const asEventId: (value: string) => EventId;
57
- declare const isPageId: (value: string) => value is PageId;
58
- declare const asPageId: (value: string) => PageId;
59
- declare const isServiceId: (value: string) => value is ServiceId;
60
- declare const asServiceId: (value: string) => ServiceId;
61
- declare const isThemeId: (value: string) => value is ThemeId;
62
- declare const asThemeId: (value: string) => ThemeId;
63
- declare const isPaletteEntryId: (value: string) => value is PaletteEntryId;
64
- declare const asPaletteEntryId: (value: string) => PaletteEntryId;
65
- /**
66
- * The id-prefix for a node kind (`'entity' → 'ent_'`). The JS mirror of the
67
- * Rust `IdKind::prefix`. Single source of truth is {@link ID_PREFIXES}.
68
- */
69
- declare function idPrefix(kind: IdKind): string;
70
- /**
71
- * The node kind an id's prefix denotes, or `null` for an unrecognized /
72
- * bare-prefix string. The JS mirror of the Rust `id_kind_of`. Prefixes are
73
- * mutually non-overlapping, so match order is irrelevant.
74
- */
75
- declare function idKindOf(id: string): IdKind | null;
76
- /** Mint a fresh, opaque, kind-tagged id: `<prefix><ULID>`. */
77
- declare function mintId<K extends IdKind>(kind: K): IdForKind[K];
78
- /** Ledger row kind. `palette` entries are manifest ids, not name-ledger rows. */
79
- type LedgerKind = 'orbital' | 'entity' | 'trait' | 'event' | 'page' | 'service' | 'theme';
80
- /**
81
- * One ledger row: the workspace's name history for a single node id.
82
- *
83
- * For kind `'event'` the row is minted per-(trait, declared event) per the
84
- * Phase-0 freeze — the owning trait is recorded in `parent`; a call-site event
85
- * rename is a one-row edit on this same id (the baked-vs-current key namespaces
86
- * collapse into `bakedName` vs `curName`).
87
- */
88
- interface LedgerEntry {
89
- id: string;
90
- kind: LedgerKind;
91
- bakedName: string;
92
- curName: string;
93
- renames: ReadonlyArray<{
94
- from: string;
95
- to: string;
96
- at: string;
97
- }>;
98
- owner: 'std' | 'io' | 'workspace';
99
- /** Owning trait for kind `'event'` (per-trait event-id namespace). */
100
- parent?: TraitId;
101
- }
102
- interface IdentityLedger {
103
- schemaVersion: 1;
104
- entries: Record<string, LedgerEntry>;
105
- }
106
- /** Resolve a name to its id via exact `curName` match within `kind`, else null. */
107
- declare function ledgerResolveName(ledger: IdentityLedger, kind: LedgerKind, name: string): string | null;
108
- /** Immutable rename: returns a new ledger with the id's `curName` + `renames` updated. */
109
- declare function ledgerRename(ledger: IdentityLedger, id: string, to: string, at: string): IdentityLedger;
110
- /** Current display name for an id, or null when the id is not in the ledger. */
111
- declare function ledgerCurName(ledger: IdentityLedger, id: string): string | null;
112
- /**
113
- * Prefix-checked, kind-tagged id schemas. Each narrows a validated string to
114
- * its branded id type via the module's own kind guard, so a schema that reads
115
- * `TraitIdSchema.optional()` yields `TraitId | undefined` with no cast. The
116
- * guard is the single source of prefix truth (`ID_PREFIXES`); the schema is a
117
- * thin zod wrapper over it.
118
- */
119
- declare const OrbitalIdSchema: z.ZodEffects<z.ZodString, OrbitalId, string>;
120
- declare const EntityIdSchema: z.ZodEffects<z.ZodString, EntityId, string>;
121
- declare const TraitIdSchema: z.ZodEffects<z.ZodString, TraitId, string>;
122
- declare const EventIdSchema: z.ZodEffects<z.ZodString, EventId, string>;
123
- declare const PageIdSchema: z.ZodEffects<z.ZodString, PageId, string>;
124
- declare const ServiceIdSchema: z.ZodEffects<z.ZodString, ServiceId, string>;
125
- declare const ThemeIdSchema: z.ZodEffects<z.ZodString, ThemeId, string>;
126
- declare const PaletteEntryIdSchema: z.ZodEffects<z.ZodString, PaletteEntryId, string>;
127
- declare const LedgerKindSchema: z.ZodEnum<["orbital", "entity", "trait", "event", "page", "service", "theme"]>;
128
- declare const LedgerEntrySchema: z.ZodObject<{
129
- id: z.ZodString;
130
- kind: z.ZodEnum<["orbital", "entity", "trait", "event", "page", "service", "theme"]>;
131
- bakedName: z.ZodString;
132
- curName: z.ZodString;
133
- renames: z.ZodArray<z.ZodObject<{
134
- from: z.ZodString;
135
- to: z.ZodString;
136
- at: z.ZodString;
137
- }, "strip", z.ZodTypeAny, {
138
- at: string;
139
- from: string;
140
- to: string;
141
- }, {
142
- at: string;
143
- from: string;
144
- to: string;
145
- }>, "many">;
146
- owner: z.ZodEnum<["std", "io", "workspace"]>;
147
- parent: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
148
- }, "strip", z.ZodTypeAny, {
149
- id: string;
150
- kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
151
- bakedName: string;
152
- curName: string;
153
- renames: {
154
- at: string;
155
- from: string;
156
- to: string;
157
- }[];
158
- owner: "std" | "io" | "workspace";
159
- parent?: TraitId | undefined;
160
- }, {
161
- id: string;
162
- kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
163
- bakedName: string;
164
- curName: string;
165
- renames: {
166
- at: string;
167
- from: string;
168
- to: string;
169
- }[];
170
- owner: "std" | "io" | "workspace";
171
- parent?: string | undefined;
172
- }>;
173
- declare const IdentityLedgerSchema: z.ZodObject<{
174
- schemaVersion: z.ZodLiteral<1>;
175
- entries: z.ZodRecord<z.ZodString, z.ZodObject<{
176
- id: z.ZodString;
177
- kind: z.ZodEnum<["orbital", "entity", "trait", "event", "page", "service", "theme"]>;
178
- bakedName: z.ZodString;
179
- curName: z.ZodString;
180
- renames: z.ZodArray<z.ZodObject<{
181
- from: z.ZodString;
182
- to: z.ZodString;
183
- at: z.ZodString;
184
- }, "strip", z.ZodTypeAny, {
185
- at: string;
186
- from: string;
187
- to: string;
188
- }, {
189
- at: string;
190
- from: string;
191
- to: string;
192
- }>, "many">;
193
- owner: z.ZodEnum<["std", "io", "workspace"]>;
194
- parent: z.ZodOptional<z.ZodEffects<z.ZodString, TraitId, string>>;
195
- }, "strip", z.ZodTypeAny, {
196
- id: string;
197
- kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
198
- bakedName: string;
199
- curName: string;
200
- renames: {
201
- at: string;
202
- from: string;
203
- to: string;
204
- }[];
205
- owner: "std" | "io" | "workspace";
206
- parent?: TraitId | undefined;
207
- }, {
208
- id: string;
209
- kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
210
- bakedName: string;
211
- curName: string;
212
- renames: {
213
- at: string;
214
- from: string;
215
- to: string;
216
- }[];
217
- owner: "std" | "io" | "workspace";
218
- parent?: string | undefined;
219
- }>>;
220
- }, "strip", z.ZodTypeAny, {
221
- entries: Record<string, {
222
- id: string;
223
- kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
224
- bakedName: string;
225
- curName: string;
226
- renames: {
227
- at: string;
228
- from: string;
229
- to: string;
230
- }[];
231
- owner: "std" | "io" | "workspace";
232
- parent?: TraitId | undefined;
233
- }>;
234
- schemaVersion: 1;
235
- }, {
236
- entries: Record<string, {
237
- id: string;
238
- kind: "orbital" | "entity" | "trait" | "event" | "page" | "service" | "theme";
239
- bakedName: string;
240
- curName: string;
241
- renames: {
242
- at: string;
243
- from: string;
244
- to: string;
245
- }[];
246
- owner: "std" | "io" | "workspace";
247
- parent?: string | undefined;
248
- }>;
249
- schemaVersion: 1;
250
- }>;
251
-
252
- /**
253
- * JSON primitives — the universal "data crossed a boundary" type.
254
- *
255
- * Every value that arrives over the wire from an LLM (tool-call args),
256
- * from disk (workspace files), or from an HTTP body before
257
- * domain-specific validation is a `JsonValue`. Narrow with a typed
258
- * predicate (`is`-guard) at the boundary; don't widen back to `unknown`.
259
- *
260
- * `JsonObject` and `ToolArgs` are aliases for the common
261
- * `Record<string, JsonValue>` shape. `ToolArgs` is the name the
262
- * agent surface uses for LLM-emitted tool-call arguments; `JsonObject`
263
- * is the general-purpose alias. They are the same type — the alias
264
- * exists so call sites read at the right semantic level.
265
- *
266
- * Why not `Record<string, unknown>`? Two reasons. (1) `unknown` widens
267
- * back to anything, which defeats the purpose of typing the boundary.
268
- * (2) The `@almadar/eslint-plugin/no-record-string-unknown` rule blocks
269
- * the wider form — `JsonValue`-based records are the typed answer.
270
- *
271
- * @packageDocumentation
272
- */
273
-
274
- /**
275
- * Recursive JSON value union — every shape JSON can carry.
276
- */
277
- type JsonValue = string | number | boolean | null | JsonValue[] | {
278
- [key: string]: JsonValue;
279
- };
280
- /**
281
- * JSON object — keyed string→JsonValue. The wire form of arbitrary
282
- * structured data. Replaces `Record<string, unknown>` at typed
283
- * boundaries (LLM emits, file reads, HTTP bodies).
284
- */
285
- type JsonObject = {
286
- [key: string]: JsonValue;
287
- };
288
- /**
289
- * LLM tool-call arguments — same shape as `JsonObject`, named for the
290
- * agent-surface call site. Each tool's `execute(args: ToolArgs)`
291
- * receives this and narrows via an `is`-guard predicate before any
292
- * field access.
293
- */
294
- type ToolArgs = JsonObject;
295
- /**
296
- * Type guard: is the given value a JSON primitive (non-array,
297
- * non-object)? Used by walkers that decide whether to recurse.
298
- */
299
- declare function isJsonPrimitive(value: JsonValue): value is string | number | boolean | null;
300
- /**
301
- * Type guard: is the given value a JSON object (non-array, non-null)?
302
- */
303
- declare function isJsonObject(value: JsonValue): value is JsonObject;
304
- /**
305
- * Type guard: is the given value a JSON array?
306
- */
307
- declare function isJsonArray(value: JsonValue): value is JsonValue[];
308
-
309
- /**
310
- * Field Types for Orbital Units
311
- *
312
- * Extracted from schema/data-entities.ts for the orbitals module.
313
- * These types define the field structure within orbital entities.
314
- *
315
- * @packageDocumentation
316
- */
317
-
318
- /**
319
- * Supported field types for entity fields.
320
- *
321
- * @example
322
- * { name: 'status', type: 'enum', values: ['draft', 'published'] }
323
- * { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
324
- */
325
- type FieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'email' | 'url' | 'phone' | 'uuid' | 'image' | 'array' | 'object' | 'enum' | 'relation' | 'trait' | 'slot' | 'pattern';
326
- /** Every `FieldType`, as a runtime array. Downstream imports this instead of
327
- * re-listing the union — five copies had already drifted apart. */
328
- declare const FIELD_TYPES: readonly ["string", "number", "boolean", "date", "timestamp", "datetime", "email", "url", "phone", "uuid", "image", "array", "object", "enum", "relation", "trait", "slot", "pattern"];
329
- /** The semantic string domains — constrained strings, validatable by value. */
330
- declare const SEMANTIC_STRING_TYPES: readonly ["email", "url", "phone", "uuid", "image"];
331
- type SemanticStringType = (typeof SEMANTIC_STRING_TYPES)[number];
332
- /** Is this a semantic string domain (as opposed to a bare `string`)? */
333
- declare function isSemanticStringType(type: FieldType): type is SemanticStringType;
334
- declare const FieldTypeSchema: z.ZodEnum<["string", "number", "boolean", "date", "timestamp", "datetime", "email", "url", "phone", "uuid", "image", "array", "object", "enum", "relation", "trait", "slot", "pattern"]>;
335
- /**
336
- * Cardinality for relation fields.
337
- * Matches Rust compiler's Cardinality enum.
338
- */
339
- type RelationCardinality = 'one' | 'many' | 'one-to-many' | 'many-to-one' | 'many-to-many';
340
- /**
341
- * Configuration for relation fields (foreign keys).
342
- * Matches Rust compiler's RelationDefinition format.
343
- */
344
- type RelationConfig = {
345
- /** Target entity name (e.g., 'User', 'Task') - matches Rust's `entity` field */
346
- entity: string;
347
- /** V4 dual-carry id sibling of `entity` — optional until the Phase-7 flip. */
348
- entityId?: EntityId;
349
- /** Field on target entity (defaults to 'id') */
350
- field?: string;
351
- /**
352
- * Cardinality: one, many, one-to-many, many-to-one, many-to-many
353
- * Matches Rust compiler's cardinality format
354
- */
355
- cardinality?: RelationCardinality;
356
- /** Delete behavior */
357
- onDelete?: 'cascade' | 'nullify' | 'restrict';
358
- /**
359
- * Foreign key field name (for legacy compatibility).
360
- * @deprecated Use field instead
361
- */
362
- foreignKey?: string;
363
- /**
364
- * Target entity name (for legacy compatibility).
365
- * @deprecated Use entity instead
366
- */
367
- target?: string;
368
- /**
369
- * Cardinality type alias (for legacy compatibility).
370
- * @deprecated Use cardinality instead
371
- */
372
- type?: RelationCardinality;
373
- };
374
- declare const RelationConfigSchema: z.ZodEffects<z.ZodObject<{
375
- entity: z.ZodString;
376
- entityId: z.ZodOptional<z.ZodEffects<z.ZodString, EntityId, string>>;
377
- field: z.ZodOptional<z.ZodString>;
378
- cardinality: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
379
- onDelete: z.ZodOptional<z.ZodEnum<["cascade", "nullify", "restrict"]>>;
380
- foreignKey: z.ZodOptional<z.ZodString>;
381
- target: z.ZodOptional<z.ZodString>;
382
- type: z.ZodOptional<z.ZodEnum<["one", "many", "one-to-many", "many-to-one", "many-to-many"]>>;
383
- }, "strip", z.ZodTypeAny, {
384
- entity: string;
385
- type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
386
- entityId?: EntityId | undefined;
387
- field?: string | undefined;
388
- cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
389
- onDelete?: "cascade" | "nullify" | "restrict" | undefined;
390
- foreignKey?: string | undefined;
391
- target?: string | undefined;
392
- }, {
393
- entity: string;
394
- type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
395
- entityId?: string | undefined;
396
- field?: string | undefined;
397
- cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
398
- onDelete?: "cascade" | "nullify" | "restrict" | undefined;
399
- foreignKey?: string | undefined;
400
- target?: string | undefined;
401
- }>, RelationConfig, {
402
- entity: string;
403
- type?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
404
- entityId?: string | undefined;
405
- field?: string | undefined;
406
- cardinality?: "many" | "one" | "one-to-many" | "many-to-one" | "many-to-many" | undefined;
407
- onDelete?: "cascade" | "nullify" | "restrict" | undefined;
408
- foreignKey?: string | undefined;
409
- target?: string | undefined;
410
- }>;
411
- declare function isEmailValue(value: string): boolean;
412
- declare function isUrlValue(value: string): boolean;
413
- declare function isPhoneValue(value: string): boolean;
414
- declare function isUuidValue(value: string): boolean;
415
- /** Does `value` satisfy the declared semantic domain? `image` is a URL. */
416
- declare function isSemanticStringValue(type: SemanticStringType, value: string): boolean;
417
- /**
418
- * Field-type tags that don't carry a type-dependent payload. The base
419
- * `EntityField` shape applies as-is.
420
- */
421
- type ScalarFieldType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp' | 'datetime' | 'email' | 'url' | 'phone' | 'uuid' | 'image' | 'trait' | 'slot' | 'pattern';
422
- /** Fields shared across every variant. */
423
- type EntityFieldBase = {
424
- /**
425
- * Field name (camelCase). Optional for nested item/property descriptors
426
- * where the name is implied by the parent (`items`, `properties[k]`).
427
- * Mirrors Rust's `FieldDefinition.name: Option<String>`.
428
- */
429
- name?: string;
430
- /** Whether the field is required */
431
- required?: boolean;
432
- /** Default value — parsed from `.orb`, always JSON-shaped. */
433
- default?: JsonValue;
434
- /** Minimum value (for number) or length (for string) */
435
- min?: number;
436
- /** Maximum value or length */
437
- max?: number;
438
- /** Object property schemas keyed by property name (for object type).
439
- * Mirrors Rust's `FieldDefinition.properties: Option<HashMap<String,
440
- * FieldDefinition>>`. Populated by the lolo lowerer when a field /
441
- * config slot's type expression resolves to a struct shape
442
- * (`TypeExpr::Object`), including named-type aliases like `[MetricSpec]`. */
443
- properties?: Record<string, EntityField>;
444
- /** Runtime-managed widget state (authored `@intrinsic` in `.lolo`). Exempt
445
- * from the explicit-binding rule and never a domain-data bind target. */
446
- intrinsic?: boolean;
447
- /** Human/semantic description (authored `@description "..."` in `.lolo`).
448
- * Authoring/build-time metadata — factory-signature catalog, embeddings,
449
- * curation field-matching; the runtime ignores it. */
450
- description?: string;
451
- /** User-vocabulary synonyms (authored `@synonyms "..."` in `.lolo`).
452
- * Free text feeding catalog search / curation field-matching. */
453
- synonyms?: string;
454
- };
455
- /**
456
- * Scalar / structural fields — no type-dependent payload required.
457
- * `values?` is permitted as an OPTIONAL UI/validation hint (e.g. lolo's
458
- * `'a' | 'b' | 'c'` string-union sugar lowers to `type: 'string', values:
459
- * [...]`). Only `EnumEntityField` MANDATES values.
460
- */
461
- type ScalarEntityField = EntityFieldBase & {
462
- type: ScalarFieldType;
463
- /** Optional vocabulary hint for scalar fields (e.g. string unions
464
- * authored as `'a'|'b'|'c'` in lolo). Not required at this variant. */
465
- values?: string[];
466
- };
467
- /** `type: 'enum'` REQUIRES the closed vocabulary in `values`. */
468
- type EnumEntityField = EntityFieldBase & {
469
- type: 'enum';
470
- /** Closed string vocabulary the field accepts. */
471
- values: string[];
472
- };
473
- /** `type: 'relation'` REQUIRES the relation target binding. */
474
- type RelationEntityField = EntityFieldBase & {
475
- type: 'relation';
476
- /** Relation target binding (entity + cardinality). */
477
- relation: RelationConfig;
478
- };
479
- /** `type: 'array'` — element schema in `items` strongly preferred but
480
- * optional for legacy compatibility with codegen-emitted scalar-array
481
- * fields (e.g. `{type: 'array', default: []}`). The lolo lowerer + Rust
482
- * validator catch typed-element-required cases downstream. */
483
- type ArrayEntityField = EntityFieldBase & {
484
- type: 'array';
485
- /** Element schema for the array. */
486
- items?: EntityField;
487
- };
488
- /**
489
- * `type: 'object'` — a fixed-key struct (fields in `properties`) OR a
490
- * dynamic-key map (`Map K V` in `.lolo`; the uniform value schema lives in
491
- * `items`, mirroring an array's element schema). A distinct variant so `items`
492
- * is statically allowed only on object/array fields, never on scalars.
493
- */
494
- type ObjectEntityField = EntityFieldBase & {
495
- type: 'object';
496
- /** Uniform value schema for a dynamic-key map (`Map K V`). */
497
- items?: EntityField;
498
- };
499
- /**
500
- * Entity field definition — discriminated union by `type`. Each variant
501
- * statically enforces its dependent payload (`values` for enum,
502
- * `relation` for relation, `items` for array) so TS / Zod / JSON Schema
503
- * consumers all agree on the dependency, not just the Rust validator.
504
- *
505
- * @example
506
- * { name: 'status', type: 'enum', values: ['draft', 'published'] }
507
- * { name: 'authorId', type: 'relation', relation: { entity: 'User', cardinality: 'one' } }
508
- * { name: 'tags', type: 'array', items: { type: 'string' } }
509
- */
510
- type EntityField = ScalarEntityField | EnumEntityField | RelationEntityField | ArrayEntityField | ObjectEntityField;
511
- /**
512
- * Zod schema for `EntityField`. Preprocess normalizes:
513
- * - legacy `type` aliases (text → string, int → number, etc.)
514
- * - legacy `enum: string[]` alias → `values: string[]`
515
- *
516
- * Branches on `type` so TS narrows the parsed output to the matching
517
- * discriminated-union variant.
518
- */
519
- declare const EntityFieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
520
- type EntityFieldInput = z.input<typeof EntityFieldSchema>;
521
- /** Alias for EntityField - preferred name */
522
- type Field = EntityField;
523
- /** Alias for EntityFieldSchema - preferred name */
524
- declare const FieldSchema: z.ZodType<EntityField, z.ZodTypeDef, unknown>;
525
-
526
- /**
527
- * Asset Types for Semantic Asset References
528
- *
529
- * Defines types for abstracting asset paths into semantic references.
530
- * Assets are resolved from SemanticAssetRef to actual paths at compile time.
531
- *
532
- * @packageDocumentation
533
- */
534
-
535
- /**
536
- * Entity roles in game contexts
537
- */
538
- declare const ENTITY_ROLES: readonly ["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"];
539
- type EntityRole = (typeof ENTITY_ROLES)[number];
540
- declare const EntityRoleSchema: z.ZodEnum<["player", "enemy", "npc", "item", "tile", "projectile", "effect", "ui", "decoration", "vehicle"]>;
541
- /**
542
- * Visual art styles for games
543
- */
544
- declare const VISUAL_STYLES: readonly ["pixel", "vector", "hd", "1-bit", "isometric"];
545
- type VisualStyle = (typeof VISUAL_STYLES)[number];
546
- declare const VisualStyleSchema: z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>;
547
- /**
548
- * Whether the asset is a 2D sprite/image or a 3D model. Set by the consuming
549
- * canvas: the same entity role is a 2D sprite-sheet on a tile board and a 3D
550
- * rigged model on a 3D board.
551
- */
552
- declare const ASSET_DIMENSIONS: readonly ["2d", "3d"];
553
- type AssetDimension = (typeof ASSET_DIMENSIONS)[number];
554
- declare const AssetDimensionSchema: z.ZodEnum<["2d", "3d"]>;
555
- /**
556
- * Rendering aspect ratio of an asset: square (tiles/sprites/portraits/icons),
557
- * 16:9 (scene backdrops), 5:7 (cards), 8:1 (effect frame strips).
558
- */
559
- declare const ASSET_ASPECTS: readonly ["1:1", "16:9", "5:7", "8:1"];
560
- type AssetAspect = (typeof ASSET_ASPECTS)[number];
561
- declare const AssetAspectSchema: z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>;
562
- /**
563
- * Animation names matching a sprite sheet's row layout. Canonical home for
564
- * this vocabulary — `@almadar/ui`'s `spriteAnimationTypes.ts` re-exports it
565
- * rather than redeclaring, so board `.lolo` config and the render library
566
- * agree on one enum.
567
- */
568
- declare const ANIMATION_NAMES: readonly ["idle", "walk", "attack", "hit", "death"];
569
- type AnimationName = (typeof ANIMATION_NAMES)[number];
570
- declare const AnimationNameSchema: z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>;
571
- /** Sheet file directions (physical PNG files a sprite sheet ships as). */
572
- declare const SPRITE_DIRECTIONS: readonly ["se", "sw"];
573
- type SpriteDirection = (typeof SPRITE_DIRECTIONS)[number];
574
- declare const SpriteDirectionSchema: z.ZodEnum<["se", "sw"]>;
575
- /**
576
- * Definition for a single named animation within a sprite sheet: which row
577
- * it occupies, how many frames it has, and its playback rate. This is the
578
- * shape actually consumed by `@almadar/ui`'s sprite-sheet renderer
579
- * (`spriteAnimation.ts`'s `frameRect`/`getCurrentFrameFromDef`) — moved here
580
- * verbatim rather than reconciled with a differently-shaped guess, since
581
- * `@almadar/ui`'s version is the one with real production consumers.
582
- */
583
- interface AnimationDef {
584
- /** Row index in the sprite sheet (0-based; each animation occupies one row). */
585
- row: number;
586
- /** Number of frames in this animation. */
587
- frames: number;
588
- /** Frames per second. */
589
- frameRate: number;
590
- /** Whether the animation loops. */
591
- loop: boolean;
592
- }
593
- declare const AnimationDefSchema: z.ZodObject<{
594
- row: z.ZodNumber;
595
- frames: z.ZodNumber;
596
- frameRate: z.ZodNumber;
597
- loop: z.ZodBoolean;
598
- }, "strip", z.ZodTypeAny, {
599
- row: number;
600
- frames: number;
601
- frameRate: number;
602
- loop: boolean;
603
- }, {
604
- row: number;
605
- frames: number;
606
- frameRate: number;
607
- loop: boolean;
608
- }>;
609
- /**
610
- * Parsed sprite-sheet atlas JSON — the contract a `spriteSheet`-role `Asset.url`
611
- * resolves to when fetched (see `Asset.url` usage in `@almadar/ui`'s
612
- * `useUnitSpriteAtlas`). A unit's `sprite?: Asset` stays the static single-pose
613
- * image; `spriteSheet?: Asset` is a SEPARATE reference whose URL points at a
614
- * `SpriteSheetAtlas`-shaped JSON manifest (e.g. `.../guardian-sprite-sheet.json`),
615
- * not a PNG. Frame-cutting geometry lives here, not inlined onto `Asset` — an
616
- * `Asset` traveling through `render-ui` every tick stays small.
617
- */
618
- interface SpriteSheetAtlas {
619
- /** Unit archetype key. */
620
- unit?: string;
621
- /** Visual type key. */
622
- type?: string;
623
- /** Width of a single frame in pixels. */
624
- frameWidth: number;
625
- /** Height of a single frame in pixels. */
626
- frameHeight: number;
627
- /** Number of columns (frames per row). */
628
- columns: number;
629
- /** Number of rows (animations). */
630
- rows: number;
631
- /** Directions present as physical PNG files. */
632
- directions: SpriteDirection[];
633
- /** Relative PNG sheet paths per direction. */
634
- sheets: Partial<Record<SpriteDirection, string>>;
635
- /** Animation row layout keyed by animation name. */
636
- animations: Partial<Record<AnimationName, AnimationDef>>;
637
- }
638
- declare const SpriteSheetAtlasSchema: z.ZodObject<{
639
- unit: z.ZodOptional<z.ZodString>;
640
- type: z.ZodOptional<z.ZodString>;
641
- frameWidth: z.ZodNumber;
642
- frameHeight: z.ZodNumber;
643
- columns: z.ZodNumber;
644
- rows: z.ZodNumber;
645
- directions: z.ZodArray<z.ZodEnum<["se", "sw"]>, "many">;
646
- sheets: z.ZodRecord<z.ZodEnum<["se", "sw"]>, z.ZodString>;
647
- animations: z.ZodRecord<z.ZodEnum<["idle", "walk", "attack", "hit", "death"]>, z.ZodObject<{
648
- row: z.ZodNumber;
649
- frames: z.ZodNumber;
650
- frameRate: z.ZodNumber;
651
- loop: z.ZodBoolean;
652
- }, "strip", z.ZodTypeAny, {
653
- row: number;
654
- frames: number;
655
- frameRate: number;
656
- loop: boolean;
657
- }, {
658
- row: number;
659
- frames: number;
660
- frameRate: number;
661
- loop: boolean;
662
- }>>;
663
- }, "strip", z.ZodTypeAny, {
664
- frameWidth: number;
665
- frameHeight: number;
666
- columns: number;
667
- rows: number;
668
- directions: ("se" | "sw")[];
669
- sheets: Partial<Record<"se" | "sw", string>>;
670
- animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
671
- row: number;
672
- frames: number;
673
- frameRate: number;
674
- loop: boolean;
675
- }>>;
676
- type?: string | undefined;
677
- unit?: string | undefined;
678
- }, {
679
- frameWidth: number;
680
- frameHeight: number;
681
- columns: number;
682
- rows: number;
683
- directions: ("se" | "sw")[];
684
- sheets: Partial<Record<"se" | "sw", string>>;
685
- animations: Partial<Record<"idle" | "walk" | "attack" | "hit" | "death", {
686
- row: number;
687
- frames: number;
688
- frameRate: number;
689
- loop: boolean;
690
- }>>;
691
- type?: string | undefined;
692
- unit?: string | undefined;
693
- }>;
694
- /**
695
- * One named sub-rectangle inside a packed sheet. Mirrors the ShoeBox /
696
- * TexturePacker `<SubTexture>` element every Kenney `Spritesheet/*.xml` ships
697
- * (`x`/`y`/`width`/`height` = the rect in the sheet PNG; `frameX`/`frameY`/
698
- * `frameWidth`/`frameHeight` = the trim/pad offsets for sprites packed with
699
- * transparent edges removed — optional, present only on trimmed atlases).
700
- */
701
- interface SubTexture {
702
- x: number;
703
- y: number;
704
- width: number;
705
- height: number;
706
- frameX?: number;
707
- frameY?: number;
708
- frameWidth?: number;
709
- frameHeight?: number;
710
- }
711
- declare const SubTextureSchema: z.ZodObject<{
712
- x: z.ZodNumber;
713
- y: z.ZodNumber;
714
- width: z.ZodNumber;
715
- height: z.ZodNumber;
716
- frameX: z.ZodOptional<z.ZodNumber>;
717
- frameY: z.ZodOptional<z.ZodNumber>;
718
- frameWidth: z.ZodOptional<z.ZodNumber>;
719
- frameHeight: z.ZodOptional<z.ZodNumber>;
720
- }, "strip", z.ZodTypeAny, {
721
- x: number;
722
- y: number;
723
- width: number;
724
- height: number;
725
- frameWidth?: number | undefined;
726
- frameHeight?: number | undefined;
727
- frameX?: number | undefined;
728
- frameY?: number | undefined;
729
- }, {
730
- x: number;
731
- y: number;
732
- width: number;
733
- height: number;
734
- frameWidth?: number | undefined;
735
- frameHeight?: number | undefined;
736
- frameX?: number | undefined;
737
- frameY?: number | undefined;
738
- }>;
739
- /**
740
- * A packed sheet + its named sub-rectangles — the canonical parse target for a
741
- * Kenney `Spritesheet/*.xml` atlas. A STATIC tile/prop/UI Asset references one
742
- * of these: `{ url: <sheet.png>, atlas: <this.json>, sprite: "grass.png" }` →
743
- * the renderer fetches the sheet + atlas ONCE and blits the named sub-rect,
744
- * instead of loading N individual PNGs. (Animated actors use `SpriteSheetAtlas`
745
- * instead; a uniform-grid tile page uses `Tilesheet`.)
746
- */
747
- interface TextureAtlas {
748
- /** Relative path to the sheet PNG the sub-rects index into (the atlas's own `imagePath`). */
749
- imagePath: string;
750
- /** Sub-rectangles keyed by their atlas name (e.g. `"grass.png"`). */
751
- subTextures: Record<string, SubTexture>;
752
- }
753
- declare const TextureAtlasSchema: z.ZodObject<{
754
- imagePath: z.ZodString;
755
- subTextures: z.ZodRecord<z.ZodString, z.ZodObject<{
756
- x: z.ZodNumber;
757
- y: z.ZodNumber;
758
- width: z.ZodNumber;
759
- height: z.ZodNumber;
760
- frameX: z.ZodOptional<z.ZodNumber>;
761
- frameY: z.ZodOptional<z.ZodNumber>;
762
- frameWidth: z.ZodOptional<z.ZodNumber>;
763
- frameHeight: z.ZodOptional<z.ZodNumber>;
764
- }, "strip", z.ZodTypeAny, {
765
- x: number;
766
- y: number;
767
- width: number;
768
- height: number;
769
- frameWidth?: number | undefined;
770
- frameHeight?: number | undefined;
771
- frameX?: number | undefined;
772
- frameY?: number | undefined;
773
- }, {
774
- x: number;
775
- y: number;
776
- width: number;
777
- height: number;
778
- frameWidth?: number | undefined;
779
- frameHeight?: number | undefined;
780
- frameX?: number | undefined;
781
- frameY?: number | undefined;
782
- }>>;
783
- }, "strip", z.ZodTypeAny, {
784
- imagePath: string;
785
- subTextures: Record<string, {
786
- x: number;
787
- y: number;
788
- width: number;
789
- height: number;
790
- frameWidth?: number | undefined;
791
- frameHeight?: number | undefined;
792
- frameX?: number | undefined;
793
- frameY?: number | undefined;
794
- }>;
795
- }, {
796
- imagePath: string;
797
- subTextures: Record<string, {
798
- x: number;
799
- y: number;
800
- width: number;
801
- height: number;
802
- frameWidth?: number | undefined;
803
- frameHeight?: number | undefined;
804
- frameX?: number | undefined;
805
- frameY?: number | undefined;
806
- }>;
807
- }>;
808
- /**
809
- * A uniform-grid tile page — the shape a Kenney `Tilesheet/` sheet takes (e.g.
810
- * Pirate Pack: "each tile is 64×64, no margin"). Tiles are cut by `(col,row)`
811
- * index rather than by named rect. `names` is present only when a sibling
812
- * `.xml`/`.txt` supplies an index→name list; otherwise a tile is addressed by
813
- * its `"col,row"` (or flat index) via `Asset.sprite`.
814
- */
815
- interface Tilesheet {
816
- /** Relative path to the tile sheet PNG. */
817
- imagePath: string;
818
- /** Width of one tile cell in pixels. */
819
- tileWidth: number;
820
- /** Height of one tile cell in pixels. */
821
- tileHeight: number;
822
- /** Number of columns in the grid. */
823
- columns: number;
824
- /** Number of rows in the grid. */
825
- rows: number;
826
- /** Outer margin before the first tile, in pixels (default 0). */
827
- margin?: number;
828
- /** Gap between adjacent tiles, in pixels (default 0). */
829
- spacing?: number;
830
- /** Optional index→name labels when a descriptor supplies them. */
831
- names?: string[];
832
- }
833
- declare const TilesheetSchema: z.ZodObject<{
834
- imagePath: z.ZodString;
835
- tileWidth: z.ZodNumber;
836
- tileHeight: z.ZodNumber;
837
- columns: z.ZodNumber;
838
- rows: z.ZodNumber;
839
- margin: z.ZodOptional<z.ZodNumber>;
840
- spacing: z.ZodOptional<z.ZodNumber>;
841
- names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
842
- }, "strip", z.ZodTypeAny, {
843
- columns: number;
844
- rows: number;
845
- imagePath: string;
846
- tileWidth: number;
847
- tileHeight: number;
848
- margin?: number | undefined;
849
- spacing?: number | undefined;
850
- names?: string[] | undefined;
851
- }, {
852
- columns: number;
853
- rows: number;
854
- imagePath: string;
855
- tileWidth: number;
856
- tileHeight: number;
857
- margin?: number | undefined;
858
- spacing?: number | undefined;
859
- names?: string[] | undefined;
860
- }>;
861
- /**
862
- * Semantic reference to an asset (not a hardcoded path).
863
- * Resolved to actual paths at compile time via asset maps.
864
- */
865
- type SemanticAssetRef = {
866
- /**
867
- * Entity role — a free string. Core no longer constrains the vocabulary to
868
- * `EntityRole` (that enum stays an exported shared reference for the asset
869
- * tool + renderer); genre boards may use their own roles (`boss`, `tower`, …).
870
- */
871
- role: string;
872
- /** Sub-category within role (hero, slime, coin, etc.) */
873
- category: string;
874
- /** Required animations for this entity */
875
- animations?: string[];
876
- /** Visual style preference */
877
- style?: VisualStyle;
878
- /** Variant identifier (for multiple versions) */
879
- variant?: string;
880
- /** 2D sprite vs 3D model — the rendering dimension the consuming canvas needs. */
881
- dimension?: AssetDimension;
882
- /** Rendering aspect ratio (square sprite/portrait/tile, 16:9 backdrop, 5:7 card, 8:1 fx-strip). */
883
- aspect?: AssetAspect;
884
- };
885
- declare const SemanticAssetRefSchema: z.ZodObject<{
886
- role: z.ZodString;
887
- category: z.ZodString;
888
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
889
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
890
- variant: z.ZodOptional<z.ZodString>;
891
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
892
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
893
- }, "strip", z.ZodTypeAny, {
894
- role: string;
895
- category: string;
896
- animations?: string[] | undefined;
897
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
898
- variant?: string | undefined;
899
- dimension?: "2d" | "3d" | undefined;
900
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
901
- }, {
902
- role: string;
903
- category: string;
904
- animations?: string[] | undefined;
905
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
906
- variant?: string | undefined;
907
- dimension?: "2d" | "3d" | undefined;
908
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
909
- }>;
910
- /**
911
- * The single asset type: a `SemanticAssetRef` (role/dimension/animations/aspect/style)
912
- * WITH its resolved URL folded in. Used everywhere an asset is referenced — a lolo
913
- * board `assetManifest` (`Map string Asset`), every `@almadar/ui` game prop, the
914
- * asset-workflow's resolved/pool assets, and the inspector picker. Replaces the bare
915
- * `AssetUrl`-string asset field so the render metadata travels WITH the asset (no
916
- * pixel-dimension or filename heuristics needed to know sheet-vs-frame / 2d-vs-3d).
917
- */
918
- interface Asset extends SemanticAssetRef {
919
- /** The resolved asset URL. When `atlas`/`sprite` are set this is the SHEET png; otherwise a standalone image. */
920
- url: AssetUrl;
921
- /**
922
- * Optional atlas JSON (a `TextureAtlas` or `Tilesheet`) that slices `url`.
923
- * When present with `sprite`, the renderer fetches sheet + atlas once and
924
- * blits one sub-rect instead of loading a standalone PNG. Absent → `url` is
925
- * a plain whole-image asset (the existing, non-atlas path).
926
- */
927
- atlas?: AssetUrl;
928
- /**
929
- * The sub-texture selector within `atlas`: a `SubTexture` name for a
930
- * `TextureAtlas` (e.g. `"grass.png"`), or a `"col,row"`/flat index for a
931
- * `Tilesheet`. Only meaningful alongside `atlas`.
932
- */
933
- sprite?: string;
934
- /** Optional display name (inspector picker). */
935
- name?: string;
936
- /** Optional thumbnail URL (inspector picker grid). */
937
- thumbnailUrl?: string;
938
- }
939
- declare const AssetSchema: z.ZodObject<{
940
- role: z.ZodString;
941
- category: z.ZodString;
942
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
943
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
944
- variant: z.ZodOptional<z.ZodString>;
945
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
946
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
947
- } & {
948
- url: z.ZodString;
949
- atlas: z.ZodOptional<z.ZodString>;
950
- sprite: z.ZodOptional<z.ZodString>;
951
- name: z.ZodOptional<z.ZodString>;
952
- thumbnailUrl: z.ZodOptional<z.ZodString>;
953
- }, "strip", z.ZodTypeAny, {
954
- url: string;
955
- role: string;
956
- category: string;
957
- name?: string | undefined;
958
- animations?: string[] | undefined;
959
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
960
- variant?: string | undefined;
961
- dimension?: "2d" | "3d" | undefined;
962
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
963
- atlas?: string | undefined;
964
- sprite?: string | undefined;
965
- thumbnailUrl?: string | undefined;
966
- }, {
967
- url: string;
968
- role: string;
969
- category: string;
970
- name?: string | undefined;
971
- animations?: string[] | undefined;
972
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
973
- variant?: string | undefined;
974
- dimension?: "2d" | "3d" | undefined;
975
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
976
- atlas?: string | undefined;
977
- sprite?: string | undefined;
978
- thumbnailUrl?: string | undefined;
979
- }>;
980
- /**
981
- * Single browsable asset in the inspector picker catalog.
982
- * Backs the asset/icon pickers — a flat list the inspector renders for
983
- * the user to choose from when a config field's type is `'asset'`.
984
- */
985
- interface AssetCatalogEntry {
986
- /** Resolvable URL to the asset. */
987
- url: string;
988
- /** Display name for the asset. */
989
- name: string;
990
- /** Grouping category within the catalog. */
991
- category: string;
992
- /** Asset kind the picker dispatches on. */
993
- kind: 'image' | 'spritesheet' | 'audio' | 'scene' | 'portrait' | 'model' | 'other';
994
- /** Optional thumbnail URL for grid previews. */
995
- thumbnailUrl?: string;
996
- /** 2D sprite vs 3D model — the asset's actual rendering dimension. */
997
- dimension?: AssetDimension;
998
- /** The asset's actual rendering aspect ratio. */
999
- aspect?: AssetAspect;
1000
- }
1001
- declare const AssetCatalogEntrySchema: z.ZodObject<{
1002
- url: z.ZodString;
1003
- name: z.ZodString;
1004
- category: z.ZodString;
1005
- kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
1006
- thumbnailUrl: z.ZodOptional<z.ZodString>;
1007
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1008
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1009
- }, "strip", z.ZodTypeAny, {
1010
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1011
- url: string;
1012
- name: string;
1013
- category: string;
1014
- dimension?: "2d" | "3d" | undefined;
1015
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1016
- thumbnailUrl?: string | undefined;
1017
- }, {
1018
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1019
- url: string;
1020
- name: string;
1021
- category: string;
1022
- dimension?: "2d" | "3d" | undefined;
1023
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1024
- thumbnailUrl?: string | undefined;
1025
- }>;
1026
- /**
1027
- * Flat list of browsable assets surfaced by the inspector pickers.
1028
- */
1029
- type AssetCatalog = AssetCatalogEntry[];
1030
- declare const AssetCatalogSchema: z.ZodArray<z.ZodObject<{
1031
- url: z.ZodString;
1032
- name: z.ZodString;
1033
- category: z.ZodString;
1034
- kind: z.ZodEnum<["image", "spritesheet", "audio", "scene", "portrait", "model", "other"]>;
1035
- thumbnailUrl: z.ZodOptional<z.ZodString>;
1036
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1037
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1038
- }, "strip", z.ZodTypeAny, {
1039
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1040
- url: string;
1041
- name: string;
1042
- category: string;
1043
- dimension?: "2d" | "3d" | undefined;
1044
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1045
- thumbnailUrl?: string | undefined;
1046
- }, {
1047
- kind: "image" | "spritesheet" | "audio" | "scene" | "portrait" | "model" | "other";
1048
- url: string;
1049
- name: string;
1050
- category: string;
1051
- dimension?: "2d" | "3d" | undefined;
1052
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1053
- thumbnailUrl?: string | undefined;
1054
- }>, "many">;
1055
- /**
1056
- * Asset-reference URL marker. A plain alias over `string` — the value is a
1057
- * resolvable asset URL — but the named type lets the pattern-sync tool
1058
- * (`tools/almadar-pattern-sync/parser.ts`) detect a component prop as an asset
1059
- * field (tagged `asset`) the same way `EventKey`/`LucideIcon` are detected by
1060
- * type identity. Components annotate image/url props as `AssetUrl` (`src`,
1061
- * `backgroundImage`, `avatar`, …); the generator emits a `string` config knob
1062
- * declared as the `asset` config type, which the property inspector dispatches
1063
- * an AssetPicker on. Not branded — asset urls originate from user data, so cast
1064
- * friction would buy nothing; the value is the marker the tool finds.
1065
- */
1066
- type AssetUrl = string;
1067
- /**
1068
- * A neutral position in scene space: 2D (`x`,`y`) or optionally 3D (`x`,`y`,`z`).
1069
- * The single coordinate type shared by every drawable descriptor and camera pose
1070
- * across the 2D and 3D canvas hosts, so a scene composes from the same `{x,y,z?}`
1071
- * regardless of projection or painter. Logical, not pixel — the host's projector
1072
- * maps a `ScenePos` to screen space.
1073
- */
1074
- interface ScenePos {
1075
- x: number;
1076
- y: number;
1077
- z?: number;
1078
- }
1079
- declare const ScenePosSchema: z.ZodObject<{
1080
- x: z.ZodNumber;
1081
- y: z.ZodNumber;
1082
- z: z.ZodOptional<z.ZodNumber>;
1083
- }, "strip", z.ZodTypeAny, {
1084
- x: number;
1085
- y: number;
1086
- z?: number | undefined;
1087
- }, {
1088
- x: number;
1089
- y: number;
1090
- z?: number | undefined;
1091
- }>;
1092
- /**
1093
- * Camera behaviors, unifying the former per-host vocab (2D `camera` string +
1094
- * 3D `cameraMode`). `isometric`/`top-down` are fixed framings; `follow`/`chase`
1095
- * track a target; `perspective` is the 3D dramatic framing.
1096
- */
1097
- declare const CAMERA_MODES: readonly ["isometric", "perspective", "top-down", "follow", "chase"];
1098
- type CameraMode = (typeof CAMERA_MODES)[number];
1099
- declare const CameraModeSchema: z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>;
1100
- /**
1101
- * A neutral camera pose shared by the 2D and 3D canvas hosts, so `type: canvas`
1102
- * carries one camera object regardless of painter. `pos`/`target` are `ScenePos`
1103
- * (logical scene space, not pixels); `zoom` scales the view (the former `scale`);
1104
- * `fov` is the 3D field of view; `mode` selects the framing/tracking behavior.
1105
- * Every field is optional — an omitted camera means the host's default framing.
1106
- */
1107
- interface Camera {
1108
- pos?: ScenePos;
1109
- target?: ScenePos;
1110
- zoom?: number;
1111
- fov?: number;
1112
- mode?: CameraMode;
1113
- }
1114
- declare const CameraSchema: z.ZodObject<{
1115
- pos: z.ZodOptional<z.ZodObject<{
1116
- x: z.ZodNumber;
1117
- y: z.ZodNumber;
1118
- z: z.ZodOptional<z.ZodNumber>;
1119
- }, "strip", z.ZodTypeAny, {
1120
- x: number;
1121
- y: number;
1122
- z?: number | undefined;
1123
- }, {
1124
- x: number;
1125
- y: number;
1126
- z?: number | undefined;
1127
- }>>;
1128
- target: z.ZodOptional<z.ZodObject<{
1129
- x: z.ZodNumber;
1130
- y: z.ZodNumber;
1131
- z: z.ZodOptional<z.ZodNumber>;
1132
- }, "strip", z.ZodTypeAny, {
1133
- x: number;
1134
- y: number;
1135
- z?: number | undefined;
1136
- }, {
1137
- x: number;
1138
- y: number;
1139
- z?: number | undefined;
1140
- }>>;
1141
- zoom: z.ZodOptional<z.ZodNumber>;
1142
- fov: z.ZodOptional<z.ZodNumber>;
1143
- mode: z.ZodOptional<z.ZodEnum<["isometric", "perspective", "top-down", "follow", "chase"]>>;
1144
- }, "strip", z.ZodTypeAny, {
1145
- target?: {
1146
- x: number;
1147
- y: number;
1148
- z?: number | undefined;
1149
- } | undefined;
1150
- pos?: {
1151
- x: number;
1152
- y: number;
1153
- z?: number | undefined;
1154
- } | undefined;
1155
- zoom?: number | undefined;
1156
- fov?: number | undefined;
1157
- mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
1158
- }, {
1159
- target?: {
1160
- x: number;
1161
- y: number;
1162
- z?: number | undefined;
1163
- } | undefined;
1164
- pos?: {
1165
- x: number;
1166
- y: number;
1167
- z?: number | undefined;
1168
- } | undefined;
1169
- zoom?: number | undefined;
1170
- fov?: number | undefined;
1171
- mode?: "isometric" | "perspective" | "top-down" | "follow" | "chase" | undefined;
1172
- }>;
1173
- type SemanticAssetRefInput = z.input<typeof SemanticAssetRefSchema>;
1174
- type AnimationDefInput = z.input<typeof AnimationDefSchema>;
1175
- type AssetCatalogEntryInput = z.input<typeof AssetCatalogEntrySchema>;
1176
- type SpriteSheetAtlasInput = z.input<typeof SpriteSheetAtlasSchema>;
1177
- /**
1178
- * Creates a semantic asset key from role and category.
1179
- *
1180
- * Generates a unique asset identifier by combining role and category
1181
- * with a colon separator. Used for asset management and lookup.
1182
- *
1183
- * @param {EntityRole} role - Entity role (e.g., 'player', 'enemy')
1184
- * @param {string} category - Asset category (e.g., 'sprite', 'animation')
1185
- * @returns {string} Asset key in format 'role:category'
1186
- *
1187
- * @example
1188
- * createAssetKey('player', 'sprite'); // returns 'player:sprite'
1189
- * createAssetKey('enemy', 'animation'); // returns 'enemy:animation'
1190
- */
1191
- declare function createAssetKey(role: EntityRole, category: string): string;
1192
- /**
1193
- * Parses an asset key into role and category components.
1194
- *
1195
- * Deconstructs an asset key string (format 'role:category') into its
1196
- * constituent parts. Returns null if the key format is invalid.
1197
- *
1198
- * @param {string} key - Asset key in format 'role:category'
1199
- * @returns {{ role: string; category: string } | null} Parsed components or null
1200
- *
1201
- * @example
1202
- * parseAssetKey('player:sprite'); // returns { role: 'player', category: 'sprite' }
1203
- * parseAssetKey('enemy:animation'); // returns { role: 'enemy', category: 'animation' }
1204
- * parseAssetKey('invalid'); // returns null
1205
- */
1206
- declare function parseAssetKey(key: string): {
1207
- role: string;
1208
- category: string;
1209
- } | null;
1210
- /**
1211
- * Gets common animations for an entity role.
1212
- *
1213
- * Returns an array of default animation names appropriate for the
1214
- * specified entity role. Used for asset configuration and validation.
1215
- *
1216
- * @param {EntityRole} role - Entity role
1217
- * @returns {string[]} Array of default animation names
1218
- *
1219
- * @example
1220
- * getDefaultAnimationsForRole('player'); // returns ['idle', 'run', 'jump', 'fall', 'attack', 'hurt', 'die']
1221
- * getDefaultAnimationsForRole('enemy'); // returns ['idle', 'walk', 'attack', 'hurt', 'die']
1222
- */
1223
- declare function getDefaultAnimationsForRole(role: EntityRole): string[];
1224
- /**
1225
- * Validates that an asset reference has required animations.
1226
- *
1227
- * Checks if an asset reference contains all required animations.
1228
- * Returns an error message if validation fails, or null if valid.
1229
- *
1230
- * @param {SemanticAssetRef} assetRef - Asset reference to validate
1231
- * @param {string[]} requiredAnimations - Required animation names
1232
- * @returns {string | null} Error message or null if valid
1233
- *
1234
- * @example
1235
- * validateAssetAnimations(assetRef, ['idle', 'run']); // returns null if valid
1236
- * validateAssetAnimations(assetRef, ['missing-animation']); // returns error message
1237
- */
1238
- declare function validateAssetAnimations(assetRef: SemanticAssetRef, requiredAnimations: string[]): {
1239
- valid: boolean;
1240
- missing: string[];
1241
- };
1242
-
1243
- /**
1244
- * Entity Types for Orbital Units
1245
- *
1246
- * Defines the OrbitalEntity type - the nucleus of an Orbital Unit.
1247
- *
1248
- * @packageDocumentation
1249
- */
1250
-
1251
- /**
1252
- * Entity persistence types.
1253
- *
1254
- * - persistent: Stored in database (has collection)
1255
- * - runtime: Exists only at runtime (not persisted)
1256
- */
1257
- type EntityPersistence = 'persistent' | 'runtime';
1258
- declare const EntityPersistenceSchema: z.ZodEnum<["persistent", "runtime"]>;
1259
- /**
1260
- * OrbitalEntity - the nucleus of an Orbital Unit.
1261
- *
1262
- * This is a simplified entity definition optimized for orbital composition.
1263
- * Collection names are derived automatically from persistence type if not provided.
1264
- */
1265
- type OrbitalEntity = {
1266
- /** V4 dual-carry id sibling of `name` — optional until the Phase-7 flip. */
1267
- id?: EntityId;
1268
- /** Entity name (PascalCase, e.g., "Task", "User") */
1269
- name: string;
1270
- /** Entity persistence type (defaults to 'persistent' if not specified) */
1271
- persistence?: EntityPersistence;
1272
- /** Whether this entity's state is shared across all bound traits (vs per-trait copy). Orthogonal to persistence. */
1273
- shared?: boolean;
1274
- /**
1275
- * Whether this entity types the ambient `@user` viewer. Orthogonal to both
1276
- * `persistence` and `shared`: `[persistent: people, identity]` is an
1277
- * app-owned user directory, `[runtime, identity]` the provider-supplied
1278
- * current viewer. At most one per composed program.
1279
- */
1280
- identity?: boolean;
1281
- /** Collection name (auto-derived if not provided for persistent entities) */
1282
- collection?: string;
1283
- /** Entity fields */
1284
- fields: EntityField[];
1285
- /** Pre-authored instances (seed data or static reference data) */
1286
- instances?: EntityRow[];
1287
- /** Auto-add createdAt/updatedAt timestamps */
1288
- timestamps?: boolean;
1289
- /** Soft delete support */
1290
- softDelete?: boolean;
1291
- /** Human-readable description */
1292
- description?: string;
1293
- /** Visual prompt for AI generation */
1294
- visual_prompt?: string;
1295
- /** Semantic asset reference for visual representation (games) */
1296
- assetRef?: SemanticAssetRef;
1297
- };
1298
- declare const OrbitalEntitySchema: z.ZodObject<{
1299
- name: z.ZodString;
1300
- persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
1301
- shared: z.ZodOptional<z.ZodBoolean>;
1302
- identity: z.ZodOptional<z.ZodBoolean>;
1303
- collection: z.ZodOptional<z.ZodString>;
1304
- fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
1305
- instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1306
- timestamps: z.ZodOptional<z.ZodBoolean>;
1307
- softDelete: z.ZodOptional<z.ZodBoolean>;
1308
- description: z.ZodOptional<z.ZodString>;
1309
- visual_prompt: z.ZodOptional<z.ZodString>;
1310
- assetRef: z.ZodOptional<z.ZodObject<{
1311
- role: z.ZodString;
1312
- category: z.ZodString;
1313
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1314
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1315
- variant: z.ZodOptional<z.ZodString>;
1316
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1317
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1318
- }, "strip", z.ZodTypeAny, {
1319
- role: string;
1320
- category: string;
1321
- animations?: string[] | undefined;
1322
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1323
- variant?: string | undefined;
1324
- dimension?: "2d" | "3d" | undefined;
1325
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1326
- }, {
1327
- role: string;
1328
- category: string;
1329
- animations?: string[] | undefined;
1330
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1331
- variant?: string | undefined;
1332
- dimension?: "2d" | "3d" | undefined;
1333
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1334
- }>>;
1335
- }, "strip", z.ZodTypeAny, {
1336
- name: string;
1337
- persistence: "persistent" | "runtime";
1338
- fields: EntityField[];
1339
- description?: string | undefined;
1340
- shared?: boolean | undefined;
1341
- identity?: boolean | undefined;
1342
- collection?: string | undefined;
1343
- instances?: Record<string, unknown>[] | undefined;
1344
- timestamps?: boolean | undefined;
1345
- softDelete?: boolean | undefined;
1346
- visual_prompt?: string | undefined;
1347
- assetRef?: {
1348
- role: string;
1349
- category: string;
1350
- animations?: string[] | undefined;
1351
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1352
- variant?: string | undefined;
1353
- dimension?: "2d" | "3d" | undefined;
1354
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1355
- } | undefined;
1356
- }, {
1357
- name: string;
1358
- fields: unknown[];
1359
- description?: string | undefined;
1360
- persistence?: "persistent" | "runtime" | undefined;
1361
- shared?: boolean | undefined;
1362
- identity?: boolean | undefined;
1363
- collection?: string | undefined;
1364
- instances?: Record<string, unknown>[] | undefined;
1365
- timestamps?: boolean | undefined;
1366
- softDelete?: boolean | undefined;
1367
- visual_prompt?: string | undefined;
1368
- assetRef?: {
1369
- role: string;
1370
- category: string;
1371
- animations?: string[] | undefined;
1372
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1373
- variant?: string | undefined;
1374
- dimension?: "2d" | "3d" | undefined;
1375
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1376
- } | undefined;
1377
- }>;
1378
- type OrbitalEntityInput = z.input<typeof OrbitalEntitySchema>;
1379
- /** Alias for OrbitalEntity - preferred name */
1380
- type Entity = OrbitalEntity;
1381
- /** Alias for OrbitalEntitySchema - preferred name */
1382
- declare const EntitySchema: z.ZodObject<{
1383
- name: z.ZodString;
1384
- persistence: z.ZodDefault<z.ZodEnum<["persistent", "runtime"]>>;
1385
- shared: z.ZodOptional<z.ZodBoolean>;
1386
- identity: z.ZodOptional<z.ZodBoolean>;
1387
- collection: z.ZodOptional<z.ZodString>;
1388
- fields: z.ZodArray<z.ZodType<EntityField, z.ZodTypeDef, unknown>, "many">;
1389
- instances: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1390
- timestamps: z.ZodOptional<z.ZodBoolean>;
1391
- softDelete: z.ZodOptional<z.ZodBoolean>;
1392
- description: z.ZodOptional<z.ZodString>;
1393
- visual_prompt: z.ZodOptional<z.ZodString>;
1394
- assetRef: z.ZodOptional<z.ZodObject<{
1395
- role: z.ZodString;
1396
- category: z.ZodString;
1397
- animations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1398
- style: z.ZodOptional<z.ZodEnum<["pixel", "vector", "hd", "1-bit", "isometric"]>>;
1399
- variant: z.ZodOptional<z.ZodString>;
1400
- dimension: z.ZodOptional<z.ZodEnum<["2d", "3d"]>>;
1401
- aspect: z.ZodOptional<z.ZodEnum<["1:1", "16:9", "5:7", "8:1"]>>;
1402
- }, "strip", z.ZodTypeAny, {
1403
- role: string;
1404
- category: string;
1405
- animations?: string[] | undefined;
1406
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1407
- variant?: string | undefined;
1408
- dimension?: "2d" | "3d" | undefined;
1409
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1410
- }, {
1411
- role: string;
1412
- category: string;
1413
- animations?: string[] | undefined;
1414
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1415
- variant?: string | undefined;
1416
- dimension?: "2d" | "3d" | undefined;
1417
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1418
- }>>;
1419
- }, "strip", z.ZodTypeAny, {
1420
- name: string;
1421
- persistence: "persistent" | "runtime";
1422
- fields: EntityField[];
1423
- description?: string | undefined;
1424
- shared?: boolean | undefined;
1425
- identity?: boolean | undefined;
1426
- collection?: string | undefined;
1427
- instances?: Record<string, unknown>[] | undefined;
1428
- timestamps?: boolean | undefined;
1429
- softDelete?: boolean | undefined;
1430
- visual_prompt?: string | undefined;
1431
- assetRef?: {
1432
- role: string;
1433
- category: string;
1434
- animations?: string[] | undefined;
1435
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1436
- variant?: string | undefined;
1437
- dimension?: "2d" | "3d" | undefined;
1438
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1439
- } | undefined;
1440
- }, {
1441
- name: string;
1442
- fields: unknown[];
1443
- description?: string | undefined;
1444
- persistence?: "persistent" | "runtime" | undefined;
1445
- shared?: boolean | undefined;
1446
- identity?: boolean | undefined;
1447
- collection?: string | undefined;
1448
- instances?: Record<string, unknown>[] | undefined;
1449
- timestamps?: boolean | undefined;
1450
- softDelete?: boolean | undefined;
1451
- visual_prompt?: string | undefined;
1452
- assetRef?: {
1453
- role: string;
1454
- category: string;
1455
- animations?: string[] | undefined;
1456
- style?: "pixel" | "vector" | "hd" | "1-bit" | "isometric" | undefined;
1457
- variant?: string | undefined;
1458
- dimension?: "2d" | "3d" | undefined;
1459
- aspect?: "1:1" | "16:9" | "5:7" | "8:1" | undefined;
1460
- } | undefined;
1461
- }>;
1462
- /**
1463
- * Derives the collection name for a persistent entity.
1464
- *
1465
- * Generates the database collection name by converting the entity name
1466
- * to lowercase and adding an 's' suffix (simple pluralization).
1467
- * Returns undefined for non-persistent (runtime) entities.
1468
- *
1469
- * @param {OrbitalEntity} entity - Entity to derive collection name for
1470
- * @returns {string | undefined} Collection name or undefined for non-persistent entities
1471
- *
1472
- * @example
1473
- * deriveCollection({ name: 'User', persistence: 'persistent' }); // returns 'users'
1474
- * deriveCollection({ name: 'Task', persistence: 'runtime' }); // returns undefined
1475
- */
1476
- declare function deriveCollection(entity: OrbitalEntity): string | undefined;
1477
- /**
1478
- * Checks if an entity is runtime-only (not persisted).
1479
- *
1480
- * Type guard to determine if an entity exists only at runtime
1481
- * and is not stored in the database.
1482
- *
1483
- * @param {OrbitalEntity} entity - Entity to check
1484
- * @returns {boolean} True if entity is runtime-only, false otherwise
1485
- *
1486
- * @example
1487
- * isRuntimeEntity({ persistence: 'runtime' }); // returns true
1488
- * isRuntimeEntity({ persistence: 'persistent' }); // returns false
1489
- */
1490
- declare function isRuntimeEntity(entity: OrbitalEntity): boolean;
1491
- /**
1492
- * Checks whether an entity's persistence mode allows `persistence` /
1493
- * `collection` overrides at the factory call site.
1494
- *
1495
- * Only `persistent` entities (explicit or default) support these overrides.
1496
- * Runtime entities are fixed; callers must not expose `persistence` or
1497
- * `collection` params for them.
1498
- *
1499
- * @param persistence - The entity persistence mode (undefined = default persistent)
1500
- * @returns True when overrides are allowed, false otherwise
1501
- *
1502
- * @example
1503
- * persistenceModeAllowsOverrides('persistent'); // returns true
1504
- * persistenceModeAllowsOverrides('runtime'); // returns false
1505
- * persistenceModeAllowsOverrides(undefined); // returns true (default persistent)
1506
- */
1507
- declare function persistenceModeAllowsOverrides(persistence: EntityPersistence | undefined): boolean;
1508
- /**
1509
- * A single field value at runtime.
1510
- * Union of all possible types from FieldType: string, number, boolean, date, array, nested.
1511
- * The nested-record branch's index signature tolerates `undefined` so that
1512
- * TypeScript optional properties (`x?: string`, carrying `string | undefined`)
1513
- * on EntityRow extenders typecheck without ceremony. At JSON serialization
1514
- * time `undefined` is equivalent to "key absent" and never appears on the
1515
- * wire; the inclusion here is a pure type-surface accommodation.
1516
- */
1517
- type FieldValue = string | number | boolean | Date | null | string[] | FieldValue[] | {
1518
- [key: string]: FieldValue | undefined;
1519
- };
1520
- /**
1521
- * Runtime guard for `FieldValue` — narrows interpreter-produced `unknown`
1522
- * values at typed substrate boundaries (e.g. `IntegrationContext.http` body).
1523
- */
1524
- declare function isFieldValue(value: unknown): value is FieldValue;
1525
- /**
1526
- * One instance of an entity with actual field values.
1527
- * The shape is determined by the Entity definition at schema time.
1528
- *
1529
- * @example
1530
- * // Entity defines: Patient { fullName: string, age: number, active: boolean }
1531
- * // EntityRow is: { id: "p1", fullName: "Sarah", age: 34, active: true }
1532
- */
1533
- type EntityRow = {
1534
- id?: string;
1535
- } & Record<string, FieldValue | undefined>;
1536
- /**
1537
- * A field-TYPED `EntityRow` — the SINGLE entity type, refined with a concrete
1538
- * field SHAPE `S`. Non-optional members of `S` are REQUIRED, each with its real
1539
- * type; the result stays `& EntityRow`, so the index signature is intact and
1540
- * every other field is still field-open — any domain entity that provides those
1541
- * fields satisfies it.
1542
- *
1543
- * One declaration, two jobs: (1) TypeScript enforces the bound entity has the
1544
- * fields WITH their types (a behavior binding a thinner/mistyped entity fails to
1545
- * typecheck); and (2) pattern-sync reads the same type and writes the entity
1546
- * prop's field shape (`properties` + `requiredFields`) onto the registry, so
1547
- * lolo-ui emits a COMPLETE `entity { … }` (every field, typed + demo-seeded) and
1548
- * the `ORB_X_ENTITY_PROP_CONTRACT` validator rejects an incompatible bind at
1549
- * `orbital validate`. (A raw `EntityRow & { rating: number }` intersection is
1550
- * equivalent for one-off shapes.)
1551
- *
1552
- * @example
1553
- * // HeroOrganism renders entity.title / entity.subtitle:
1554
- * entity?: EntityWith<{ title: string; subtitle?: string }>;
1555
- * // entity.title → string (required)
1556
- * // entity.subtitle → string | undefined (optional)
1557
- * // entity.other → FieldValue | undefined (still field-open)
1558
- */
1559
- type EntityWith<S extends object> = EntityRow & S;
1560
- /**
1561
- * Collection of entity instances keyed by entity name.
1562
- * Used by OrbPreview mockData, OrbitalServerRuntime state, data grids, etc.
1563
- *
1564
- * @example
1565
- * const data: EntityData = {
1566
- * Patient: [{ id: "1", fullName: "Sarah", age: 34 }],
1567
- * QueueEntry: [{ id: "1", patientName: "Sarah", waitMinutes: 12 }],
1568
- * };
1569
- */
1570
- type EntityData = Record<string, EntityRow[]>;
1571
-
1572
- export { FieldSchema as $, ANIMATION_NAMES as A, type Camera as B, CAMERA_MODES as C, type CameraMode as D, type EntityPersistence as E, type FieldValue as F, CameraModeSchema as G, CameraSchema as H, ENTITY_ROLES as I, type JsonValue as J, type EntityData as K, type EntityFieldInput as L, EntityFieldSchema as M, EntityIdSchema as N, type OrbitalId as O, type PageId as P, EntityPersistenceSchema as Q, type RelationConfig as R, type EntityRole as S, type TraitId as T, EntityRoleSchema as U, EntitySchema as V, type EntityWith as W, type EnumEntityField as X, EventIdSchema as Y, FIELD_TYPES as Z, type Field as _, type EntityField as a, isEntityId as a$, type FieldType as a0, FieldTypeSchema as a1, type IdForKind as a2, type IdKind as a3, type IdentityLedger as a4, IdentityLedgerSchema as a5, type JsonObject as a6, type LedgerEntry as a7, LedgerEntrySchema as a8, type LedgerKind as a9, SpriteSheetAtlasSchema as aA, type SubTexture as aB, SubTextureSchema as aC, type TextureAtlas as aD, TextureAtlasSchema as aE, type ThemeId as aF, ThemeIdSchema as aG, type Tilesheet as aH, TilesheetSchema as aI, TraitIdSchema as aJ, VISUAL_STYLES as aK, type VisualStyle as aL, VisualStyleSchema as aM, asEntityId as aN, asEventId as aO, asOrbitalId as aP, asPageId as aQ, asPaletteEntryId as aR, asServiceId as aS, asThemeId as aT, asTraitId as aU, createAssetKey as aV, deriveCollection as aW, getDefaultAnimationsForRole as aX, idKindOf as aY, idPrefix as aZ, isEmailValue as a_, LedgerKindSchema as aa, type ObjectEntityField as ab, type OrbitalEntity as ac, type OrbitalEntityInput as ad, OrbitalEntitySchema as ae, OrbitalIdSchema as af, PageIdSchema as ag, type PaletteEntryId as ah, PaletteEntryIdSchema as ai, RelationConfigSchema as aj, type RelationEntityField as ak, SEMANTIC_STRING_TYPES as al, SPRITE_DIRECTIONS as am, type ScalarEntityField as an, type ScenePos as ao, ScenePosSchema as ap, type SemanticAssetRef as aq, type SemanticAssetRefInput as ar, SemanticAssetRefSchema as as, type SemanticStringType as at, type ServiceId as au, ServiceIdSchema as av, type SpriteDirection as aw, SpriteDirectionSchema as ax, type SpriteSheetAtlas as ay, type SpriteSheetAtlasInput as az, type EntityRow as b, isEventId as b0, isFieldValue as b1, isJsonArray as b2, isJsonObject as b3, isJsonPrimitive as b4, isOrbitalId as b5, isPageId as b6, isPaletteEntryId as b7, isPhoneValue as b8, isRuntimeEntity as b9, isSemanticStringType as ba, isSemanticStringValue as bb, isServiceId as bc, isThemeId as bd, isTraitId as be, isUrlValue as bf, isUuidValue as bg, ledgerCurName as bh, ledgerRename as bi, ledgerResolveName as bj, mintId as bk, parseAssetKey as bl, persistenceModeAllowsOverrides as bm, validateAssetAnimations as bn, type EventId as c, type EntityId as d, type Entity as e, type ToolArgs as f, ASSET_ASPECTS as g, ASSET_DIMENSIONS as h, type AnimationDef as i, type AnimationDefInput as j, AnimationDefSchema as k, type AnimationName as l, AnimationNameSchema as m, type ArrayEntityField as n, type Asset as o, type AssetAspect as p, AssetAspectSchema as q, type AssetCatalog as r, type AssetCatalogEntry as s, type AssetCatalogEntryInput as t, AssetCatalogEntrySchema as u, AssetCatalogSchema as v, type AssetDimension as w, AssetDimensionSchema as x, AssetSchema as y, type AssetUrl as z };