@almadar/core 8.7.3 → 8.8.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.
@@ -0,0 +1,57 @@
1
+ /**
2
+ * JSON primitives — the universal "data crossed a boundary" type.
3
+ *
4
+ * Every value that arrives over the wire from an LLM (tool-call args),
5
+ * from disk (workspace files), or from an HTTP body before
6
+ * domain-specific validation is a `JsonValue`. Narrow with a typed
7
+ * predicate (`is`-guard) at the boundary; don't widen back to `unknown`.
8
+ *
9
+ * `JsonObject` and `ToolArgs` are aliases for the common
10
+ * `Record<string, JsonValue>` shape. `ToolArgs` is the name the
11
+ * agent surface uses for LLM-emitted tool-call arguments; `JsonObject`
12
+ * is the general-purpose alias. They are the same type — the alias
13
+ * exists so call sites read at the right semantic level.
14
+ *
15
+ * Why not `Record<string, unknown>`? Two reasons. (1) `unknown` widens
16
+ * back to anything, which defeats the purpose of typing the boundary.
17
+ * (2) The `@almadar/eslint-plugin/no-record-string-unknown` rule blocks
18
+ * the wider form — `JsonValue`-based records are the typed answer.
19
+ *
20
+ * @packageDocumentation
21
+ */
22
+ /**
23
+ * Recursive JSON value union — every shape JSON can carry.
24
+ */
25
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
26
+ [key: string]: JsonValue;
27
+ };
28
+ /**
29
+ * JSON object — keyed string→JsonValue. The wire form of arbitrary
30
+ * structured data. Replaces `Record<string, unknown>` at typed
31
+ * boundaries (LLM emits, file reads, HTTP bodies).
32
+ */
33
+ type JsonObject = {
34
+ [key: string]: JsonValue;
35
+ };
36
+ /**
37
+ * LLM tool-call arguments — same shape as `JsonObject`, named for the
38
+ * agent-surface call site. Each tool's `execute(args: ToolArgs)`
39
+ * receives this and narrows via an `is`-guard predicate before any
40
+ * field access.
41
+ */
42
+ type ToolArgs = JsonObject;
43
+ /**
44
+ * Type guard: is the given value a JSON primitive (non-array,
45
+ * non-object)? Used by walkers that decide whether to recurse.
46
+ */
47
+ declare function isJsonPrimitive(value: JsonValue): value is string | number | boolean | null;
48
+ /**
49
+ * Type guard: is the given value a JSON object (non-array, non-null)?
50
+ */
51
+ declare function isJsonObject(value: JsonValue): value is JsonObject;
52
+ /**
53
+ * Type guard: is the given value a JSON array?
54
+ */
55
+ declare function isJsonArray(value: JsonValue): value is JsonValue[];
56
+
57
+ export { type JsonObject as J, type ToolArgs as T, type JsonValue as a, isJsonObject as b, isJsonPrimitive as c, isJsonArray as i };
@@ -1,5 +1,5 @@
1
1
  import { d as Expression, S as SExpr } from './expression-BVRFm0sV.js';
2
- import { bn as TraitConfig, bo as TraitConfigObject, a_ as ServiceRef, z as Entity, F as EntityField, I as EntityPersistence, bB as TraitRef, T as EventPayloadField, o as ConfigFieldDeclaration, aW as ServiceDefinition, bk as Trait } from './trait-Cvs0OQbV.js';
2
+ import { bn as TraitConfig, bo as TraitConfigObject, a_ as ServiceRef, z as Entity, F as EntityField, I as EntityPersistence, bB as TraitRef, T as EventPayloadField, o as ConfigFieldDeclaration, aW as ServiceDefinition, bk as Trait } from './trait-BVLBQ9uk.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -5770,4 +5770,4 @@ declare const OrbitalTraitRefSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
5770
5770
  } | undefined;
5771
5771
  }>]>;
5772
5772
 
