@almadar/core 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { b as OrbitalSchema, S as State, O as OrbitalDefinition } from './schema-Cm63mgSP.js';
2
- export { A as AGENT_DOMAIN_CATEGORIES, e as ALLOWED_CUSTOM_COMPONENTS, f as AgentDomainCategory, g as AgentDomainCategorySchema, h as AllowedCustomComponent, i as AnimationDef, j as AnimationDefInput, k as AnimationDefSchema, l as AssetMap, m as AssetMapInput, n as AssetMapSchema, o as AssetMapping, p as AssetMappingInput, q as AssetMappingSchema, C as CORE_BINDINGS, r as CallServiceConfig, s as ComputedEventContract, t as ComputedEventContractSchema, u as ComputedEventListener, v as ComputedEventListenerSchema, w as CoreBinding, x as CustomPatternDefinition, y as CustomPatternDefinitionInput, z as CustomPatternDefinitionSchema, B as CustomPatternMap, D as CustomPatternMapInput, F as CustomPatternMapSchema, G as DesignPreferences, H as DesignPreferencesInput, I as DesignPreferencesSchema, J as DesignTokens, K as DesignTokensInput, L as DesignTokensSchema, M as DomainCategory, N as DomainCategorySchema, Q as DomainContext, R as DomainContextInput, U as DomainContextSchema, V as DomainVocabulary, W as DomainVocabularySchema, X as ENTITY_ROLES, Y as Effect, Z as EffectInput, _ as EffectSchema, d as Entity, E as EntityField, $ as EntityFieldInput, a0 as EntityFieldSchema, a as EntityPersistence, a1 as EntityPersistenceSchema, a2 as EntityRef, a3 as EntityRefSchema, a4 as EntityRefStringSchema, a5 as EntityRole, a6 as EntityRoleSchema, a7 as EntitySchema, a8 as EntitySemanticRole, a9 as EntitySemanticRoleSchema, aa as Event, ab as EventInput, ac as EventListener, ad as EventListenerSchema, ae as EventPayloadField, af as EventPayloadFieldSchema, ag as EventSchema, ah as EventScope, ai as EventScopeSchema, aj as EventSemanticRole, ak as EventSemanticRoleSchema, al as EventSource, am as EventSourceSchema, an as Expression, ao as ExpressionInput, ap as ExpressionSchema, aq as Field, ar as FieldFormat, as as FieldFormatSchema, at as FieldSchema, au as FieldType, av as FieldTypeSchema, aw as FullOrbitalUnit, ax as GAME_TYPES, ay as GameSubCategory, az as GameSubCategorySchema, aA as GameType, aB as GameTypeSchema, aC as Guard, aD as GuardInput, aE as GuardSchema, aF as McpServiceDef, aG as McpServiceDefSchema, aH as NodeClassification, aI as NodeClassificationSchema, aw as Orbital, aJ as OrbitalConfig, aK as OrbitalConfigInput, aL as OrbitalConfigSchema, aM as OrbitalDefinitionSchema, aN as OrbitalEntity, aO as OrbitalEntityInput, aP as OrbitalEntitySchema, aQ as OrbitalInput, aR as OrbitalPage, aS as OrbitalPageInput, aT as OrbitalPageSchema, aU as OrbitalPageStrictInput, aV as OrbitalPageStrictSchema, aW as OrbitalSchemaInput, aX as OrbitalSchemaSchema, aY as OrbitalTraitRef, aZ as OrbitalTraitRefSchema, a_ as OrbitalUnit, a$ as OrbitalUnitSchema, b0 as OrbitalZodSchema, P as Page, b1 as PageRef, b2 as PageRefObject, b3 as PageRefObjectSchema, b4 as PageRefSchema, b5 as PageRefStringSchema, b6 as PageSchema, b7 as PageTraitRef, b8 as PageTraitRefSchema, b9 as ParsedBinding, ba as PayloadField, bb as PayloadFieldSchema, bc as PresentationType, bd as RelatedLink, be as RelatedLinkSchema, bf as RelationConfig, bg as RelationConfigSchema, bh as RenderUIConfig, bi as RequiredField, bj as RequiredFieldSchema, bk as ResolvedAsset, bl as ResolvedAssetInput, bm as ResolvedAssetSchema, bn as RestAuthConfig, bo as RestAuthConfigSchema, bp as RestServiceDef, bq as RestServiceDefSchema, br as SERVICE_TYPES, bs as SExpr, bt as SExprAtom, bu as SExprAtomSchema, bv as SExprInput, bw as SExprSchema, bx as SemanticAssetRef, by as SemanticAssetRefInput, bz as SemanticAssetRefSchema, bA as ServiceDefinition, bB as ServiceDefinitionSchema, bC as ServiceRef, bD as ServiceRefSchema, bE as ServiceRefStringSchema, bF as ServiceType, bG as ServiceTypeSchema, bH as SocketEvents, bI as SocketEventsSchema, bJ as SocketServiceDef, bK as SocketServiceDefSchema, bL as StateInput, bM as StateMachine, bN as StateMachineInput, bO as StateMachineSchema, bP as StateSchema, bQ as StateSemanticRole, bR as StateSemanticRoleSchema, bS as SuggestedGuard, bT as SuggestedGuardSchema, bU as ThemeDefinition, bV as ThemeDefinitionSchema, bW as ThemeRef, bX as ThemeRefSchema, bY as ThemeRefStringSchema, bZ as ThemeTokens, b_ as ThemeTokensSchema, b$ as ThemeVariant, c0 as ThemeVariantSchema, c as Trait, c1 as TraitCategory, c2 as TraitCategorySchema, c3 as TraitDataEntity, c4 as TraitDataEntitySchema, c5 as TraitEntityField, c6 as TraitEntityFieldSchema, T as TraitEventContract, c7 as TraitEventContractSchema, c8 as TraitEventListener, c9 as TraitEventListenerSchema, ca as TraitInput, cb as TraitRef, cc as TraitRefSchema, cd as TraitReference, ce as TraitReferenceInput, cf as TraitReferenceSchema, cg as TraitSchema, ch as TraitTick, ci as TraitTickSchema, cj as TraitUIBinding, ck as Transition, cl as TransitionInput, cm as TransitionSchema, cn as UISlot, co as UISlotSchema, cp as UI_SLOTS, cq as UXHints, cr as UXHintsSchema, cs as UseDeclaration, ct as UseDeclarationSchema, cu as UserPersona, cv as UserPersonaInput, cw as UserPersonaSchema, cx as VISUAL_STYLES, cy as ViewType, cz as ViewTypeSchema, cA as VisualStyle, cB as VisualStyleSchema, cC as callService, cD as collectBindings, cE as createAssetKey, cF as deriveCollection, cG as despawn, cH as doEffects, cI as emit, cJ as findService, cK as getArgs, cL as getDefaultAnimationsForRole, cM as getOperator, cN as getServiceNames, cO as getTraitConfig, cP as getTraitName, cQ as hasService, cR as isBinding, cS as isCircuitEvent, cT as isEffect, cU as isEntityReference, cV as isImportedTraitRef, cW as isInlineTrait, cX as isMcpService, cY as isOrbitalDefinition, cZ as isPageReference, c_ as isPageReferenceObject, c$ as isPageReferenceString, d0 as isRestService, d1 as isRuntimeEntity, d2 as isSExpr, d3 as isSExprAtom, d4 as isSExprCall, d5 as isSExprEffect, d6 as isServiceReference, d7 as isSingletonEntity, d8 as isSocketService, d9 as isThemeReference, da as isValidBinding, db as navigate, dc as normalizeTraitRef, dd as notify, de as parseAssetKey, df as parseBinding, dg as parseEntityRef, dh as parseImportedTraitRef, di as parseOrbitalSchema, dj as parsePageRef, dk as parseServiceRef, dl as persist, dm as renderUI, dn as safeParseOrbitalSchema, dp as set, dq as sexpr, dr as spawn, ds as validateAssetAnimations, dt as walkSExpr } from './schema-Cm63mgSP.js';
1
+ import { b as OrbitalSchema, S as State, O as OrbitalDefinition } from './schema-BNBpNxGb.js';
2
+ export { A as AGENT_DOMAIN_CATEGORIES, e as ALLOWED_CUSTOM_COMPONENTS, f as AgentDomainCategory, g as AgentDomainCategorySchema, h as AllowedCustomComponent, i as AnimationDef, j as AnimationDefInput, k as AnimationDefSchema, l as AssetMap, m as AssetMapInput, n as AssetMapSchema, o as AssetMapping, p as AssetMappingInput, q as AssetMappingSchema, r as AtomicEffect, C as CORE_BINDINGS, s as CallServiceConfig, t as ComputedEventContract, u as ComputedEventContractSchema, v as ComputedEventListener, w as ComputedEventListenerSchema, x as CoreBinding, y as CustomPatternDefinition, z as CustomPatternDefinitionInput, B as CustomPatternDefinitionSchema, D as CustomPatternMap, F as CustomPatternMapInput, G as CustomPatternMapSchema, H as DerefEffect, I as DesignPreferences, J as DesignPreferencesInput, K as DesignPreferencesSchema, L as DesignTokens, M as DesignTokensInput, N as DesignTokensSchema, Q as DomainCategory, R as DomainCategorySchema, U as DomainContext, V as DomainContextInput, W as DomainContextSchema, X as DomainVocabulary, Y as DomainVocabularySchema, Z as ENTITY_ROLES, _ as Effect, $ as EffectInput, a0 as EffectSchema, d as Entity, E as EntityField, a1 as EntityFieldInput, a2 as EntityFieldSchema, a as EntityPersistence, a3 as EntityPersistenceSchema, a4 as EntityRef, a5 as EntityRefSchema, a6 as EntityRefStringSchema, a7 as EntityRole, a8 as EntityRoleSchema, a9 as EntitySchema, aa as EntitySemanticRole, ab as EntitySemanticRoleSchema, ac as Event, ad as EventInput, ae as EventListener, af as EventListenerSchema, ag as EventPayloadField, ah as EventPayloadFieldSchema, ai as EventSchema, aj as EventScope, ak as EventScopeSchema, al as EventSemanticRole, am as EventSemanticRoleSchema, an as EventSource, ao as EventSourceSchema, ap as Expression, aq as ExpressionInput, ar as ExpressionSchema, as as Field, at as FieldFormat, au as FieldFormatSchema, av as FieldSchema, aw as FieldType, ax as FieldTypeSchema, ay as FullOrbitalUnit, az as GAME_TYPES, aA as GameSubCategory, aB as GameSubCategorySchema, aC as GameType, aD as GameTypeSchema, aE as Guard, aF as GuardInput, aG as GuardSchema, aH as McpServiceDef, aI as McpServiceDefSchema, aJ as NodeClassification, aK as NodeClassificationSchema, ay as Orbital, aL as OrbitalConfig, aM as OrbitalConfigInput, aN as OrbitalConfigSchema, aO as OrbitalDefinitionSchema, aP as OrbitalEntity, aQ as OrbitalEntityInput, aR as OrbitalEntitySchema, aS as OrbitalInput, aT as OrbitalPage, aU as OrbitalPageInput, aV as OrbitalPageSchema, aW as OrbitalPageStrictInput, aX as OrbitalPageStrictSchema, aY as OrbitalSchemaInput, aZ as OrbitalSchemaSchema, a_ as OrbitalTraitRef, a$ as OrbitalTraitRefSchema, b0 as OrbitalUnit, b1 as OrbitalUnitSchema, b2 as OrbitalZodSchema, P as Page, b3 as PageRef, b4 as PageRefObject, b5 as PageRefObjectSchema, b6 as PageRefSchema, b7 as PageRefStringSchema, b8 as PageSchema, b9 as PageTraitRef, ba as PageTraitRefSchema, bb as ParsedBinding, bc as PayloadField, bd as PayloadFieldSchema, be as PresentationType, bf as RefEffect, bg as RelatedLink, bh as RelatedLinkSchema, bi as RelationConfig, bj as RelationConfigSchema, bk as RenderUIConfig, bl as RequiredField, bm as RequiredFieldSchema, bn as ResolvedAsset, bo as ResolvedAssetInput, bp as ResolvedAssetSchema, bq as RestAuthConfig, br as RestAuthConfigSchema, bs as RestServiceDef, bt as RestServiceDefSchema, bu as SERVICE_TYPES, bv as SExpr, bw as SExprAtom, bx as SExprAtomSchema, by as SExprInput, bz as SExprSchema, bA as SemanticAssetRef, bB as SemanticAssetRefInput, bC as SemanticAssetRefSchema, bD as ServiceDefinition, bE as ServiceDefinitionSchema, bF as ServiceRef, bG as ServiceRefSchema, bH as ServiceRefStringSchema, bI as ServiceType, bJ as ServiceTypeSchema, bK as SocketEvents, bL as SocketEventsSchema, bM as SocketServiceDef, bN as SocketServiceDefSchema, bO as StateInput, bP as StateMachine, bQ as StateMachineInput, bR as StateMachineSchema, bS as StateSchema, bT as StateSemanticRole, bU as StateSemanticRoleSchema, bV as SuggestedGuard, bW as SuggestedGuardSchema, bX as SwapEffect, bY as ThemeDefinition, bZ as ThemeDefinitionSchema, b_ as ThemeRef, b$ as ThemeRefSchema, c0 as ThemeRefStringSchema, c1 as ThemeTokens, c2 as ThemeTokensSchema, c3 as ThemeVariant, c4 as ThemeVariantSchema, c as Trait, c5 as TraitCategory, c6 as TraitCategorySchema, c7 as TraitDataEntity, c8 as TraitDataEntitySchema, c9 as TraitEntityField, ca as TraitEntityFieldSchema, T as TraitEventContract, cb as TraitEventContractSchema, cc as TraitEventListener, cd as TraitEventListenerSchema, ce as TraitInput, cf as TraitRef, cg as TraitRefSchema, ch as TraitReference, ci as TraitReferenceInput, cj as TraitReferenceSchema, ck as TraitSchema, cl as TraitTick, cm as TraitTickSchema, cn as TraitUIBinding, co as Transition, cp as TransitionInput, cq as TransitionSchema, cr as UISlot, cs as UISlotSchema, ct as UI_SLOTS, cu as UXHints, cv as UXHintsSchema, cw as UseDeclaration, cx as UseDeclarationSchema, cy as UserPersona, cz as UserPersonaInput, cA as UserPersonaSchema, cB as VISUAL_STYLES, cC as ViewType, cD as ViewTypeSchema, cE as VisualStyle, cF as VisualStyleSchema, cG as WatchEffect, cH as WatchOptions, cI as atomic, cJ as callService, cK as collectBindings, cL as createAssetKey, cM as deref, cN as deriveCollection, cO as despawn, cP as doEffects, cQ as emit, cR as findService, cS as getArgs, cT as getDefaultAnimationsForRole, cU as getOperator, cV as getServiceNames, cW as getTraitConfig, cX as getTraitName, cY as hasService, cZ as isBinding, c_ as isCircuitEvent, c$ as isEffect, d0 as isEntityReference, d1 as isImportedTraitRef, d2 as isInlineTrait, d3 as isMcpService, d4 as isOrbitalDefinition, d5 as isPageReference, d6 as isPageReferenceObject, d7 as isPageReferenceString, d8 as isRestService, d9 as isRuntimeEntity, da as isSExpr, db as isSExprAtom, dc as isSExprCall, dd as isSExprEffect, de as isServiceReference, df as isSingletonEntity, dg as isSocketService, dh as isThemeReference, di as isValidBinding, dj as navigate, dk as normalizeTraitRef, dl as notify, dm as parseAssetKey, dn as parseBinding, dp as parseEntityRef, dq as parseImportedTraitRef, dr as parseOrbitalSchema, ds as parsePageRef, dt as parseServiceRef, du as persist, dv as ref, dw as renderUI, dx as safeParseOrbitalSchema, dy as set, dz as sexpr, dA as spawn, dB as swap, dC as validateAssetAnimations, dD as walkSExpr, dE as watch } from './schema-BNBpNxGb.js';
3
3
  import { ResolvedIR, ResolvedEntity, ResolvedPage, ResolvedTrait, SchemaChange, CategorizedRemovals, PageContentReduction } from './types/index.js';
