@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/builders.d.ts +2 -2
- package/dist/builders.js.map +1 -1
- package/dist/{compose-behaviors-Be7k7Esx.d.ts → compose-behaviors-j53THIou.d.ts} +1 -1
- package/dist/domain-language/index.d.ts +1 -1
- package/dist/domain-language/index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +177 -14
- package/dist/index.js.map +1 -1
- package/dist/{schema-Cm63mgSP.d.ts → schema-BNBpNxGb.d.ts} +112 -2
- package/dist/state-machine/index.d.ts +56 -1
- package/dist/state-machine/index.js +149 -1
- package/dist/state-machine/index.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +26 -11
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { b as OrbitalSchema, S as State, O as OrbitalDefinition } from './schema-
|
|
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,
|
|
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-
|
|
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(
|
|
826
|
-
const 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(
|
|
894
|
-
return /^[A-Z][a-zA-Z0-9]*\.traits\.[A-Z][a-zA-Z0-9]*$/.test(
|
|
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(
|
|
897
|
-
const match =
|
|
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(
|
|
902
|
-
const match =
|
|
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(
|
|
907
|
-
const match =
|
|
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(
|
|
7957
|
-
if (typeof
|
|
7958
|
-
const match =
|
|
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
|
-
|
|
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
|