5773
- export { type Field as $, type AgentEffect as A, type EntityData as B, type CallServiceConfig as C, type DeclaredTraitConfig as D, ENTITY_ROLES as E, type EntityField as F, type EntityFieldInput as G, EntityFieldSchema as H, type EntityPersistence as I, EntityPersistenceSchema as J, type EntityRole as K, EntityRoleSchema as L, type EntityRow as M, EntitySchema as N, type EnumEntityField as O, type EvaluateConfig as P, type EvaluateEffect as Q, type Event as R, type EventInput as S, type EventPayloadField as T, EventPayloadFieldSchema as U, EventSchema as V, type EventScope as W, EventScopeSchema as X, type FetchEffect as Y, type FetchOptions as Z, type FetchResult as _, type AnimationDef as a, type ServiceRefObject as a$, type FieldFormat as a0, FieldFormatSchema as a1, FieldSchema as a2, type FieldType as a3, FieldTypeSchema as a4, type FieldValue as a5, type ForwardConfig as a6, type ForwardEffect as a7, GAME_TYPES as a8, type GameType as a9, type RelationConfig as aA, RelationConfigSchema as aB, type RelationEntityField as aC, type RenderItemLambda as aD, type RenderUIConfig as aE, type RenderUIEffect as aF, type RenderUINode as aG, type RequiredField as aH, RequiredFieldSchema as aI, type ResolvedAsset as aJ, type ResolvedAssetInput as aK, ResolvedAssetSchema as aL, type ResolvedPatternProps as aM, type RestAuthConfig as aN, RestAuthConfigSchema as aO, type RestServiceDef as aP, RestServiceDefSchema as aQ, SERVICE_TYPES as aR, type ScalarEntityField as aS, type SemanticAssetRef as aT, type SemanticAssetRefInput as aU, SemanticAssetRefSchema as aV, type ServiceDefinition as aW, ServiceDefinitionSchema as aX, type ServiceParams as aY, type ServiceParamsValue as aZ, type ServiceRef as a_, GameTypeSchema as aa, type Guard as ab, type GuardInput as ac, GuardSchema as ad, type ListenSource as ae, ListenSourceSchema as af, type LogEffect as ag, type McpServiceDef as ah, McpServiceDefSchema as ai, type NavigateEffect as aj, type NnConfig as ak, type NnLayer as al, type NotifyEffect as am, type OrbitalEntity as an, type OrbitalEntityInput as ao, OrbitalEntitySchema as ap, type OrbitalTraitRef as aq, OrbitalTraitRefSchema as ar, type OsEffect as as, type PayloadField as at, PayloadFieldSchema as au, type PersistData as av, type PersistEffect as aw, type PersistEmitConfig as ax, type PresentationType as ay, type RefEffect as az, type AnimationDefInput as b, despawn as b$, ServiceRefObjectSchema as b0, ServiceRefSchema as b1, ServiceRefStringSchema as b2, type ServiceType as b3, ServiceTypeSchema as b4, type SetEffect as b5, type SocketEvents as b6, SocketEventsSchema as b7, type SocketServiceDef as b8, SocketServiceDefSchema as b9, type TraitInput as bA, type TraitRef as bB, TraitRefSchema as bC, type TraitReference as bD, type TraitReferenceInput as bE, TraitReferenceSchema as bF, TraitSchema as bG, type TraitTick as bH, TraitTickSchema as bI, type TraitUIBinding as bJ, type Transition as bK, type TransitionInput as bL, TransitionSchema as bM, type TypedEffect as bN, type UISlot as bO, UISlotSchema as bP, UI_SLOTS as bQ, VISUAL_STYLES as bR, type VisualStyle as bS, VisualStyleSchema as bT, type WatchEffect as bU, type WatchOptions as bV, atomic as bW, callService as bX, createAssetKey as bY, deref as bZ, deriveCollection as b_, type SpawnEffect as ba, type State as bb, type StateInput as bc, type StateMachine as bd, type StateMachineInput as be, StateMachineSchema as bf, StateSchema as bg, type SwapEffect as bh, type TrainConfig as bi, type TrainEffect as bj, type Trait as bk, type TraitCategory as bl, TraitCategorySchema as bm, type TraitConfig as bn, type TraitConfigObject as bo, TraitConfigSchema as bp, type TraitConfigValue as bq, TraitConfigValueSchema as br, type TraitDataEntity as bs, TraitDataEntitySchema as bt, type TraitEntityField as bu, TraitEntityFieldSchema as bv, type TraitEventContract as bw, TraitEventContractSchema as bx, type TraitEventListener as by, TraitEventListenerSchema as bz, AnimationDefSchema as c, doEffects as c0, emit as c1, findService as c2, getDefaultAnimationsForRole as c3, getServiceNames as c4, getTraitConfig as c5, getTraitName as c6, hasService as c7, isCircuitEvent as c8, isEffect as c9, isInlineTrait as ca, isMcpService as cb, isRestService as cc, isRuntimeEntity as cd, isSExprEffect as ce, isServiceReference as cf, isServiceReferenceObject as cg, isSingletonEntity as ch, isSocketService as ci, navigate as cj, normalizeTraitRef as ck, notify as cl, parseAssetKey as cm, parseServiceRef as cn, persist as co, ref as cp, renderUI as cq, set as cr, spawn as cs, swap as ct, validateAssetAnimations as cu, watch as cv, type ArrayEntityField as d, type AssetMap as e, type AssetMapInput as f, AssetMapSchema as g, type AssetMapping as h, type AssetMappingInput as i, AssetMappingSchema as j, type AtomicEffect as k, type CallServiceEffect as l, type CheckpointLoadEffect as m, type CheckpointSaveEffect as n, type ConfigFieldDeclaration as o, ConfigFieldDeclarationSchema as p, DeclaredTraitConfigSchema as q, type DerefEffect as r, type DespawnEffect as s, type DoEffect as t, type Effect as u, type EffectInput as v, EffectSchema as w, type EmitConfig as x, type EmitEffect as y, type Entity as z };
5773
+ export { type Field as $, type AgentEffect as A, type EntityData as B, type CallServiceConfig as C, type DeclaredTraitConfig as D, ENTITY_ROLES as E, type EntityField as F, type EntityFieldInput as G, EntityFieldSchema as H, type EntityPersistence as I, EntityPersistenceSchema as J, type EntityRole as K, EntityRoleSchema as L, type EntityRow as M, EntitySchema as N, type EnumEntityField as O, type EvaluateConfig as P, type EvaluateEffect as Q, type Event as R, type EventInput as S, type EventPayloadField as T, EventPayloadFieldSchema as U, EventSchema as V, type EventScope as W, EventScopeSchema as X, type FetchEffect as Y, type FetchOptions as Z, type FetchResult as _, type AnimationDef as a, type ServiceRefObject as a$, type FieldFormat as a0, FieldFormatSchema as a1, FieldSchema as a2, type FieldType as a3, FieldTypeSchema as a4, type FieldValue as a5, type ForwardConfig as a6, type ForwardEffect as a7, GAME_TYPES as a8, type GameType as a9, type RelationConfig as aA, RelationConfigSchema as aB, type RelationEntityField as aC, type RenderItemLambda as aD, type RenderUIConfig as aE, type RenderUIEffect as aF, type RenderUINode as aG, type RequiredField as aH, RequiredFieldSchema as aI, type ResolvedAsset as aJ, type ResolvedAssetInput as aK, ResolvedAssetSchema as aL, type ResolvedPatternProps as aM, type RestAuthConfig as aN, RestAuthConfigSchema as aO, type RestServiceDef as aP, RestServiceDefSchema as aQ, SERVICE_TYPES as aR, type ScalarEntityField as aS, type SemanticAssetRef as aT, type SemanticAssetRefInput as aU, SemanticAssetRefSchema as aV, type ServiceDefinition as aW, ServiceDefinitionSchema as aX, type ServiceParams as aY, type ServiceParamsValue as aZ, type ServiceRef as a_, GameTypeSchema as aa, type Guard as ab, type GuardInput as ac, GuardSchema as ad, type ListenSource as ae, ListenSourceSchema as af, type LogEffect as ag, type McpServiceDef as ah, McpServiceDefSchema as ai, type NavigateEffect as aj, type NnConfig as ak, type NnLayer as al, type NotifyEffect as am, type OrbitalEntity as an, type OrbitalEntityInput as ao, OrbitalEntitySchema as ap, type OrbitalTraitRef as aq, OrbitalTraitRefSchema as ar, type OsEffect as as, type PayloadField as at, PayloadFieldSchema as au, type PersistData as av, type PersistEffect as aw, type PersistEmitConfig as ax, type PresentationType as ay, type RefEffect as az, type AnimationDefInput as b, deriveCollection as b$, ServiceRefObjectSchema as b0, ServiceRefSchema as b1, ServiceRefStringSchema as b2, type ServiceType as b3, ServiceTypeSchema as b4, type SetEffect as b5, type SocketEvents as b6, SocketEventsSchema as b7, type SocketServiceDef as b8, SocketServiceDefSchema as b9, type TraitInput as bA, type TraitRef as bB, TraitRefSchema as bC, type TraitReference as bD, type TraitReferenceInput as bE, TraitReferenceSchema as bF, TraitSchema as bG, type TraitScope as bH, type TraitTick as bI, TraitTickSchema as bJ, type TraitUIBinding as bK, type Transition as bL, type TransitionInput as bM, TransitionSchema as bN, type TypedEffect as bO, type UISlot as bP, UISlotSchema as bQ, UI_SLOTS as bR, VISUAL_STYLES as bS, type VisualStyle as bT, VisualStyleSchema as bU, type WatchEffect as bV, type WatchOptions as bW, atomic as bX, callService as bY, createAssetKey as bZ, deref as b_, type SpawnEffect as ba, type State as bb, type StateInput as bc, type StateMachine as bd, type StateMachineInput as be, StateMachineSchema as bf, StateSchema as bg, type SwapEffect as bh, type TrainConfig as bi, type TrainEffect as bj, type Trait as bk, type TraitCategory as bl, TraitCategorySchema as bm, type TraitConfig as bn, type TraitConfigObject as bo, TraitConfigSchema as bp, type TraitConfigValue as bq, TraitConfigValueSchema as br, type TraitDataEntity as bs, TraitDataEntitySchema as bt, type TraitEntityField as bu, TraitEntityFieldSchema as bv, type TraitEventContract as bw, TraitEventContractSchema as bx, type TraitEventListener as by, TraitEventListenerSchema as bz, AnimationDefSchema as c, despawn as c0, doEffects as c1, emit as c2, findService as c3, getDefaultAnimationsForRole as c4, getServiceNames as c5, getTraitConfig as c6, getTraitName as c7, hasService as c8, isCircuitEvent as c9, isEffect as ca, isInlineTrait as cb, isMcpService as cc, isRestService as cd, isRuntimeEntity as ce, isSExprEffect as cf, isServiceReference as cg, isServiceReferenceObject as ch, isSingletonEntity as ci, isSocketService as cj, navigate as ck, normalizeTraitRef as cl, notify as cm, parseAssetKey as cn, parseServiceRef as co, persist as cp, ref as cq, renderUI as cr, set as cs, spawn as ct, swap as cu, validateAssetAnimations as cv, watch as cw, type ArrayEntityField as d, type AssetMap as e, type AssetMapInput as f, AssetMapSchema as g, type AssetMapping as h, type AssetMappingInput as i, AssetMappingSchema as j, type AtomicEffect as k, type CallServiceEffect as l, type CheckpointLoadEffect as m, type CheckpointSaveEffect as n, type ConfigFieldDeclaration as o, ConfigFieldDeclarationSchema as p, DeclaredTraitConfigSchema as q, type DerefEffect as r, type DespawnEffect as s, type DoEffect as t, type Effect as u, type EffectInput as v, EffectSchema as w, type EmitConfig as x, type EmitEffect as y, type Entity as z };
@@ -1,12 +1,13 @@
1
- import { a3 as OrbitalSchema, T as Orbital, aa as Page, u as DomainContext } from '../schema-BQCTssuv.js';
2
- export { A as AGENT_DOMAIN_CATEGORIES, a as ALLOWED_CUSTOM_COMPONENTS, b as AgentDomainCategory, c as AgentDomainCategorySchema, d as AllowedCustomComponent, C as ComputedEventContract, e as ComputedEventContractSchema, f as ComputedEventListener, g as ComputedEventListenerSchema, h as CustomPatternDefinition, i as CustomPatternDefinitionInput, j as CustomPatternDefinitionSchema, k as CustomPatternMap, l as CustomPatternMapInput, m as CustomPatternMapSchema, D as DesignPreferences, n as DesignPreferencesInput, o as DesignPreferencesSchema, p as DesignTokens, q as DesignTokensInput, r as DesignTokensSchema, s as DomainCategory, t as DomainCategorySchema, v as DomainContextInput, w as DomainContextSchema, x as DomainVocabulary, y as DomainVocabularySchema, E as EntityCall, z as EntityCallSchema, B as EntityRef, F as EntityRefSchema, G as EntityRefStringSchema, H as EntitySemanticRole, I as EntitySemanticRoleSchema, J as EventListener, K as EventListenerSchema, L as EventSemanticRole, M as EventSemanticRoleSchema, N as EventSource, O as EventSourceSchema, P as GameSubCategory, Q as GameSubCategorySchema, R as NodeClassification, S as NodeClassificationSchema, U as OrbitalConfig, V as OrbitalConfigInput, W as OrbitalConfigSchema, X as OrbitalDefinition, Y as OrbitalDefinitionSchema, Z as OrbitalInput, _ as OrbitalPage, $ as OrbitalPageInput, a0 as OrbitalPageSchema, a1 as OrbitalPageStrictInput, a2 as OrbitalPageStrictSchema, a5 as OrbitalSchemaInput, a6 as OrbitalSchemaSchema, a7 as OrbitalSchemaWithTraits, a8 as OrbitalUnit, a9 as OrbitalUnitSchema, a4 as OrbitalZodSchema, ab as PageRef, ac as PageRefObject, ad as PageRefObjectSchema, ae as PageRefSchema, af as PageRefStringSchema, ag as PageSchema, ah as PageTraitRef, ai as PageTraitRefSchema, aj as RelatedLink, ak as RelatedLinkSchema, al as StateSemanticRole, am as StateSemanticRoleSchema, an as SuggestedGuard, ao as SuggestedGuardSchema, ap as ThemeDefinition, aq as ThemeDefinitionSchema, ar as ThemeRef, as as ThemeRefSchema, at as ThemeRefStringSchema, au as ThemeTokens, av as ThemeTokensSchema, aw as ThemeVariant, ax as ThemeVariantSchema, ay as UXHints, az as UXHintsSchema, aA as UseDeclaration, aB as UseDeclarationSchema, aC as UserPersona, aD as UserPersonaInput, aE as UserPersonaSchema, aF as ViewType, aG as ViewTypeSchema, aH as isEntityCall, aI as isEntityReference, aJ as isEntityReferenceAny, aK as isImportedTraitRef, aL as isOrbitalDefinition, aM as isPageReference, aN as isPageReferenceObject, aO as isPageReferenceString, aP as isThemeReference, aQ as parseEntityRef, aR as parseImportedTraitRef, aS as parseOrbitalSchema, aT as parsePageRef, aU as safeParseOrbitalSchema } from '../schema-BQCTssuv.js';
3
- import { aY as ServiceParams, bk as Trait, z as Entity, M as EntityRow, a5 as FieldValue, D as DeclaredTraitConfig, bn as TraitConfig } from '../trait-Cvs0OQbV.js';
4
- export { A as AgentEffect, a as AnimationDef, b as AnimationDefInput, c as AnimationDefSchema, d as ArrayEntityField, e as AssetMap, f as AssetMapInput, g as AssetMapSchema, h as AssetMapping, i as AssetMappingInput, j as AssetMappingSchema, k as AtomicEffect, C as CallServiceConfig, l as CallServiceEffect, m as CheckpointLoadEffect, n as CheckpointSaveEffect, o as ConfigFieldDeclaration, p as ConfigFieldDeclarationSchema, q as DeclaredTraitConfigSchema, r as DerefEffect, s as DespawnEffect, t as DoEffect, E as ENTITY_ROLES, u as Effect, v as EffectInput, w as EffectSchema, x as EmitConfig, y as EmitEffect, B as EntityData, F as EntityField, G as EntityFieldInput, H as EntityFieldSchema, I as EntityPersistence, J as EntityPersistenceSchema, K as EntityRole, L as EntityRoleSchema, N as EntitySchema, O as EnumEntityField, P as EvaluateConfig, Q as EvaluateEffect, R as Event, S as EventInput, T as EventPayloadField, U as EventPayloadFieldSchema, V as EventSchema, W as EventScope, X as EventScopeSchema, Y as FetchEffect, Z as FetchOptions, _ as FetchResult, $ as Field, a0 as FieldFormat, a1 as FieldFormatSchema, a2 as FieldSchema, a3 as FieldType, a4 as FieldTypeSchema, a6 as ForwardConfig, a7 as ForwardEffect, a8 as GAME_TYPES, a9 as GameType, aa as GameTypeSchema, ab as Guard, ac as GuardInput, ad as GuardSchema, ae as ListenSource, af as ListenSourceSchema, ag as LogEffect, ah as McpServiceDef, ai as McpServiceDefSchema, aj as NavigateEffect, ak as NnConfig, al as NnLayer, am as NotifyEffect, an as OrbitalEntity, ao as OrbitalEntityInput, ap as OrbitalEntitySchema, aq as OrbitalTraitRef, ar as OrbitalTraitRefSchema, as as OsEffect, at as PayloadField, au as PayloadFieldSchema, av as PersistData, aw as PersistEffect, ax as PersistEmitConfig, ay as PresentationType, az as RefEffect, aA as RelationConfig, aB as RelationConfigSchema, aC as RelationEntityField, aD as RenderItemLambda, aE as RenderUIConfig, aF as RenderUIEffect, aG as RenderUINode, aH as RequiredField, aI as RequiredFieldSchema, aJ as ResolvedAsset, aK as ResolvedAssetInput, aL as ResolvedAssetSchema, aM as ResolvedPatternProps, aN as RestAuthConfig, aO as RestAuthConfigSchema, aP as RestServiceDef, aQ as RestServiceDefSchema, aR as SERVICE_TYPES, aS as ScalarEntityField, aT as SemanticAssetRef, aU as SemanticAssetRefInput, aV as SemanticAssetRefSchema, aW as ServiceDefinition, aX as ServiceDefinitionSchema, aZ as ServiceParamsValue, a_ as ServiceRef, a$ as ServiceRefObject, b0 as ServiceRefObjectSchema, b1 as ServiceRefSchema, b2 as ServiceRefStringSchema, b3 as ServiceType, b4 as ServiceTypeSchema, b5 as SetEffect, b6 as SocketEvents, b7 as SocketEventsSchema, b8 as SocketServiceDef, b9 as SocketServiceDefSchema, ba as SpawnEffect, bb as State, bc as StateInput, bd as StateMachine, be as StateMachineInput, bf as StateMachineSchema, bg as StateSchema, bh as SwapEffect, bi as TrainConfig, bj as TrainEffect, bl as TraitCategory, bm as TraitCategorySchema, bo as TraitConfigObject, bp as TraitConfigSchema, bq as TraitConfigValue, br as TraitConfigValueSchema, bs as TraitDataEntity, bt as TraitDataEntitySchema, bu as TraitEntityField, bv as TraitEntityFieldSchema, bw as TraitEventContract, bx as TraitEventContractSchema, by as TraitEventListener, bz as TraitEventListenerSchema, bA as TraitInput, bB as TraitRef, bC as TraitRefSchema, bD as TraitReference, bE as TraitReferenceInput, bF as TraitReferenceSchema, bG as TraitSchema, bH as TraitTick, bI as TraitTickSchema, bJ as TraitUIBinding, bK as Transition, bL as TransitionInput, bM as TransitionSchema, bN as TypedEffect, bO as UISlot, bP as UISlotSchema, bQ as UI_SLOTS, bR as VISUAL_STYLES, bS as VisualStyle, bT as VisualStyleSchema, bU as WatchEffect, bV as WatchOptions, bW as atomic, bX as callService, bY as createAssetKey, bZ as deref, b_ as deriveCollection, b$ as despawn, c0 as doEffects, c1 as emit, c2 as findService, c3 as getDefaultAnimationsForRole, c4 as getServiceNames, c5 as getTraitConfig, c6 as getTraitName, c7 as hasService, c8 as isCircuitEvent, c9 as isEffect, ca as isInlineTrait, cb as isMcpService, cc as isRestService, cd as isRuntimeEntity, ce as isSExprEffect, cf as isServiceReference, cg as isServiceReferenceObject, ch as isSingletonEntity, ci as isSocketService, cj as navigate, ck as normalizeTraitRef, cl as notify, cm as parseAssetKey, cn as parseServiceRef, co as persist, cp as ref, cq as renderUI, cr as set, cs as spawn, ct as swap, cu as validateAssetAnimations, cv as watch } from '../trait-Cvs0OQbV.js';
1
+ import { a3 as OrbitalSchema, T as Orbital, aa as Page, u as DomainContext, ah as PageTraitRef } from '../schema-pKqQXuGN.js';
2
+ export { A as AGENT_DOMAIN_CATEGORIES, a as ALLOWED_CUSTOM_COMPONENTS, b as AgentDomainCategory, c as AgentDomainCategorySchema, d as AllowedCustomComponent, C as ComputedEventContract, e as ComputedEventContractSchema, f as ComputedEventListener, g as ComputedEventListenerSchema, h as CustomPatternDefinition, i as CustomPatternDefinitionInput, j as CustomPatternDefinitionSchema, k as CustomPatternMap, l as CustomPatternMapInput, m as CustomPatternMapSchema, D as DesignPreferences, n as DesignPreferencesInput, o as DesignPreferencesSchema, p as DesignTokens, q as DesignTokensInput, r as DesignTokensSchema, s as DomainCategory, t as DomainCategorySchema, v as DomainContextInput, w as DomainContextSchema, x as DomainVocabulary, y as DomainVocabularySchema, E as EntityCall, z as EntityCallSchema, B as EntityRef, F as EntityRefSchema, G as EntityRefStringSchema, H as EntitySemanticRole, I as EntitySemanticRoleSchema, J as EventListener, K as EventListenerSchema, L as EventSemanticRole, M as EventSemanticRoleSchema, N as EventSource, O as EventSourceSchema, P as GameSubCategory, Q as GameSubCategorySchema, R as NodeClassification, S as NodeClassificationSchema, U as OrbitalConfig, V as OrbitalConfigInput, W as OrbitalConfigSchema, X as OrbitalDefinition, Y as OrbitalDefinitionSchema, Z as OrbitalInput, _ as OrbitalPage, $ as OrbitalPageInput, a0 as OrbitalPageSchema, a1 as OrbitalPageStrictInput, a2 as OrbitalPageStrictSchema, a5 as OrbitalSchemaInput, a6 as OrbitalSchemaSchema, a7 as OrbitalSchemaWithTraits, a8 as OrbitalUnit, a9 as OrbitalUnitSchema, a4 as OrbitalZodSchema, ab as PageRef, ac as PageRefObject, ad as PageRefObjectSchema, ae as PageRefSchema, af as PageRefStringSchema, ag as PageSchema, ai as PageTraitRefSchema, aj as RelatedLink, ak as RelatedLinkSchema, al as StateSemanticRole, am as StateSemanticRoleSchema, an as SuggestedGuard, ao as SuggestedGuardSchema, ap as ThemeDefinition, aq as ThemeDefinitionSchema, ar as ThemeRef, as as ThemeRefSchema, at as ThemeRefStringSchema, au as ThemeTokens, av as ThemeTokensSchema, aw as ThemeVariant, ax as ThemeVariantSchema, ay as UXHints, az as UXHintsSchema, aA as UseDeclaration, aB as UseDeclarationSchema, aC as UserPersona, aD as UserPersonaInput, aE as UserPersonaSchema, X as ValidatedOrbital, aF as ViewType, aG as ViewTypeSchema, aH as isEntityCall, aI as isEntityReference, aJ as isEntityReferenceAny, aK as isImportedTraitRef, aL as isOrbitalDefinition, aM as isPageReference, aN as isPageReferenceObject, aO as isPageReferenceString, aP as isThemeReference, aQ as parseEntityRef, aR as parseImportedTraitRef, aS as parseOrbitalSchema, aT as parsePageRef, aU as safeParseOrbitalSchema } from '../schema-pKqQXuGN.js';
3
+ import { aY as ServiceParams, bk as Trait, z as Entity, M as EntityRow, a5 as FieldValue, D as DeclaredTraitConfig, bn as TraitConfig, F as EntityField, I as EntityPersistence, bl as TraitCategory, bH as TraitScope } from '../trait-BVLBQ9uk.js';
4
+ export { A as AgentEffect, a as AnimationDef, b as AnimationDefInput, c as AnimationDefSchema, d as ArrayEntityField, e as AssetMap, f as AssetMapInput, g as AssetMapSchema, h as AssetMapping, i as AssetMappingInput, j as AssetMappingSchema, k as AtomicEffect, C as CallServiceConfig, l as CallServiceEffect, m as CheckpointLoadEffect, n as CheckpointSaveEffect, o as ConfigFieldDeclaration, p as ConfigFieldDeclarationSchema, q as DeclaredTraitConfigSchema, r as DerefEffect, s as DespawnEffect, t as DoEffect, E as ENTITY_ROLES, u as Effect, v as EffectInput, w as EffectSchema, x as EmitConfig, y as EmitEffect, B as EntityData, G as EntityFieldInput, H as EntityFieldSchema, J as EntityPersistenceSchema, K as EntityRole, L as EntityRoleSchema, N as EntitySchema, O as EnumEntityField, P as EvaluateConfig, Q as EvaluateEffect, R as Event, S as EventInput, T as EventPayloadField, U as EventPayloadFieldSchema, V as EventSchema, W as EventScope, X as EventScopeSchema, Y as FetchEffect, Z as FetchOptions, _ as FetchResult, $ as Field, a0 as FieldFormat, a1 as FieldFormatSchema, a2 as FieldSchema, a3 as FieldType, a4 as FieldTypeSchema, a6 as ForwardConfig, a7 as ForwardEffect, a8 as GAME_TYPES, a9 as GameType, aa as GameTypeSchema, ab as Guard, ac as GuardInput, ad as GuardSchema, ae as ListenSource, af as ListenSourceSchema, ag as LogEffect, ah as McpServiceDef, ai as McpServiceDefSchema, aj as NavigateEffect, ak as NnConfig, al as NnLayer, am as NotifyEffect, an as OrbitalEntity, ao as OrbitalEntityInput, ap as OrbitalEntitySchema, aq as OrbitalTraitRef, ar as OrbitalTraitRefSchema, as as OsEffect, at as PayloadField, au as PayloadFieldSchema, av as PersistData, aw as PersistEffect, ax as PersistEmitConfig, ay as PresentationType, az as RefEffect, aA as RelationConfig, aB as RelationConfigSchema, aC as RelationEntityField, aD as RenderItemLambda, aE as RenderUIConfig, aF as RenderUIEffect, aG as RenderUINode, aH as RequiredField, aI as RequiredFieldSchema, aJ as ResolvedAsset, aK as ResolvedAssetInput, aL as ResolvedAssetSchema, aM as ResolvedPatternProps, aN as RestAuthConfig, aO as RestAuthConfigSchema, aP as RestServiceDef, aQ as RestServiceDefSchema, aR as SERVICE_TYPES, aS as ScalarEntityField, aT as SemanticAssetRef, aU as SemanticAssetRefInput, aV as SemanticAssetRefSchema, aW as ServiceDefinition, aX as ServiceDefinitionSchema, aZ as ServiceParamsValue, a_ as ServiceRef, a$ as ServiceRefObject, b0 as ServiceRefObjectSchema, b1 as ServiceRefSchema, b2 as ServiceRefStringSchema, b3 as ServiceType, b4 as ServiceTypeSchema, b5 as SetEffect, b6 as SocketEvents, b7 as SocketEventsSchema, b8 as SocketServiceDef, b9 as SocketServiceDefSchema, ba as SpawnEffect, bb as State, bc as StateInput, bd as StateMachine, be as StateMachineInput, bf as StateMachineSchema, bg as StateSchema, bh as SwapEffect, bi as TrainConfig, bj as TrainEffect, bm as TraitCategorySchema, bo as TraitConfigObject, bp as TraitConfigSchema, bq as TraitConfigValue, br as TraitConfigValueSchema, bs as TraitDataEntity, bt as TraitDataEntitySchema, bu as TraitEntityField, bv as TraitEntityFieldSchema, bw as TraitEventContract, bx as TraitEventContractSchema, by as TraitEventListener, bz as TraitEventListenerSchema, bA as TraitInput, bB as TraitRef, bC as TraitRefSchema, bD as TraitReference, bE as TraitReferenceInput, bF as TraitReferenceSchema, bG as TraitSchema, bI as TraitTick, bJ as TraitTickSchema, bK as TraitUIBinding, bL as Transition, bM as TransitionInput, bN as TransitionSchema, bO as TypedEffect, bP as UISlot, bQ as UISlotSchema, bR as UI_SLOTS, bS as VISUAL_STYLES, bT as VisualStyle, bU as VisualStyleSchema, bV as WatchEffect, bW as WatchOptions, bX as atomic, bY as callService, bZ as createAssetKey, b_ as deref, b$ as deriveCollection, c0 as despawn, c1 as doEffects, c2 as emit, c3 as findService, c4 as getDefaultAnimationsForRole, c5 as getServiceNames, c6 as getTraitConfig, c7 as getTraitName, c8 as hasService, c9 as isCircuitEvent, ca as isEffect, cb as isInlineTrait, cc as isMcpService, cd as isRestService, ce as isRuntimeEntity, cf as isSExprEffect, cg as isServiceReference, ch as isServiceReferenceObject, ci as isSingletonEntity, cj as isSocketService, ck as navigate, cl as normalizeTraitRef, cm as notify, cn as parseAssetKey, co as parseServiceRef, cp as persist, cq as ref, cr as renderUI, cs as set, ct as spawn, cu as swap, cv as validateAssetAnimations, cw as watch } from '../trait-BVLBQ9uk.js';
5
5
  import { c as EventPayloadValue, b as EventPayload, L as LogMeta, S as SExpr } from '../expression-BVRFm0sV.js';