4
4
  export { AppSummary, BINDING_CONTEXT_RULES, BINDING_DOCS, BindingContext, BindingSchema, ChangeAuthor, ChangeSetDocument, ChangeSummary, CreateFlow, DEFAULT_INTERACTION_MODELS, DeleteFlow, EditFlow, GitHubLink, HistoryMeta, InteractionModel, InteractionModelInput, InteractionModelSchema, LazyService, ListInteraction, OperatorName, PatternTypeSchema, PersistActionName, ResolvedEntityBinding, ResolvedField, ResolvedNavigation, ResolvedPattern, ResolvedSection, ResolvedSectionEvent, ResolvedTraitBinding, ResolvedTraitDataEntity, ResolvedTraitEvent, ResolvedTraitGuard, ResolvedTraitListener, ResolvedTraitState, ResolvedTraitTick, ResolvedTraitTransition, ResolvedTraitUIBinding, SaveOptions, SaveResult, ServiceAction, ServiceActionName, ServiceContract, ServiceEvents, SnapshotDocument, StatsView, StoreContract, StoreFilter, StoreFilterOp, TransitionFrom, ValidationDocument, ValidationIssue, ValidationMeta, ValidationResults, ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllOperators, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isResolvedIR, validateBindingInContext } from './types/index.js';
5
5
  export { ASTNode, ComparisonCondition, ComparisonOperator, DomainBehavior, DomainChunk, DomainDocument, DomainEffect, DomainEntity, DomainField, DomainFieldType, DomainGuard, DomainPage, DomainPageAction, DomainPageSection, DomainRelationship, DomainTick, DomainToSchemaResult, DomainTransition, EFFECT_REGISTRY, EffectMapping, EffectType, FIELD_TYPE_REGISTRY, FieldCheckCondition, FieldReference, FieldTypeMapping, GUARD_REGISTRY, GuardCondition, GuardMapping, KEYWORDS, Lexer, LogicalCondition, LogicalOperator, MULTI_WORD_KEYWORDS, MappingStore, MergeResult, ParseError, ParseResult, RelationshipType, SchemaToDomainResult, SectionMapping, SourceLocation, SourceRange, Token, TokenType, UserCheckCondition, applySectionUpdate, computeSchemaHash, convertDomainToSchema, convertEntitiesToDomain, convertPagesToDomain, convertSchemaToDomain, convertTraitsToDomain, createMappingStore, deleteSection, detectChanges, domainKeywordToSchemaType, findMapping, findMappingByPath, findMappingsByType, formatBehaviorToDomain, formatBehaviorToSchema, formatDomainGuardToSchema, formatEntityToDomain, formatEntityToSchema, formatGuardConditionToDomain, formatGuardToDomain, formatGuardToSchema, formatMergeSummary, formatPageToDomain, formatPageToSchema, formatSchemaEntityToDomain, formatSchemaGuardToDomain, formatSchemaPageToDomain, formatSchemaTraitToDomain, generateDomainLanguageReference, generateSectionId, getEffectMapping, getFieldTypeMapping, getGuardMapping, getRegisteredEffects, getRegisteredFieldTypes, getRegisteredGuards, getRegistryStats, getSchemaPath, hasSchemaChanged, isEffectRegistered, isFieldTypeRegistered, isGuardRegistered, mergeDomainChunks, parseBehavior, parseDomainEffect, parseDomainEffects, parseDomainGuard, parseEntity, parseGuard, parsePage, parseSectionId, removeMapping, resolveConflict, schemaEntityToDomainEntity, schemaPageToDomainPage, schemaTraitToDomainBehavior, schemaTypeToDomainKeyword, tokenize, updateMappingRange, updateSchemaHash, upsertMapping, validateDomainChunk } from './domain-language/index.js';