6
6
  export { C as CORE_BINDINGS, a as CoreBinding, E as EvalContext, d as Expression, e as ExpressionInput, f as ExpressionSchema, P as ParsedBinding, g as SExprAtom, h as SExprAtomSchema, i as SExprInput, j as SExprSchema, k as collectBindings, l as getArgs, m as getOperator, n as isBinding, o as isSExpr, p as isSExprAtom, q as isSExprCall, r as isValidBinding, s as parseBinding, t as sexpr, w as walkSExpr } from '../expression-BVRFm0sV.js';
7
7
  import { z } from 'zod';
8
8
  import { AnyPatternConfig } from '@almadar/patterns';
9
9
  export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
10
+ export { J as JsonObject, a as JsonValue, T as ToolArgs, i as isJsonArray, b as isJsonObject, c as isJsonPrimitive } from '../json-lCu3FWzv.js';
10
11
 
11
12
  /**
12
13
  * S-Expression Bindings
@@ -1515,4 +1516,424 @@ interface OrbitalVerificationAPI {
1515
1516
  clearEventLog?: () => void;
1516
1517
  }
1517
1518
 
1518
- export { type AgentCodeSearchResult, type AgentCompactResult, type AgentCompactStrategy, type AgentContext, type AgentGenerateOptions, type AgentMemoryCategory, type AgentMemoryRecord, OrbitalSchema as AppSchema, type AppSummary, type AssetLoadStatus, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, type BindingContext, type BindingRoot, BindingSchema, type BridgeHealth, type BusEvent, type BusEventListener, type BusEventSource, type CategorizedRemovals, type ChangeAuthor, type ChangeSetDocument, type ChangeSummary, type ChangesetValue, type CheckStatus, type ContextExtensions, type CreateFlow, DEFAULT_INTERACTION_MODELS, DeclaredTraitConfig, type DeleteFlow, DomainContext, type EditFlow, type EffectTrace, Entity, EntityRow, type EventEmit, type EventKey, type EventListen, type EventLogEntry, EventPayload, EventPayloadValue, FieldValue, Orbital as FullOrbitalUnit, type GitHubLink, type HistoryMeta, type InteractionModel, type InteractionModelInput, InteractionModelSchema, type LazyService, type ListInteraction, LogMeta, Orbital, OrbitalSchema, type OrbitalVerificationAPI, Page, type PageContentReduction, PatternTypeSchema, type PersistActionName, type ResolvedEntity, type ResolvedEntityBinding, type ResolvedField, type ResolvedIR, type ResolvedNavigation, type ResolvedPage, type ResolvedPattern, type ResolvedSection, type ResolvedSectionEvent, type ResolvedTrait, type ResolvedTraitBinding, type ResolvedTraitDataEntity, type ResolvedTraitEvent, type ResolvedTraitGuard, type ResolvedTraitListener, type ResolvedTraitState, type ResolvedTraitTick, type ResolvedTraitTransition, type ResolvedTraitUIBinding, SExpr, type SaveOptions, type SaveResult, type SchemaChange, type SemanticChangeKind, type SemanticSchemaChange, type ServerResponseTrace, type ServiceAction, type ServiceActionName, type ServiceContract, type ServiceEvents, ServiceParams, type SnapshotDocument, type StatsView, type StoreContract, type StoreFilter, type StoreFilterOp, Trait, TraitConfig, type TraitFieldRef, TraitFieldRefSchema, type TraitStateSnapshot, type TransitionFrom, type TransitionTrace, type Unsubscribe, type ValidationDocument, type ValidationIssue, type ValidationMeta, type ValidationResults, type VerificationCheck, type VerificationSnapshot, type VerificationSummary, type ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isResolvedIR, isTraitFieldRef, toBindingRoot, validateBindingInContext };
1519
+ /**
1520
+ * Validation error types — the shape emitted by every
1521
+ * `.orb` / `.lolo` validator pass.
1522
+ *
1523
+ * `ValidationError` is the wire shape: `{ code, path, message, suggestion? }`.
1524
+ * `code` is `ValidationErrorCode`, which is an OPEN `string` to let the
1525
+ * Rust validator emit new codes without an `@almadar/core` rev. The
1526
+ * `KNOWN_VALIDATION_ERROR_CODES` const documents the codes currently
1527
+ * emitted by the validator + lolo lower pipeline (extracted from
1528
+ * `orbital-rust/crates/orbital-compiler/src/phases/validation/` +
1529
+ * `orbital-rust/crates/orbital-lolo/src/`).
1530
+ *
1531
+ * Consumers that want to narrow a code to the closed known set use
1532
+ * `KnownValidationErrorCode`:
1533
+ *
1534
+ * ```ts
1535
+ * if (err.code in KNOWN_VALIDATION_ERROR_CODES) {
1536
+ * // err.code is now narrowable to KnownValidationErrorCode for
1537
+ * // exhaustive switch handling.
1538
+ * }
1539
+ * ```
1540
+ *
1541
+ * @packageDocumentation
1542
+ */
1543
+ /**
1544
+ * One validation diagnostic emitted by the validator / lolo lower pipeline.
1545
+ *
1546
+ * - `code`: machine-readable identifier (see `KNOWN_VALIDATION_ERROR_CODES`).
1547
+ * - `path`: JSON pointer-like path into the failing schema location,
1548
+ * e.g. `'orbitals[0].traits[2].stateMachine.transitions[1].effects[0]'`.
1549
+ * - `message`: human-readable description of the failure.
1550
+ * - `suggestion`: optional hint the validator may add to help the
1551
+ * author / LLM fix the issue.
1552
+ */
1553
+ interface ValidationError {
1554
+ code: ValidationErrorCode;
1555
+ path: string;
1556
+ message: string;
1557
+ suggestion?: string;
1558
+ }
1559
+ /**
1560
+ * Validation error code — open `string` for forward-compat with the
1561
+ * Rust validator's evolving code set. Narrow to the closed known set
1562
+ * via `KnownValidationErrorCode` when exhaustive handling is needed.
1563
+ */
1564
+ type ValidationErrorCode = string;
1565
+ /**
1566
+ * Closed set of validation codes the Rust validator + lolo lower
1567
+ * pipeline currently emit. Source-tagged: codes are extracted from
1568
+ * `orbital-rust/crates/orbital-compiler/src/phases/validation/**.rs`
1569
+ * and `orbital-rust/crates/orbital-lolo/src/**.rs`. Keep this in sync
1570
+ * with the Rust side; mismatches are caught by the Rust validator's
1571
+ * own unit tests, which assert the emitted code-set matches an
1572
+ * exported manifest.
1573
+ *
1574
+ * Categories (prefix → meaning):
1575
+ * - `ORB_BINDING_*` — binding (`@entity.X`, `@payload.Y`, ...) issues
1576
+ * - `ORB_E_*` / `ORB_EFF_*` / `ORB_EMIT_*` — entity / effect / emit
1577
+ * - `ORB_GEN_*` — generic / cross-cutting structure
1578
+ * - `ORB_O_*` / `ORB_P_*` / `ORB_S_*` / `ORB_SM_*` / `ORB_T_*` —
1579
+ * orbital / page / schema / state-machine / trait
1580
+ * - `ORB_QUERY_*` — query / search behaviors
1581
+ * - `ORB_RUI_*` — render-UI binding + prop validation
1582
+ * - `ORB_SLOT_*` — UI-slot conflict / contention
1583
+ * - `ORB_SVC_*` / `ORB_UI_*` — service / UI primitives
1584
+ * - `ORB_X_*` — cross-orbital constraints (listens, emits, IDs)
1585
+ */
1586
+ declare const KNOWN_VALIDATION_ERROR_CODES: {
1587
+ readonly ORB_BINDING_ENTITY_FIELD_NEVER_SET: "ORB_BINDING_ENTITY_FIELD_NEVER_SET";
1588
+ readonly ORB_BINDING_ENTITY_FIELD_NOT_FOUND: "ORB_BINDING_ENTITY_FIELD_NOT_FOUND";
1589
+ readonly ORB_BINDING_INVALID_FIELD_NAME: "ORB_BINDING_INVALID_FIELD_NAME";
1590
+ readonly ORB_BINDING_INVALID_FORMAT: "ORB_BINDING_INVALID_FORMAT";
1591
+ readonly ORB_BINDING_INVALID_PATH: "ORB_BINDING_INVALID_PATH";
1592
+ readonly ORB_BINDING_NOW_NO_PATH: "ORB_BINDING_NOW_NO_PATH";
1593
+ readonly ORB_BINDING_PAYLOAD_FIELD_UNDECLARED: "ORB_BINDING_PAYLOAD_FIELD_UNDECLARED";
1594
+ readonly ORB_BINDING_PAYLOAD_IN_TICK: "ORB_BINDING_PAYLOAD_IN_TICK";
1595
+ readonly ORB_BINDING_PAYLOAD_TYPE_INCOMPATIBLE: "ORB_BINDING_PAYLOAD_TYPE_INCOMPATIBLE";
1596
+ readonly ORB_BINDING_SET_TARGET_MISSING_PATH: "ORB_BINDING_SET_TARGET_MISSING_PATH";
1597
+ readonly ORB_BINDING_STATE_NO_PATH: "ORB_BINDING_STATE_NO_PATH";
1598
+ readonly ORB_BINDING_TRAIT_CYCLE: "ORB_BINDING_TRAIT_CYCLE";
1599
+ readonly ORB_BINDING_TRAIT_INVALID_FORMAT: "ORB_BINDING_TRAIT_INVALID_FORMAT";
1600
+ readonly ORB_BINDING_TRAIT_INVALID_POSITION: "ORB_BINDING_TRAIT_INVALID_POSITION";
1601
+ readonly ORB_BINDING_TRAIT_MISSING_NAME: "ORB_BINDING_TRAIT_MISSING_NAME";
1602
+ readonly ORB_BINDING_TRAIT_SELF_REFERENCE: "ORB_BINDING_TRAIT_SELF_REFERENCE";
1603
+ readonly ORB_BINDING_TRAIT_UNKNOWN: "ORB_BINDING_TRAIT_UNKNOWN";
1604
+ readonly ORB_BINDING_UNKNOWN_ENTITY: "ORB_BINDING_UNKNOWN_ENTITY";
1605
+ readonly ORB_BINDING_UNKNOWN_ROOT: "ORB_BINDING_UNKNOWN_ROOT";
1606
+ readonly ORB_E_DUPLICATE_FIELD: "ORB_E_DUPLICATE_FIELD";
1607
+ readonly ORB_E_EMPTY_ENUM_VALUES: "ORB_E_EMPTY_ENUM_VALUES";
1608
+ readonly ORB_E_INVALID_FIELD_NAME: "ORB_E_INVALID_FIELD_NAME";
1609
+ readonly ORB_E_INVALID_FIELD_TYPE: "ORB_E_INVALID_FIELD_TYPE";
1610
+ readonly ORB_E_INVALID_RELATION: "ORB_E_INVALID_RELATION";
1611
+ readonly ORB_E_LITERAL_UNION_DEFAULT_MISMATCH: "ORB_E_LITERAL_UNION_DEFAULT_MISMATCH";
1612
+ readonly ORB_E_MISSING_COLLECTION: "ORB_E_MISSING_COLLECTION";
1613
+ readonly ORB_E_MISSING_NAME: "ORB_E_MISSING_NAME";
1614
+ readonly ORB_E_NO_FIELDS: "ORB_E_NO_FIELDS";
1615
+ readonly ORB_EFF_CALL_SERVICE_MISSING_ACTION: "ORB_EFF_CALL_SERVICE_MISSING_ACTION";
1616
+ readonly ORB_EFF_CALL_SERVICE_MISSING_HANDLERS: "ORB_EFF_CALL_SERVICE_MISSING_HANDLERS";
1617
+ readonly ORB_EFF_CALL_SERVICE_MISSING_SERVICE: "ORB_EFF_CALL_SERVICE_MISSING_SERVICE";
1618
+ readonly ORB_EFF_EMIT_INVALID_NAME: "ORB_EFF_EMIT_INVALID_NAME";
1619
+ readonly ORB_EFF_EMIT_KEY_INVALID: "ORB_EFF_EMIT_KEY_INVALID";
1620
+ readonly ORB_EFF_EMIT_UNDECLARED_EVENT: "ORB_EFF_EMIT_UNDECLARED_EVENT";
1621
+ readonly ORB_EFF_FETCH_INVALID_ENTITY: "ORB_EFF_FETCH_INVALID_ENTITY";
1622
+ readonly ORB_EFF_FETCH_INVALID_INCLUDE: "ORB_EFF_FETCH_INVALID_INCLUDE";
1623
+ readonly ORB_EFF_MISSING_FETCH_FOR_ENTITY: "ORB_EFF_MISSING_FETCH_FOR_ENTITY";
1624
+ readonly ORB_EFF_MISSING_REQUIRED_EMIT: "ORB_EFF_MISSING_REQUIRED_EMIT";
1625
+ readonly ORB_EFF_NAVIGATE_MISSING_PAYLOAD: "ORB_EFF_NAVIGATE_MISSING_PAYLOAD";
1626
+ readonly ORB_EFF_NAVIGATE_TARGET_UNREACHABLE: "ORB_EFF_NAVIGATE_TARGET_UNREACHABLE";
1627
+ readonly ORB_EFF_SET_INVALID_BINDING: "ORB_EFF_SET_INVALID_BINDING";
1628
+ readonly ORB_EFF_SET_PAYLOAD_NOT_ALLOWED: "ORB_EFF_SET_PAYLOAD_NOT_ALLOWED";
1629
+ readonly ORB_EFF_SLOT_CONFLICT: "ORB_EFF_SLOT_CONFLICT";
1630
+ readonly ORB_EFF_UNKNOWN_TYPE: "ORB_EFF_UNKNOWN_TYPE";
1631
+ readonly ORB_EMIT_DECLARED_BUT_UNFIRED: "ORB_EMIT_DECLARED_BUT_UNFIRED";
1632
+ readonly ORB_EMIT_PAYLOAD_EXTRA_FIELD: "ORB_EMIT_PAYLOAD_EXTRA_FIELD";
1633
+ readonly ORB_EMIT_PAYLOAD_FIELD_TYPE_MISMATCH: "ORB_EMIT_PAYLOAD_FIELD_TYPE_MISMATCH";
1634
+ readonly ORB_EMIT_PAYLOAD_MISSING_REQUIRED: "ORB_EMIT_PAYLOAD_MISSING_REQUIRED";
1635
+ readonly ORB_EMIT_SUCCESS_PAYLOAD_RETURN_MISMATCH: "ORB_EMIT_SUCCESS_PAYLOAD_RETURN_MISMATCH";
1636
+ readonly ORB_GEN_DUPLICATE: "ORB_GEN_DUPLICATE";
1637
+ readonly ORB_GEN_INVALID_REFERENCE: "ORB_GEN_INVALID_REFERENCE";
1638
+ readonly ORB_GEN_INVALID_VALUE: "ORB_GEN_INVALID_VALUE";
1639
+ readonly ORB_GEN_MISSING_FIELD: "ORB_GEN_MISSING_FIELD";
1640
+ readonly ORB_O_MISSING_PAGES: "ORB_O_MISSING_PAGES";
1641
+ readonly ORB_P_DUPLICATE_PATH: "ORB_P_DUPLICATE_PATH";
1642
+ readonly ORB_P_EMPTY_TRAITS: "ORB_P_EMPTY_TRAITS";
1643
+ readonly ORB_P_INVALID_PATH: "ORB_P_INVALID_PATH";
1644
+ readonly ORB_P_INVALID_TRAIT_REF: "ORB_P_INVALID_TRAIT_REF";
1645
+ readonly ORB_P_INVALID_VIEW_TYPE: "ORB_P_INVALID_VIEW_TYPE";
1646
+ readonly ORB_P_MISSING_NAME: "ORB_P_MISSING_NAME";
1647
+ readonly ORB_P_MISSING_PATH: "ORB_P_MISSING_PATH";
1648
+ readonly ORB_P_MISSING_TRAITS: "ORB_P_MISSING_TRAITS";
1649
+ readonly ORB_P_SECTIONS_FORBIDDEN: "ORB_P_SECTIONS_FORBIDDEN";
1650
+ readonly ORB_QUERY_MISSING_RECOMMENDED: "ORB_QUERY_MISSING_RECOMMENDED";
1651
+ readonly ORB_QUERY_MISSING_SEARCH: "ORB_QUERY_MISSING_SEARCH";
1652
+ readonly ORB_QUERY_UNKNOWN_SINGLETON: "ORB_QUERY_UNKNOWN_SINGLETON";
1653
+ readonly ORB_QUERY_UNSUPPORTED_PATTERN: "ORB_QUERY_UNSUPPORTED_PATTERN";
1654
+ readonly ORB_QUERY_UNUSED_SINGLETON: "ORB_QUERY_UNUSED_SINGLETON";
1655
+ readonly ORB_RUI_BINDING_TYPE_MISMATCH: "ORB_RUI_BINDING_TYPE_MISMATCH";
1656
+ readonly ORB_RUI_ELEMENT_SHAPE_MISMATCH: "ORB_RUI_ELEMENT_SHAPE_MISMATCH";
1657
+ readonly ORB_RUI_EVENT_BINDING_PAYLOAD_MISMATCH: "ORB_RUI_EVENT_BINDING_PAYLOAD_MISMATCH";
1658
+ readonly ORB_RUI_INVALID_FIELD_PATH: "ORB_RUI_INVALID_FIELD_PATH";
1659
+ readonly ORB_RUI_INVALID_ITEM_ACTION: "ORB_RUI_INVALID_ITEM_ACTION";
1660
+ readonly ORB_RUI_INVALID_PATTERN: "ORB_RUI_INVALID_PATTERN";
1661
+ readonly ORB_RUI_INVALID_PROP: "ORB_RUI_INVALID_PROP";
1662
+ readonly ORB_RUI_INVALID_SLOT: "ORB_RUI_INVALID_SLOT";
1663
+ readonly ORB_RUI_MISSING_ACTION: "ORB_RUI_MISSING_ACTION";
1664
+ readonly ORB_RUI_MISSING_PATTERN_TYPE: "ORB_RUI_MISSING_PATTERN_TYPE";
1665
+ readonly ORB_RUI_MISSING_REQUIRED_PROP: "ORB_RUI_MISSING_REQUIRED_PROP";
1666
+ readonly ORB_RUI_PROP_TYPE_MISMATCH: "ORB_RUI_PROP_TYPE_MISMATCH";
1667
+ readonly ORB_RUI_UNKNOWN_ITEM_ACTION_PROP: "ORB_RUI_UNKNOWN_ITEM_ACTION_PROP";
1668
+ readonly ORB_S_EMPTY_VERSION: "ORB_S_EMPTY_VERSION";
1669
+ readonly ORB_S_MISSING_NAME: "ORB_S_MISSING_NAME";
1670
+ readonly ORB_S_NO_ORBITALS: "ORB_S_NO_ORBITALS";
1671
+ readonly ORB_SLOT_CONTENTION: "ORB_SLOT_CONTENTION";
1672
+ readonly ORB_SLOT_CONTENTION_RUNTIME: "ORB_SLOT_CONTENTION_RUNTIME";
1673
+ readonly ORB_SLOT_HUD_NON_GAME: "ORB_SLOT_HUD_NON_GAME";
1674
+ readonly ORB_SLOT_INVALID_NAME: "ORB_SLOT_INVALID_NAME";
1675
+ readonly ORB_SLOT_INVALID_NESTING: "ORB_SLOT_INVALID_NESTING";
1676
+ readonly ORB_SLOT_MAIN_NOT_COVERED: "ORB_SLOT_MAIN_NOT_COVERED";
1677
+ readonly ORB_SLOT_PRIORITY_CONFLICT: "ORB_SLOT_PRIORITY_CONFLICT";
1678
+ readonly ORB_SVC_DUPLICATE_NAME: "ORB_SVC_DUPLICATE_NAME";
1679
+ readonly ORB_SVC_INVALID_INTEGRATOR: "ORB_SVC_INVALID_INTEGRATOR";
1680
+ readonly ORB_SVC_INVALID_URL: "ORB_SVC_INVALID_URL";
1681
+ readonly ORB_SVC_MISSING_BASE_URL: "ORB_SVC_MISSING_BASE_URL";
1682
+ readonly ORB_SVC_MISSING_CAPABILITIES: "ORB_SVC_MISSING_CAPABILITIES";
1683
+ readonly ORB_SVC_MISSING_EVENTS: "ORB_SVC_MISSING_EVENTS";
1684
+ readonly ORB_SVC_MISSING_SERVER_PATH: "ORB_SVC_MISSING_SERVER_PATH";
1685
+ readonly ORB_SVC_RESERVED_EVENT: "ORB_SVC_RESERVED_EVENT";
1686
+ readonly ORB_SVC_UNKNOWN_TYPE: "ORB_SVC_UNKNOWN_TYPE";
1687
+ readonly ORB_T_CONFIG_OBJECT_ARRAY_FORBIDDEN: "ORB_T_CONFIG_OBJECT_ARRAY_FORBIDDEN";
1688
+ readonly ORB_T_CONFIG_SHAPE_MISMATCH: "ORB_T_CONFIG_SHAPE_MISMATCH";
1689
+ readonly ORB_T_CONFIG_TIER_INVALID: "ORB_T_CONFIG_TIER_INVALID";
1690
+ readonly ORB_T_DEPRECATED_UI: "ORB_T_DEPRECATED_UI";
1691
+ readonly ORB_T_DUPLICATE_NAME: "ORB_T_DUPLICATE_NAME";
1692
+ readonly ORB_T_DUPLICATE_STATE: "ORB_T_DUPLICATE_STATE";
1693
+ readonly ORB_T_DUPLICATE_TRANSITION: "ORB_T_DUPLICATE_TRANSITION";
1694
+ readonly ORB_T_ENTITY_NAME_SHADOWS_TRAIT_UNION: "ORB_T_ENTITY_NAME_SHADOWS_TRAIT_UNION";
1695
+ readonly ORB_T_EVENT_TYPE_WRONG_KIND: "ORB_T_EVENT_TYPE_WRONG_KIND";
1696
+ readonly ORB_T_EVT_DUPLICATE: "ORB_T_EVT_DUPLICATE";
1697
+ readonly ORB_T_EVT_EXTERNAL_MISSING_PAYLOAD: "ORB_T_EVT_EXTERNAL_MISSING_PAYLOAD";
1698
+ readonly ORB_T_EVT_INVALID_NAME: "ORB_T_EVT_INVALID_NAME";
1699
+ readonly ORB_T_EVT_SCOPE_MISMATCH: "ORB_T_EVT_SCOPE_MISMATCH";
1700
+ readonly ORB_T_EVT_TICK_UNDECLARED: "ORB_T_EVT_TICK_UNDECLARED";
1701
+ readonly ORB_T_EVT_UNDECLARED: "ORB_T_EVT_UNDECLARED";
1702
+ readonly ORB_T_INIT_MISSING_FETCH: "ORB_T_INIT_MISSING_FETCH";
1703
+ readonly ORB_T_INVALID_CATEGORY: "ORB_T_INVALID_CATEGORY";
1704
+ readonly ORB_T_INVALID_FORMAT: "ORB_T_INVALID_FORMAT";
1705
+ readonly ORB_T_INVALID_PATTERN_DEFAULT: "ORB_T_INVALID_PATTERN_DEFAULT";
1706
+ readonly ORB_T_INVALID_SLOT_DEFAULT: "ORB_T_INVALID_SLOT_DEFAULT";
1707
+ readonly ORB_T_INVALID_TRANSITION: "ORB_T_INVALID_TRANSITION";
1708
+ readonly ORB_T_MISSING_INIT_TRANSITION: "ORB_T_MISSING_INIT_TRANSITION";
1709
+ readonly ORB_T_MISSING_RENDER_UI: "ORB_T_MISSING_RENDER_UI";
1710
+ readonly ORB_T_MULTIPLE_INITIAL_STATES: "ORB_T_MULTIPLE_INITIAL_STATES";
1711
+ readonly ORB_T_NO_INITIAL_STATE: "ORB_T_NO_INITIAL_STATE";
1712
+ readonly ORB_T_TYPE_ANNOTATION_MISMATCH: "ORB_T_TYPE_ANNOTATION_MISMATCH";
1713
+ readonly ORB_T_TYPE_COMPOSITION_CONFLICT: "ORB_T_TYPE_COMPOSITION_CONFLICT";
1714
+ readonly ORB_T_TYPE_CYCLE: "ORB_T_TYPE_CYCLE";
1715
+ readonly ORB_T_TYPE_KIND_MISMATCH: "ORB_T_TYPE_KIND_MISMATCH";
1716
+ readonly ORB_T_TYPE_UNKNOWN: "ORB_T_TYPE_UNKNOWN";
1717
+ readonly ORB_T_TYPE_UNKNOWN_PARAM: "ORB_T_TYPE_UNKNOWN_PARAM";
1718
+ readonly ORB_T_TYPE_WRONG_ARG_COUNT: "ORB_T_TYPE_WRONG_ARG_COUNT";
1719
+ readonly ORB_T_UNDEFINED_EVENT: "ORB_T_UNDEFINED_EVENT";
1720
+ readonly ORB_T_UNDEFINED_TRAIT: "ORB_T_UNDEFINED_TRAIT";
1721
+ readonly ORB_UI_ICON_EMPTY: "ORB_UI_ICON_EMPTY";
1722
+ readonly ORB_UI_ICON_INVALID_FORMAT: "ORB_UI_ICON_INVALID_FORMAT";
1723
+ readonly ORB_UI_ICON_NOT_FOUND: "ORB_UI_ICON_NOT_FOUND";
1724
+ readonly ORB_X_CIRCULAR_DEPENDENCY: "ORB_X_CIRCULAR_DEPENDENCY";
1725
+ readonly ORB_X_CROSS_EMITTER_DECLARED_PAYLOAD_MISMATCH: "ORB_X_CROSS_EMITTER_DECLARED_PAYLOAD_MISMATCH";
1726
+ readonly ORB_X_DUPLICATE_ENTITY: "ORB_X_DUPLICATE_ENTITY";
1727
+ readonly ORB_X_EVENT_COLLISION: "ORB_X_EVENT_COLLISION";
1728
+ readonly ORB_X_INTERNAL_EVENT_EXPOSED: "ORB_X_INTERNAL_EVENT_EXPOSED";
1729
+ readonly ORB_X_LISTEN_SOURCE_UNRESOLVED: "ORB_X_LISTEN_SOURCE_UNRESOLVED";
1730
+ readonly ORB_X_MISSING_ORBITAL_NAME: "ORB_X_MISSING_ORBITAL_NAME";
1731
+ readonly ORB_X_ORPHAN_LISTENER: "ORB_X_ORPHAN_LISTENER";
1732
+ readonly ORB_X_PAYLOAD_MISMATCH: "ORB_X_PAYLOAD_MISMATCH";
1733
+ readonly ORB_X_RENDER_UI_EVENT_LITERAL_STALE: "ORB_X_RENDER_UI_EVENT_LITERAL_STALE";
1734
+ readonly ORB_X_UNRESOLVED_PATTERN_FIELD_REF: "ORB_X_UNRESOLVED_PATTERN_FIELD_REF";
1735
+ readonly ORB_X_UNUSED_EMISSION: "ORB_X_UNUSED_EMISSION";
1736
+ };
1737
+ /**
1738
+ * Narrow union of the codes documented in `KNOWN_VALIDATION_ERROR_CODES`.
1739
+ * Use this in exhaustive `switch` handlers; use the broader
1740
+ * `ValidationErrorCode` (open `string`) anywhere a fresh validator-side
1741
+ * code could plausibly arrive.
1742
+ */
1743
+ type KnownValidationErrorCode = typeof KNOWN_VALIDATION_ERROR_CODES[keyof typeof KNOWN_VALIDATION_ERROR_CODES];
1744
+ /**
1745
+ * Type guard: is the given code a known one? After the guard returns
1746
+ * true, the code can be narrowed to `KnownValidationErrorCode` via a
1747
+ * separate cast, because the type system can't track `in` against
1748
+ * `as const` records without an explicit narrowing helper.
1749
+ */
1750
+ declare function isKnownValidationErrorCode(code: ValidationErrorCode): boolean;
1751
+
1752
+ /**
1753
+ * Parsed AST — LLM-emit relaxed views of the canonical orbital types.
1754
+ *
1755
+ * Every `Parsed*` type mirrors its canonical counterpart in this module
1756
+ * (`Trait`, `StateMachine`, `Transition`, `State`, `Event`, `OrbitalDefinition`,
1757
+ * `PageRefObject`, etc.) but loosens required fields to optional. The
1758
+ * loosening exists for one reason: the LLM can emit a partial orbital
1759
+ * (mid-stream, mid-tool-call, mid-LoLo lowering) and consumer code
1760
+ * needs to walk it WITHOUT casting to the strict canonical type before
1761
+ * every field access.
1762
+ *
1763
+ * Discipline:
1764
+ *
1765
+ * - **No `unknown`.** Every field has a concrete type, sourced from
1766
+ * this same module where the type already exists (`EntityField`,
1767
+ * `EntityPersistence`, `TraitCategory`, `TraitScope`, `SExpr`,
1768
+ * `PageTraitRef`, `TraitEventContract`, `TraitEventListener`).
1769
+ *
1770
+ * - **No index signatures.** If the LLM emits a key the schema doesn't
1771
+ * know about, the validator rejects it. The `Parsed*` types do not
1772
+ * pretend to accept unknown keys at the type level.
1773
+ *
1774
+ * - **Required fields stay required.** `name` on `ParsedOrbital` is
1775
+ * required because no orbital can exist without one. `name` /
1776
+ * `linkedEntity` on `ParsedTrait` are required because the orbital
1777
+ * compiler rejects traits missing either. Only fields the LLM
1778
+ * legitimately omits during construction are optional.
1779
+ *
1780
+ * Use site: walkers that observe an orbital before it's fully
1781
+ * validated. Construct it as `ParsedOrbital`, narrow to
1782
+ * `OrbitalDefinition` after validation.
1783
+ *
1784
+ * @packageDocumentation
1785
+ */
1786
+
1787
+ /**
1788
+ * Top-level orbital as the LLM emits it. Relaxed view of
1789
+ * `OrbitalDefinition`: traits and pages may be partial, the domain
1790
+ * context + design hints may be missing.
1791
+ */
1792
+ interface ParsedOrbital {
1793
+ name: string;
1794
+ entity: ParsedEntity;
1795
+ traits: ParsedTrait[];
1796
+ pages: ParsedPage[];
1797
+ domainContext?: ParsedDomainContext;
1798
+ design?: ParsedDesign;
1799
+ }
1800
+ /**
1801
+ * Entity nucleus of an orbital. `name` + `fields` are required; the
1802
+ * factory canonical defaults can fill `persistence` and `collection`
1803
+ * when omitted.
1804
+ */
1805
+ interface ParsedEntity {
1806
+ name: string;
1807
+ fields: EntityField[];
1808
+ persistence?: EntityPersistence;
1809
+ collection?: string;
1810
+ }
1811
+ /**
1812
+ * One trait on an orbital. `name` + `linkedEntity` are required (the
1813
+ * compiler rejects either omission); state machine + scope + category
1814
+ * are filled by defaults when the LLM doesn't specify them.
1815
+ */
1816
+ interface ParsedTrait {
1817
+ name: string;
1818
+ linkedEntity: string;
1819
+ category?: TraitCategory;
1820
+ scope?: TraitScope;
1821
+ description?: string;
1822
+ config?: ParsedTraitConfig;
1823
+ emits?: ParsedEmitDeclaration[];
1824
+ listens?: ParsedListenDeclaration[];
1825
+ stateMachine?: ParsedStateMachine;
1826
+ capabilities?: string[];
1827
+ }
1828
+ /**
1829
+ * Trait `config { }` block — the LLM-emit shape carries each declared
1830
+ * config key as a typed value drawn from the JSON primitive set. A
1831
+ * stricter view (`DeclaredTraitConfig` in `trait.ts`) captures the
1832
+ * authored field descriptors with type+default+label+tier metadata;
1833
+ * `ParsedTraitConfig` is the in-flight value map.
1834
+ */
1835
+ type ParsedTraitConfig = {
1836
+ [key: string]: string | number | boolean | null | ReadonlyArray<string | number | boolean | null>;
1837
+ };
1838
+ /**
1839
+ * State-machine of a trait. Every field optional because the LLM may
1840
+ * emit the trait header before its body. A canonical
1841
+ * `StateMachine` (`state-machine.ts`) requires at least one state +
1842
+ * one transition.
1843
+ */
1844
+ interface ParsedStateMachine {
1845
+ states?: ParsedState[];
1846
+ events?: ParsedEvent[];
1847
+ transitions?: ParsedTransition[];
1848
+ initial?: string;
1849
+ }
1850
+ /**
1851
+ * One state of a `ParsedStateMachine`. Mirrors `State` from
1852
+ * `state-machine.ts` with name optional during construction.
1853
+ */
1854
+ interface ParsedState {
1855
+ name?: string;
1856
+ isInitial?: boolean;
1857
+ }
1858
+ /**
1859
+ * One event of a `ParsedStateMachine`. Mirrors `Event` from
1860
+ * `state-machine.ts`. `payloadSchema` is the canonical shape — an
1861
+ * array of `EntityField`s describing the event's payload.
1862
+ */
1863
+ interface ParsedEvent {
1864
+ key?: string;
1865
+ name?: string;
1866
+ payloadSchema?: EntityField[];
1867
+ }
1868
+ /**
1869
+ * One transition of a `ParsedStateMachine`. `effects` + `guard` use
1870
+ * `SExpr` from `expression.ts` — the canonical S-expression shape the
1871
+ * runtime evaluates.
1872
+ */
1873
+ interface ParsedTransition {
1874
+ from?: string;
1875
+ to?: string;
1876
+ event?: string;
1877
+ effects?: SExpr[];
1878
+ guard?: SExpr;
1879
+ }
1880
+ /**
1881
+ * Trait-emit declaration. Aliases `TraitEventContract` from
1882
+ * `trait.ts` with every field optional. The canonical contract
1883
+ * carries `event`, `scope`, `payload`; here all three are optional so
1884
+ * an in-flight emit (just the name, no payload yet) types correctly.
1885
+ */
1886
+ interface ParsedEmitDeclaration {
1887
+ event?: string;
1888
+ scope?: 'internal' | 'external';
1889
+ payload?: EntityField[];
1890
+ }
1891
+ /**
1892
+ * Trait-listen declaration. Mirrors `TraitEventListener` from
1893
+ * `trait.ts` with the source remap and trigger key optional.
1894
+ */
1895
+ interface ParsedListenDeclaration {
1896
+ event?: string;
1897
+ triggers?: string;
1898
+ scope?: 'internal' | 'external';
1899
+ payloadMapping?: {
1900
+ [key: string]: string;
1901
+ };
1902
+ }
1903
+ /**
1904
+ * One page entry on an orbital. Mirrors `PageRefObject` /
1905
+ * `OrbitalPage`; `path` is the URL, `name` is the canonical
1906
+ * identifier the molecule references.
1907
+ */
1908
+ interface ParsedPage {
1909
+ path?: string;
1910
+ name?: string;
1911
+ primaryEntity?: string;
1912
+ traits?: PageTraitRef[];
1913
+ }
1914
+ /**
1915
+ * Domain-context decorations the analyzer attaches to an orbital
1916
+ * (vocabulary, category, original request). Mirrors `DomainContext`
1917
+ * from `domain.ts` for the fields used in the parsed-AST surface; the
1918
+ * full `DomainContext` carries semantic-role overlays + custom-pattern
1919
+ * maps too, which the LLM doesn't emit in this surface.
1920
+ */
1921
+ interface ParsedDomainContext {
1922
+ request?: string;
1923
+ category?: string;
1924
+ vocabulary?: {
1925
+ [key: string]: string;
1926
+ };
1927
+ }
1928
+ /**
1929
+ * Design hints (style + UX cues) the analyzer attaches. Mirrors
1930
+ * `DesignPreferences` from `domain.ts`.
1931
+ */
1932
+ interface ParsedDesign {
1933
+ style?: string;
1934
+ uxHints?: {
1935
+ [key: string]: string;
1936
+ };
1937
+ }
1938
+
1939
+ export { type AgentCodeSearchResult, type AgentCompactResult, type AgentCompactStrategy, type AgentContext, type AgentGenerateOptions, type AgentMemoryCategory, type AgentMemoryRecord, OrbitalSchema as AppSchema, type AppSummary, type AssetLoadStatus, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, type BindingContext, type BindingRoot, BindingSchema, type BridgeHealth, type BusEvent, type BusEventListener, type BusEventSource, type CategorizedRemovals, type ChangeAuthor, type ChangeSetDocument, type ChangeSummary, type ChangesetValue, type CheckStatus, type ContextExtensions, type CreateFlow, DEFAULT_INTERACTION_MODELS, DeclaredTraitConfig, type DeleteFlow, DomainContext, type EditFlow, type EffectTrace, Entity, EntityField, EntityPersistence, EntityRow, type EventEmit, type EventKey, type EventListen, type EventLogEntry, EventPayload, EventPayloadValue, FieldValue, Orbital as FullOrbitalUnit, type GitHubLink, type HistoryMeta, type InteractionModel, type InteractionModelInput, InteractionModelSchema, KNOWN_VALIDATION_ERROR_CODES, type KnownValidationErrorCode, type LazyService, type ListInteraction, LogMeta, Orbital, OrbitalSchema, type OrbitalVerificationAPI, Page, type PageContentReduction, PageTraitRef, type ParsedDesign, type ParsedDomainContext, type ParsedEmitDeclaration, type ParsedEntity, type ParsedEvent, type ParsedListenDeclaration, type ParsedOrbital, type ParsedPage, type ParsedState, type ParsedStateMachine, type ParsedTrait, type ParsedTraitConfig, type ParsedTransition, PatternTypeSchema, type PersistActionName, type ResolvedEntity, type ResolvedEntityBinding, type ResolvedField, type ResolvedIR, type ResolvedNavigation, type ResolvedPage, type ResolvedPattern, type ResolvedSection, type ResolvedSectionEvent, type ResolvedTrait, type ResolvedTraitBinding, type ResolvedTraitDataEntity, type ResolvedTraitEvent, type ResolvedTraitGuard, type ResolvedTraitListener, type ResolvedTraitState, type ResolvedTraitTick, type ResolvedTraitTransition, type ResolvedTraitUIBinding, SExpr, type SaveOptions, type SaveResult, type SchemaChange, type SemanticChangeKind, type SemanticSchemaChange, type ServerResponseTrace, type ServiceAction, type ServiceActionName, type ServiceContract, type ServiceEvents, ServiceParams, type SnapshotDocument, type StatsView, type StoreContract, type StoreFilter, type StoreFilterOp, Trait, TraitCategory, TraitConfig, type TraitFieldRef, TraitFieldRefSchema, type TraitStateSnapshot, type TransitionFrom, type TransitionTrace, type Unsubscribe, type ValidationDocument, type ValidationError, type ValidationErrorCode, type ValidationIssue, type ValidationMeta, type ValidationResults, type VerificationCheck, type VerificationSnapshot, type VerificationSummary, type ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isKnownValidationErrorCode, isResolvedIR, isTraitFieldRef, toBindingRoot, validateBindingInContext };