6
- export { C as ComposeBehaviorsInput, a as ComposeBehaviorsResult, E as EventWiringEntry, L as LayoutStrategy, b as applyEventWiring, c as composeBehaviors, d as detectLayoutStrategy } from './compose-behaviors-Be7k7Esx.js';
7
- export { BFSNode, BFSPathNode, GraphTransition, GuardPayload, ReplayStep, ReplayTransition, StateEdge, buildGuardPayloads, buildReplayPaths, buildStateGraph, collectReachableStates, extractPayloadFieldRef, walkStatePairs } from './state-machine/index.js';
6
+ export { C as ComposeBehaviorsInput, a as ComposeBehaviorsResult, E as EventWiringEntry, L as LayoutStrategy, b as applyEventWiring, c as composeBehaviors, d as detectLayoutStrategy } from './compose-behaviors-j53THIou.js';
7
+ export { BFSNode, BFSPathNode, EdgeWalkTransition, GraphTransition, GuardPayload, ReplayStep, ReplayTransition, StateEdge, WalkStep, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, collectReachableStates, extractPayloadFieldRef, walkStatePairs } from './state-machine/index.js';
8
8
  export { CATEGORIES, CategoryMeta, OPERATORS, OPERATORS_SCHEMA, OPERATOR_NAMES, OperatorCategory, OperatorMeta, OperatorStats, OperatorsSchema, TargetPlatform, getOperatorMeta, getOperatorStats, getOperatorsByCategory, getOperatorsForTarget, isEffectOperator, isGuardOperator, isKnownOperator, validateOperatorArity } from '@almadar/operators';
9
9
  export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
10
10
  import 'zod';
package/dist/index.js CHANGED
@@ -301,6 +301,21 @@ function doEffects(...effects) {
301
301
  function notify(channel, message, recipient) {
302
302
  return recipient ? ["notify", channel, message, recipient] : ["notify", channel, message];
303
303
  }
304
+ function ref(binding, selector) {
305
+ return selector ? ["ref", binding, selector] : ["ref", binding];
306
+ }
307
+ function deref(binding, selector) {
308
+ return selector ? ["deref", binding, selector] : ["deref", binding];
309
+ }
310
+ function swap(binding, transform) {
311
+ return ["swap!", binding, transform];
312
+ }
313
+ function watch(binding, event, options) {
314
+ return options ? ["watch", binding, event, options] : ["watch", binding, event];
315
+ }
316
+ function atomic(...effects) {
317
+ return ["atomic", ...effects];
318
+ }
304
319
  var SExprAtomSchema = z.union([
305
320
  z.string(),
306
321
  z.number(),
@@ -822,8 +837,8 @@ var ServiceRefSchema = z.union([
822
837
  ServiceDefinitionSchema,
823
838
  ServiceRefStringSchema
824
839
  ]);
825
- function parseServiceRef(ref) {
826
- const match = ref.match(
840
+ function parseServiceRef(ref2) {
841
+ const match = ref2.match(
827
842
  /^([A-Z][a-zA-Z0-9]*)\.services\.([a-zA-Z][a-zA-Z0-9]*)$/
828
843
  );
829
844
  if (!match) return null;
@@ -890,21 +905,21 @@ z.string().regex(
890
905
  /^([A-Z][a-zA-Z0-9]*\.traits\.)?[A-Z][a-zA-Z0-9]*$/,
891
906
  'Trait reference must be "TraitName" or "Alias.traits.TraitName"'
892
907
  );
893
- function isImportedTraitRef(ref) {
894
- return /^[A-Z][a-zA-Z0-9]*\.traits\.[A-Z][a-zA-Z0-9]*$/.test(ref);
908
+ function isImportedTraitRef(ref2) {
909
+ return /^[A-Z][a-zA-Z0-9]*\.traits\.[A-Z][a-zA-Z0-9]*$/.test(ref2);
895
910
  }
896
- function parseImportedTraitRef(ref) {
897
- const match = ref.match(/^([A-Z][a-zA-Z0-9]*)\.traits\.([A-Z][a-zA-Z0-9]*)$/);
911
+ function parseImportedTraitRef(ref2) {
912
+ const match = ref2.match(/^([A-Z][a-zA-Z0-9]*)\.traits\.([A-Z][a-zA-Z0-9]*)$/);
898
913
  if (!match) return null;
899
914
  return { alias: match[1], traitName: match[2] };
900
915
  }
901
- function parseEntityRef(ref) {
902
- const match = ref.match(/^([A-Z][a-zA-Z0-9]*)\.entity$/);
916
+ function parseEntityRef(ref2) {
917
+ const match = ref2.match(/^([A-Z][a-zA-Z0-9]*)\.entity$/);
903
918
  if (!match) return null;
904
919
  return { alias: match[1] };
905
920
  }
906
- function parsePageRef(ref) {
907
- const match = ref.match(/^([A-Z][a-zA-Z0-9]*)\.pages\.([A-Z][a-zA-Z0-9]*)$/);
921
+ function parsePageRef(ref2) {
922
+ const match = ref2.match(/^([A-Z][a-zA-Z0-9]*)\.pages\.([A-Z][a-zA-Z0-9]*)$/);
908
923
  if (!match) return null;
909
924
  return { alias: match[1], pageName: match[2] };
910
925
  }
@@ -7953,9 +7968,9 @@ async function walkStatePairs(transitions, initialState, maxDepth, visitor) {
7953
7968
  }
7954
7969
 
7955
7970
  // src/state-machine/guard-payloads.ts
7956
- function extractPayloadFieldRef(ref) {
7957
- if (typeof ref !== "string") return null;
7958
- const match = ref.match(/^@payload\.([A-Za-z0-9_]+)/);
7971
+ function extractPayloadFieldRef(ref2) {
7972
+ if (typeof ref2 !== "string") return null;
7973
+ const match = ref2.match(/^@payload\.([A-Za-z0-9_]+)/);
7959
7974
  return match ? match[1] : null;
7960
7975
  }
7961
7976
  function buildGuardPayloads(guard) {
@@ -8065,6 +8080,154 @@ function buildReplayPaths(transitions, initialState, maxDepth = 3) {
8065
8080
  return replayPaths;
8066
8081
  }
8067
8082
 
8068
- export { AGENT_DOMAIN_CATEGORIES, ALLOWED_CUSTOM_COMPONENTS, AgentDomainCategorySchema, AnimationDefSchema, AssetMapSchema, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BindingSchema, CORE_BINDINGS, ComputedEventContractSchema, ComputedEventListenerSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, EFFECT_REGISTRY, ENTITY_ROLES, EffectSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FIELD_TYPE_REGISTRY, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GUARD_REGISTRY, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, KEYWORDS, Lexer, MULTI_WORD_KEYWORDS, McpServiceDefSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PatternTypeSchema, PayloadFieldSchema, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, ResolvedAssetSchema, RestAuthConfigSchema, RestServiceDefSchema, SERVICE_TYPES, SExprAtomSchema, SExprSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SocketEventsSchema, SocketServiceDefSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SuggestedGuardSchema, ThemeDefinitionSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TokenType, TraitCategorySchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, applyEventWiring, applySectionUpdate, buildGuardPayloads, buildReplayPaths, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectReachableStates, composeBehaviors, computeSchemaHash, convertDomainToSchema, convertEntitiesToDomain, convertPagesToDomain, convertSchemaToDomain, convertTraitsToDomain, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createMappingStore, createResolvedField, createTypedEventBus, deleteSection, deriveCollection, despawn, detectChanges, detectLayoutStrategy, detectPageContentReduction, diffSchemas, doEffects, domainKeywordToSchemaType, emit, extractPayloadFieldRef, findMapping, findMappingByPath, findMappingsByType, findService, formatBehaviorToDomain, formatBehaviorToSchema, formatDomainGuardToSchema, formatEntityToDomain, formatEntityToSchema, formatGuardConditionToDomain, formatGuardToDomain, formatGuardToSchema, formatMergeSummary, formatPageToDomain, formatPageToSchema, formatSchemaEntityToDomain, formatSchemaGuardToDomain, formatSchemaPageToDomain, formatSchemaTraitToDomain, generateDomainLanguageReference, generateSectionId, getAllOperators, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getEffectMapping, getEntity, getFieldTypeMapping, getGuardMapping, getInteractionModelForDomain, getOperator, getPage, getPages, getRegisteredEffects, getRegisteredFieldTypes, getRegisteredGuards, getRegistryStats, getRemovals, getSchemaCacheStats, getSchemaPath, getServiceNames, getTrait, getTraitConfig, getTraitName, hasSchemaChanged, hasService, hasSignificantPageReduction, inferTsType, isBinding, isCircuitEvent, isDestructiveChange, isEffect, isEffectRegistered, isEntityReference, isFieldTypeRegistered, isGuardRegistered, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, mergeDomainChunks, navigate, normalizeTraitRef, notify, parseAssetKey, parseBehavior, parseBinding, parseDomainEffect, parseDomainEffects, parseDomainGuard, parseEntity, parseEntityRef, parseGuard, parseImportedTraitRef, parseOrbitalSchema, parsePage, parsePageRef, parseSectionId, parseServiceRef, persist, removeMapping, renderUI, requiresConfirmation, resolveConflict, safeParseOrbitalSchema, schemaEntityToDomainEntity, schemaPageToDomainPage, schemaToIR, schemaTraitToDomainBehavior, schemaTypeToDomainKeyword, set, sexpr, spawn, summarizeOrbital, summarizeSchema, tokenize, updateMappingRange, updateSchemaHash, upsertMapping, validateAssetAnimations, validateBindingInContext, validateDomainChunk, walkSExpr, walkStatePairs };
8083
+ // src/state-machine/edge-walk.ts
8084
+ function buildEdgeCoveringWalk(transitions, initialState) {
8085
+ const filtered = transitions.filter(
8086
+ (t) => t.from !== "*" && t.event !== "INIT"
8087
+ );
8088
+ const graph = /* @__PURE__ */ new Map();
8089
+ const allStates = /* @__PURE__ */ new Set();
8090
+ for (const t of filtered) {
8091
+ allStates.add(t.from);
8092
+ allStates.add(t.to);
8093
+ if (!graph.has(t.from)) graph.set(t.from, []);
8094
+ graph.get(t.from).push({ event: t.event, to: t.to, transition: t });
8095
+ }
8096
+ allStates.add(initialState);
8097
+ const uncovered = /* @__PURE__ */ new Set();
8098
+ const edgeMeta = /* @__PURE__ */ new Map();
8099
+ for (const t of filtered) {
8100
+ if (t.hasGuard) {
8101
+ const keyPass = `${t.from}+${t.event}->${t.to}[pass]`;
8102
+ const keyFail = `${t.from}+${t.event}->${t.to}[fail]`;
8103
+ uncovered.add(keyPass);
8104
+ uncovered.add(keyFail);
8105
+ edgeMeta.set(keyPass, { transition: t, guardCase: "pass" });
8106
+ edgeMeta.set(keyFail, { transition: t, guardCase: "fail" });
8107
+ } else {
8108
+ const key = `${t.from}+${t.event}->${t.to}`;
8109
+ uncovered.add(key);
8110
+ edgeMeta.set(key, { transition: t, guardCase: null });
8111
+ }
8112
+ }
8113
+ if (uncovered.size === 0) return [];
8114
+ const shortestPaths = /* @__PURE__ */ new Map();
8115
+ for (const state of allStates) {
8116
+ shortestPaths.set(state, bfsShortestPaths(state, graph));
8117
+ }
8118
+ const walk = [];
8119
+ let currentState = initialState;
8120
+ const maxIterations = uncovered.size * allStates.size * 2;
8121
+ let iterations = 0;
8122
+ while (uncovered.size > 0 && iterations < maxIterations) {
8123
+ iterations++;
8124
+ const outgoing = findUncoveredEdges(currentState, graph, uncovered);
8125
+ if (outgoing.length > 0) {
8126
+ const pick = outgoing[0];
8127
+ const payload = buildPayloadForEdge(pick.transition, pick.guardCase);
8128
+ walk.push({
8129
+ from: currentState,
8130
+ event: pick.transition.event,
8131
+ to: pick.transition.to,
8132
+ guardCase: pick.guardCase,
8133
+ payload,
8134
+ isRepositioning: false
8135
+ });
8136
+ uncovered.delete(pick.key);
8137
+ if (pick.guardCase !== "fail") {
8138
+ currentState = pick.transition.to;
8139
+ }
8140
+ } else {
8141
+ const target = findNearestUncoveredState(currentState, graph, uncovered, shortestPaths);
8142
+ if (!target) {
8143
+ break;
8144
+ }
8145
+ const repoPath = shortestPaths.get(currentState)?.get(target);
8146
+ if (!repoPath || repoPath.length === 0) break;
8147
+ for (const step of repoPath) {
8148
+ walk.push({
8149
+ from: currentState,
8150
+ event: step.event,
8151
+ to: step.to,
8152
+ guardCase: null,
8153
+ payload: {},
8154
+ isRepositioning: true
8155
+ });
8156
+ currentState = step.to;
8157
+ }
8158
+ }
8159
+ }
8160
+ return walk;
8161
+ }
8162
+ function bfsShortestPaths(source, graph) {
8163
+ const paths = /* @__PURE__ */ new Map();
8164
+ const visited = /* @__PURE__ */ new Set([source]);
8165
+ const queue = [
8166
+ { state: source, path: [] }
8167
+ ];
8168
+ while (queue.length > 0) {
8169
+ const { state, path } = queue.shift();
8170
+ const edges = graph.get(state) ?? [];
8171
+ for (const edge of edges) {
8172
+ if (visited.has(edge.to)) continue;
8173
+ visited.add(edge.to);
8174
+ const newPath = [...path, { event: edge.event, to: edge.to }];
8175
+ paths.set(edge.to, newPath);
8176
+ queue.push({ state: edge.to, path: newPath });
8177
+ }
8178
+ }
8179
+ return paths;
8180
+ }
8181
+ function findUncoveredEdges(state, graph, uncovered) {
8182
+ const edges = graph.get(state) ?? [];
8183
+ const result = [];
8184
+ for (const edge of edges) {
8185
+ if (edge.transition.hasGuard) {
8186
+ const keyPass = `${state}+${edge.event}->${edge.to}[pass]`;
8187
+ const keyFail = `${state}+${edge.event}->${edge.to}[fail]`;
8188
+ if (uncovered.has(keyPass)) {
8189
+ result.push({ key: keyPass, transition: edge.transition, guardCase: "pass" });
8190
+ }
8191
+ if (uncovered.has(keyFail)) {
8192
+ result.push({ key: keyFail, transition: edge.transition, guardCase: "fail" });
8193
+ }
8194
+ } else {
8195
+ const key = `${state}+${edge.event}->${edge.to}`;
8196
+ if (uncovered.has(key)) {
8197
+ result.push({ key, transition: edge.transition, guardCase: null });
8198
+ }
8199
+ }
8200
+ }
8201
+ return result;
8202
+ }
8203
+ function findNearestUncoveredState(currentState, graph, uncovered, shortestPaths) {
8204
+ const statesWithUncovered = /* @__PURE__ */ new Set();
8205
+ for (const key of uncovered) {
8206
+ const fromState = key.split("+")[0];
8207
+ statesWithUncovered.add(fromState);
8208
+ }
8209
+ if (statesWithUncovered.has(currentState)) return currentState;
8210
+ const paths = shortestPaths.get(currentState);
8211
+ if (!paths) return null;
8212
+ let nearestState = null;
8213
+ let nearestDist = Infinity;
8214
+ for (const target of statesWithUncovered) {
8215
+ const path = paths.get(target);
8216
+ if (path && path.length < nearestDist) {
8217
+ nearestDist = path.length;
8218
+ nearestState = target;
8219
+ }
8220
+ }
8221
+ return nearestState;
8222
+ }
8223
+ function buildPayloadForEdge(transition, guardCase) {
8224
+ if (!transition.hasGuard || !transition.guard || !guardCase) {
8225
+ return {};
8226
+ }
8227
+ const payloads = buildGuardPayloads(transition.guard);
8228
+ return guardCase === "pass" ? payloads.pass : payloads.fail;
8229
+ }
8230
+
8231
+ export { AGENT_DOMAIN_CATEGORIES, ALLOWED_CUSTOM_COMPONENTS, AgentDomainCategorySchema, AnimationDefSchema, AssetMapSchema, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BindingSchema, CORE_BINDINGS, ComputedEventContractSchema, ComputedEventListenerSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, EFFECT_REGISTRY, ENTITY_ROLES, EffectSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FIELD_TYPE_REGISTRY, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GUARD_REGISTRY, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, KEYWORDS, Lexer, MULTI_WORD_KEYWORDS, McpServiceDefSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PatternTypeSchema, PayloadFieldSchema, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, ResolvedAssetSchema, RestAuthConfigSchema, RestServiceDefSchema, SERVICE_TYPES, SExprAtomSchema, SExprSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SocketEventsSchema, SocketServiceDefSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SuggestedGuardSchema, ThemeDefinitionSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TokenType, TraitCategorySchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, applyEventWiring, applySectionUpdate, atomic, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectReachableStates, composeBehaviors, computeSchemaHash, convertDomainToSchema, convertEntitiesToDomain, convertPagesToDomain, convertSchemaToDomain, convertTraitsToDomain, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createMappingStore, createResolvedField, createTypedEventBus, deleteSection, deref, deriveCollection, despawn, detectChanges, detectLayoutStrategy, detectPageContentReduction, diffSchemas, doEffects, domainKeywordToSchemaType, emit, extractPayloadFieldRef, findMapping, findMappingByPath, findMappingsByType, findService, formatBehaviorToDomain, formatBehaviorToSchema, formatDomainGuardToSchema, formatEntityToDomain, formatEntityToSchema, formatGuardConditionToDomain, formatGuardToDomain, formatGuardToSchema, formatMergeSummary, formatPageToDomain, formatPageToSchema, formatSchemaEntityToDomain, formatSchemaGuardToDomain, formatSchemaPageToDomain, formatSchemaTraitToDomain, generateDomainLanguageReference, generateSectionId, getAllOperators, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getEffectMapping, getEntity, getFieldTypeMapping, getGuardMapping, getInteractionModelForDomain, getOperator, getPage, getPages, getRegisteredEffects, getRegisteredFieldTypes, getRegisteredGuards, getRegistryStats, getRemovals, getSchemaCacheStats, getSchemaPath, getServiceNames, getTrait, getTraitConfig, getTraitName, hasSchemaChanged, hasService, hasSignificantPageReduction, inferTsType, isBinding, isCircuitEvent, isDestructiveChange, isEffect, isEffectRegistered, isEntityReference, isFieldTypeRegistered, isGuardRegistered, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, mergeDomainChunks, navigate, normalizeTraitRef, notify, parseAssetKey, parseBehavior, parseBinding, parseDomainEffect, parseDomainEffects, parseDomainGuard, parseEntity, parseEntityRef, parseGuard, parseImportedTraitRef, parseOrbitalSchema, parsePage, parsePageRef, parseSectionId, parseServiceRef, persist, ref, removeMapping, renderUI, requiresConfirmation, resolveConflict, safeParseOrbitalSchema, schemaEntityToDomainEntity, schemaPageToDomainPage, schemaToIR, schemaTraitToDomainBehavior, schemaTypeToDomainKeyword, set, sexpr, spawn, summarizeOrbital, summarizeSchema, swap, tokenize, updateMappingRange, updateSchemaHash, upsertMapping, validateAssetAnimations, validateBindingInContext, validateDomainChunk, walkSExpr, walkStatePairs, watch };
8069
8232
  //# sourceMappingURL=index.js.map
8070
8233
  //# sourceMappingURL=index.js.map