@almadar/core 8.6.1 → 8.6.3

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,12 +1,12 @@
1
- import { a3 as OrbitalSchema, X as OrbitalDefinition } from './schema--EDm7mx5.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, u as DomainContext, 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, T as FullOrbitalUnit, P as GameSubCategory, Q as GameSubCategorySchema, R as NodeClassification, S as NodeClassificationSchema, T as Orbital, U as OrbitalConfig, V as OrbitalConfigInput, W as OrbitalConfigSchema, 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, aa as Page, 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--EDm7mx5.js';
3
- import { b7 as State } from './trait-D1kGh81D.js';
4
- export { A as AgentEffect, a as AnimationDef, b as AnimationDefInput, c as AnimationDefSchema, d as AssetMap, e as AssetMapInput, f as AssetMapSchema, g as AssetMapping, h as AssetMappingInput, i as AssetMappingSchema, j as AtomicEffect, C as CallServiceConfig, k as CallServiceEffect, l as CheckpointLoadEffect, m as CheckpointSaveEffect, n as ConfigFieldDeclaration, o as ConfigFieldDeclarationSchema, D as DeclaredTraitConfig, p as DeclaredTraitConfigSchema, q as DerefEffect, r as DespawnEffect, s as DoEffect, E as ENTITY_ROLES, t as Effect, u as EffectInput, v as EffectSchema, w as EmitConfig, x as EmitEffect, y as Entity, z as EntityData, B as EntityField, F as EntityFieldInput, G as EntityFieldSchema, H as EntityPersistence, I as EntityPersistenceSchema, J as EntityRole, K as EntityRoleSchema, L as EntityRow, M as EntitySchema, N as EvaluateConfig, O as EvaluateEffect, P as Event, Q as EventInput, R as EventPayloadField, S as EventPayloadFieldSchema, T as EventSchema, U as EventScope, V as EventScopeSchema, W as FetchEffect, X as FetchOptions, Y as FetchResult, Z as Field, _ as FieldFormat, $ as FieldFormatSchema, a0 as FieldSchema, a1 as FieldType, a2 as FieldTypeSchema, a3 as FieldValue, a4 as ForwardConfig, a5 as ForwardEffect, a6 as GAME_TYPES, a7 as GameType, a8 as GameTypeSchema, a9 as Guard, aa as GuardInput, ab as GuardSchema, ac as ListenSource, ad as ListenSourceSchema, ae as LogEffect, af as McpServiceDef, ag as McpServiceDefSchema, ah as NavigateEffect, ai as NnConfig, aj as NnLayer, ak as NotifyEffect, al as OrbitalEntity, am as OrbitalEntityInput, an as OrbitalEntitySchema, ao as OrbitalTraitRef, ap as OrbitalTraitRefSchema, aq as OsEffect, ar as PayloadField, as as PayloadFieldSchema, at as PersistData, au as PersistEffect, av as PersistEmitConfig, aw as PresentationType, ax as RefEffect, ay as RelationConfig, az as RelationConfigSchema, aA as RenderItemLambda, aB as RenderUIConfig, aC as RenderUIEffect, aD as RenderUINode, aE as RequiredField, aF as RequiredFieldSchema, aG as ResolvedAsset, aH as ResolvedAssetInput, aI as ResolvedAssetSchema, aJ as ResolvedPatternProps, aK as RestAuthConfig, aL as RestAuthConfigSchema, aM as RestServiceDef, aN as RestServiceDefSchema, aO as SERVICE_TYPES, aP as SemanticAssetRef, aQ as SemanticAssetRefInput, aR as SemanticAssetRefSchema, aS as ServiceDefinition, aT as ServiceDefinitionSchema, aU as ServiceParams, aV as ServiceParamsValue, aW as ServiceRef, aX as ServiceRefObject, aY as ServiceRefObjectSchema, aZ as ServiceRefSchema, a_ as ServiceRefStringSchema, a$ as ServiceType, b0 as ServiceTypeSchema, b1 as SetEffect, b2 as SocketEvents, b3 as SocketEventsSchema, b4 as SocketServiceDef, b5 as SocketServiceDefSchema, b6 as SpawnEffect, b8 as StateInput, b9 as StateMachine, ba as StateMachineInput, bb as StateMachineSchema, bc as StateSchema, bd as SwapEffect, be as TrainConfig, bf as TrainEffect, bg as Trait, bh as TraitCategory, bi as TraitCategorySchema, bj as TraitConfig, bk as TraitConfigObject, bl as TraitConfigSchema, bm as TraitConfigValue, bn as TraitConfigValueSchema, bo as TraitDataEntity, bp as TraitDataEntitySchema, bq as TraitEntityField, br as TraitEntityFieldSchema, bs as TraitEventContract, bt as TraitEventContractSchema, bu as TraitEventListener, bv as TraitEventListenerSchema, bw as TraitInput, bx as TraitRef, by as TraitRefSchema, bz as TraitReference, bA as TraitReferenceInput, bB as TraitReferenceSchema, bC as TraitSchema, bD as TraitTick, bE as TraitTickSchema, bF as TraitUIBinding, bG as Transition, bH as TransitionInput, bI as TransitionSchema, bJ as TypedEffect, bK as UISlot, bL as UISlotSchema, bM as UI_SLOTS, bN as VISUAL_STYLES, bO as VisualStyle, bP as VisualStyleSchema, bQ as WatchEffect, bR as WatchOptions, bS as atomic, bT as callService, bU as createAssetKey, bV as deref, bW as deriveCollection, bX as despawn, bY as doEffects, bZ as emit, b_ as findService, b$ as getDefaultAnimationsForRole, c0 as getServiceNames, c1 as getTraitConfig, c2 as getTraitName, c3 as hasService, c4 as isCircuitEvent, c5 as isEffect, c6 as isInlineTrait, c7 as isMcpService, c8 as isRestService, c9 as isRuntimeEntity, ca as isSExprEffect, cb as isServiceReference, cc as isServiceReferenceObject, cd as isSingletonEntity, ce as isSocketService, cf as navigate, cg as normalizeTraitRef, ch as notify, ci as parseAssetKey, cj as parseServiceRef, ck as persist, cl as ref, cm as renderUI, cn as set, co as spawn, cp as swap, cq as validateAssetAnimations, cr as watch } from './trait-D1kGh81D.js';
1
+ import { a3 as OrbitalSchema, X as OrbitalDefinition } from './schema-oigeZDco.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, u as DomainContext, 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, T as FullOrbitalUnit, P as GameSubCategory, Q as GameSubCategorySchema, R as NodeClassification, S as NodeClassificationSchema, T as Orbital, U as OrbitalConfig, V as OrbitalConfigInput, W as OrbitalConfigSchema, 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, aa as Page, 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-oigeZDco.js';
3
+ import { b7 as State } from './trait-Dh8USts-.js';
4
+ export { A as AgentEffect, a as AnimationDef, b as AnimationDefInput, c as AnimationDefSchema, d as AssetMap, e as AssetMapInput, f as AssetMapSchema, g as AssetMapping, h as AssetMappingInput, i as AssetMappingSchema, j as AtomicEffect, C as CallServiceConfig, k as CallServiceEffect, l as CheckpointLoadEffect, m as CheckpointSaveEffect, n as ConfigFieldDeclaration, o as ConfigFieldDeclarationSchema, D as DeclaredTraitConfig, p as DeclaredTraitConfigSchema, q as DerefEffect, r as DespawnEffect, s as DoEffect, E as ENTITY_ROLES, t as Effect, u as EffectInput, v as EffectSchema, w as EmitConfig, x as EmitEffect, y as Entity, z as EntityData, B as EntityField, F as EntityFieldInput, G as EntityFieldSchema, H as EntityPersistence, I as EntityPersistenceSchema, J as EntityRole, K as EntityRoleSchema, L as EntityRow, M as EntitySchema, N as EvaluateConfig, O as EvaluateEffect, P as Event, Q as EventInput, R as EventPayloadField, S as EventPayloadFieldSchema, T as EventSchema, U as EventScope, V as EventScopeSchema, W as FetchEffect, X as FetchOptions, Y as FetchResult, Z as Field, _ as FieldFormat, $ as FieldFormatSchema, a0 as FieldSchema, a1 as FieldType, a2 as FieldTypeSchema, a3 as FieldValue, a4 as ForwardConfig, a5 as ForwardEffect, a6 as GAME_TYPES, a7 as GameType, a8 as GameTypeSchema, a9 as Guard, aa as GuardInput, ab as GuardSchema, ac as ListenSource, ad as ListenSourceSchema, ae as LogEffect, af as McpServiceDef, ag as McpServiceDefSchema, ah as NavigateEffect, ai as NnConfig, aj as NnLayer, ak as NotifyEffect, al as OrbitalEntity, am as OrbitalEntityInput, an as OrbitalEntitySchema, ao as OrbitalTraitRef, ap as OrbitalTraitRefSchema, aq as OsEffect, ar as PayloadField, as as PayloadFieldSchema, at as PersistData, au as PersistEffect, av as PersistEmitConfig, aw as PresentationType, ax as RefEffect, ay as RelationConfig, az as RelationConfigSchema, aA as RenderItemLambda, aB as RenderUIConfig, aC as RenderUIEffect, aD as RenderUINode, aE as RequiredField, aF as RequiredFieldSchema, aG as ResolvedAsset, aH as ResolvedAssetInput, aI as ResolvedAssetSchema, aJ as ResolvedPatternProps, aK as RestAuthConfig, aL as RestAuthConfigSchema, aM as RestServiceDef, aN as RestServiceDefSchema, aO as SERVICE_TYPES, aP as SemanticAssetRef, aQ as SemanticAssetRefInput, aR as SemanticAssetRefSchema, aS as ServiceDefinition, aT as ServiceDefinitionSchema, aU as ServiceParams, aV as ServiceParamsValue, aW as ServiceRef, aX as ServiceRefObject, aY as ServiceRefObjectSchema, aZ as ServiceRefSchema, a_ as ServiceRefStringSchema, a$ as ServiceType, b0 as ServiceTypeSchema, b1 as SetEffect, b2 as SocketEvents, b3 as SocketEventsSchema, b4 as SocketServiceDef, b5 as SocketServiceDefSchema, b6 as SpawnEffect, b8 as StateInput, b9 as StateMachine, ba as StateMachineInput, bb as StateMachineSchema, bc as StateSchema, bd as SwapEffect, be as TrainConfig, bf as TrainEffect, bg as Trait, bh as TraitCategory, bi as TraitCategorySchema, bj as TraitConfig, bk as TraitConfigObject, bl as TraitConfigSchema, bm as TraitConfigValue, bn as TraitConfigValueSchema, bo as TraitDataEntity, bp as TraitDataEntitySchema, bq as TraitEntityField, br as TraitEntityFieldSchema, bs as TraitEventContract, bt as TraitEventContractSchema, bu as TraitEventListener, bv as TraitEventListenerSchema, bw as TraitInput, bx as TraitRef, by as TraitRefSchema, bz as TraitReference, bA as TraitReferenceInput, bB as TraitReferenceSchema, bC as TraitSchema, bD as TraitTick, bE as TraitTickSchema, bF as TraitUIBinding, bG as Transition, bH as TransitionInput, bI as TransitionSchema, bJ as TypedEffect, bK as UISlot, bL as UISlotSchema, bM as UI_SLOTS, bN as VISUAL_STYLES, bO as VisualStyle, bP as VisualStyleSchema, bQ as WatchEffect, bR as WatchOptions, bS as atomic, bT as callService, bU as createAssetKey, bV as deref, bW as deriveCollection, bX as despawn, bY as doEffects, bZ as emit, b_ as findService, b$ as getDefaultAnimationsForRole, c0 as getServiceNames, c1 as getTraitConfig, c2 as getTraitName, c3 as hasService, c4 as isCircuitEvent, c5 as isEffect, c6 as isInlineTrait, c7 as isMcpService, c8 as isRestService, c9 as isRuntimeEntity, ca as isSExprEffect, cb as isServiceReference, cc as isServiceReferenceObject, cd as isSingletonEntity, ce as isSocketService, cf as navigate, cg as normalizeTraitRef, ch as notify, ci as parseAssetKey, cj as parseServiceRef, ck as persist, cl as ref, cm as renderUI, cn as set, co as spawn, cp as swap, cq as validateAssetAnimations, cr as watch } from './trait-Dh8USts-.js';
5
5
  export { C as CORE_BINDINGS, a as CoreBinding, E as EvalContext, b as EventPayload, c as EventPayloadValue, d as Expression, e as ExpressionInput, f as ExpressionSchema, L as LogMeta, P as ParsedBinding, S as SExpr, 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';
6
6
  import { ResolvedIR, ResolvedEntity, ResolvedPage, ResolvedTrait, ChangesetValue, SchemaChange, CategorizedRemovals, PageContentReduction, SemanticSchemaChange } from './types/index.js';
7
7
  export { AgentCodeSearchResult, AgentCompactResult, AgentCompactStrategy, AgentContext, AgentGenerateOptions, AgentMemoryCategory, AgentMemoryRecord, AppSummary, AssetLoadStatus, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingContext, BindingRoot, BindingSchema, BridgeHealth, BusEvent, BusEventListener, BusEventSource, ChangeAuthor, ChangeSetDocument, ChangeSummary, CheckStatus, ContextExtensions, CreateFlow, DEFAULT_INTERACTION_MODELS, DeleteFlow, EditFlow, EffectTrace, EventEmit, EventKey, EventListen, EventLogEntry, GitHubLink, HistoryMeta, InteractionModel, InteractionModelInput, InteractionModelSchema, LazyService, ListInteraction, OrbitalVerificationAPI, PatternTypeSchema, PersistActionName, ResolvedEntityBinding, ResolvedField, ResolvedNavigation, ResolvedPattern, ResolvedSection, ResolvedSectionEvent, ResolvedTraitBinding, ResolvedTraitDataEntity, ResolvedTraitEvent, ResolvedTraitGuard, ResolvedTraitListener, ResolvedTraitState, ResolvedTraitTick, ResolvedTraitTransition, ResolvedTraitUIBinding, SaveOptions, SaveResult, SemanticChangeKind, ServerResponseTrace, ServiceAction, ServiceActionName, ServiceContract, ServiceEvents, SnapshotDocument, StatsView, StoreContract, StoreFilter, StoreFilterOp, TraitFieldRef, TraitFieldRefSchema, TraitStateSnapshot, TransitionFrom, TransitionTrace, Unsubscribe, ValidationDocument, ValidationIssue, ValidationMeta, ValidationResults, VerificationCheck, VerificationSnapshot, VerificationSummary, ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isResolvedIR, isTraitFieldRef, toBindingRoot, validateBindingInContext } from './types/index.js';
8
- export { CallSiteDiff, FactoryCallPlanMutation, FactoryCallPlanState, FactoryCallSite, FactoryCallSiteParams, FactoryConfigParam, FactoryEntitySignature, FactoryPageSignature, FactoryParamValue, FactorySignature, FactorySignatureCatalog, FactorySignatureEntityField, FactoryTraitSignature, JsonSchema, JsonSchemaType, JsonValue, OrbitalCallInput, OwnershipOverlayEntry, PresentationNavItem, PresentationOverlay, RuleOverlay, RuleOverlayEntry, SchemaFieldType, TraitOverlay, TraitOverlayEntry, TraitOverlayListener, TranslationBinding, TranslationResult, TranslationWarning, applyFactoryCallPlanMutation, diffFactoryCalls, translateOverlaysToParams } from './factory/index.js';
9
- 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-CzTKCtrh.js';
8
+ export { CallSiteDiff, DomainQuestion, DomainQuestionAnswer, DomainQuestionAnswers, DomainQuestionInputType, FactoryCallPlanMutation, FactoryCallPlanMutationTemplate, FactoryCallPlanState, FactoryCallSite, FactoryCallSiteParams, FactoryConfigParam, FactoryConfigTier, FactoryEntitySignature, FactoryPageSignature, FactoryParamValue, FactorySignature, FactorySignatureCatalog, FactorySignatureEntityField, FactoryTraitSignature, JsonSchema, JsonSchemaType, JsonValue, OrbitalCallInput, OwnershipOverlayEntry, PresentationNavItem, PresentationOverlay, RuleOverlay, RuleOverlayEntry, SchemaFieldType, TraitOverlay, TraitOverlayEntry, TraitOverlayListener, TranslationBinding, TranslationResult, TranslationWarning, answerToMutations, answersToMutations, applyFactoryCallPlanMutation, deriveInputType, diffFactoryCalls, generateQuestions, translateOverlaysToParams } from './factory/index.js';
9
+ 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-N7RCJVwH.js';
10
10
  export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
11
11
  export { BFSNode, BFSPathNode, EdgeWalkTransition, GraphTransition, GuardPayload, ReplayStep, ReplayTransition, StateEdge, WalkStep, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, collectReachableStates, extractPayloadFieldRef, walkStatePairs } from './state-machine/index.js';
12
12
  import 'zod';
package/dist/index.js CHANGED
@@ -112,11 +112,11 @@ var EntityFieldSchema = z.lazy(() => {
112
112
  type: z.literal("relation"),
113
113
  relation: RelationConfigSchema
114
114
  }),
115
- // Array variant — REQUIRES items schema.
115
+ // Array variant — items optional to match relaxed TS shape.
116
116
  z.object({
117
117
  ...baseFieldShape,
118
118
  type: z.literal("array"),
119
- items: EntityFieldSchema
119
+ items: EntityFieldSchema.optional()
120
120
  })
121
121
  ])
122
122
  );
@@ -2290,6 +2290,297 @@ function summarizeSchema(schema) {
2290
2290
  };
2291
2291
  }
2292
2292
 
2293
+ // src/factory/questions/generate.ts
2294
+ function generateQuestions(plan, catalog, ruleOverlay) {
2295
+ const out = [];
2296
+ const ruleCapabilities = collectRuleCapabilities(ruleOverlay);
2297
+ for (const call of plan) {
2298
+ const signature = findSignature(catalog, call.organism, call.orbital);
2299
+ if (!signature) continue;
2300
+ out.push(...configKeyQuestions(call, signature));
2301
+ out.push(...capabilityQuestions(call, signature, ruleCapabilities));
2302
+ }
2303
+ return out;
2304
+ }
2305
+ function configKeyQuestions(call, signature) {
2306
+ const out = [];
2307
+ for (const trait of signature.traits) {
2308
+ for (const param of trait.overridableConfigKeys) {
2309
+ if (param.tier === "internal") continue;
2310
+ if (isAlreadyCustomized(call, trait.name, param.key)) continue;
2311
+ out.push(buildConfigKeyQuestion(call, trait, param));
2312
+ }
2313
+ }
2314
+ return out;
2315
+ }
2316
+ function buildConfigKeyQuestion(call, trait, param) {
2317
+ const label = param.label ?? humanizeKey(param.key);
2318
+ const question = `${label}?`;
2319
+ const reason = param.description ?? `Customizes "${param.key}" on the ${trait.name} trait. ` + (param.default !== void 0 ? `Default: ${stringifyDefault(param.default)}.` : `No default \u2014 leave blank to inherit the factory's behavior.`);
2320
+ const out = {
2321
+ id: `${call.orbital}.${trait.name}.${param.key}`,
2322
+ orbitalName: call.orbital,
2323
+ question,
2324
+ reason,
2325
+ inputType: deriveInputType(param),
2326
+ mutationTemplate: {
2327
+ kind: "set-trait-override-config",
2328
+ orbitalName: call.orbital,
2329
+ traitName: trait.name,
2330
+ configKey: param.key
2331
+ }
2332
+ };
2333
+ if (param.default !== void 0) {
2334
+ out.defaultValue = param.default;
2335
+ }
2336
+ if (param.enumValues && param.enumValues.length > 0) {
2337
+ out.suggestedAnswers = param.enumValues;
2338
+ }
2339
+ if (param.items) {
2340
+ out.itemSchema = param.items;
2341
+ }
2342
+ if (param.properties) {
2343
+ out.objectSchema = param.properties;
2344
+ }
2345
+ if (param.tier) {
2346
+ out.tier = param.tier;
2347
+ }
2348
+ return out;
2349
+ }
2350
+ function isAlreadyCustomized(call, traitName, configKey) {
2351
+ const override = call.params.traitOverrides?.[traitName];
2352
+ if (!override?.config) return false;
2353
+ return Object.prototype.hasOwnProperty.call(override.config, configKey);
2354
+ }
2355
+ function deriveInputType(param) {
2356
+ if (param.type.startsWith("[")) {
2357
+ if (param.items?.properties && Object.keys(param.items.properties).length > 0) {
2358
+ return "listOfObjects";
2359
+ }
2360
+ if (param.enumValues && param.enumValues.length > 0) {
2361
+ return "multiselect";
2362
+ }
2363
+ return "tagList";
2364
+ }
2365
+ if (param.type === "object") {
2366
+ if (param.properties && Object.keys(param.properties).length > 0) {
2367
+ return "objectForm";
2368
+ }
2369
+ return "text";
2370
+ }
2371
+ switch (param.type) {
2372
+ case "number":
2373
+ case "integer":
2374
+ return "number";
2375
+ case "boolean":
2376
+ return "boolean";
2377
+ case "enum":
2378
+ return "enum";
2379
+ case "string":
2380
+ return param.enumValues && param.enumValues.length > 0 ? "enum" : "text";
2381
+ default:
2382
+ return "text";
2383
+ }
2384
+ }
2385
+ function humanizeKey(key) {
2386
+ const parts = key.replace(/[-_]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(" ").filter((s) => s.length > 0);
2387
+ return parts.map((p) => /^[A-Z]+$/.test(p) ? p : p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
2388
+ }
2389
+ function stringifyDefault(v) {
2390
+ if (typeof v === "string") return JSON.stringify(v);
2391
+ if (typeof v === "number" || typeof v === "boolean") return String(v);
2392
+ if (Array.isArray(v)) return `${v.length} item${v.length === 1 ? "" : "s"}`;
2393
+ return "object";
2394
+ }
2395
+ function capabilityQuestions(call, signature, ruleCapabilities) {
2396
+ const entityName = call.params.entityName ?? signature.entities[0]?.name ?? call.orbital;
2397
+ const seen = /* @__PURE__ */ new Set();
2398
+ const out = [];
2399
+ for (const trait of signature.traits) {
2400
+ for (const cap of trait.capabilities) {
2401
+ if (seen.has(cap)) continue;
2402
+ seen.add(cap);
2403
+ if (ruleCapabilities.has(cap)) continue;
2404
+ out.push({
2405
+ id: `${call.orbital}.capability.${cap}`,
2406
+ orbitalName: call.orbital,
2407
+ question: capabilityPrompt(cap, entityName),
2408
+ reason: capabilityReason(cap, trait),
2409
+ capability: cap,
2410
+ inputType: "capability",
2411
+ mutationTemplate: {
2412
+ kind: "set-rule",
2413
+ capability: cap,
2414
+ appliesTo: [entityName]
2415
+ },
2416
+ suggestedAnswers: ["yes", "skip"]
2417
+ });
2418
+ }
2419
+ }
2420
+ return out;
2421
+ }
2422
+ function capabilityPrompt(capability, entity) {
2423
+ return `Should "${capability}" apply to ${entity}?`;
2424
+ }
2425
+ function capabilityReason(capability, trait) {
2426
+ return `The "${trait.name}" trait advertises capability "${capability}". Answer "yes" to wire a matching rule into the schema.`;
2427
+ }
2428
+ function findSignature(catalog, organism, orbital) {
2429
+ return catalog.find((s) => s.organism === organism && s.orbital === orbital);
2430
+ }
2431
+ function collectRuleCapabilities(overlay) {
2432
+ const out = /* @__PURE__ */ new Set();
2433
+ for (const r of overlay?.rules ?? []) {
2434
+ if (typeof r.capability === "string") out.add(r.capability);
2435
+ }
2436
+ return out;
2437
+ }
2438
+
2439
+ // src/factory/questions/reducer.ts
2440
+ var PERSISTENCE_VALUES = [
2441
+ "persistent",
2442
+ "runtime",
2443
+ "singleton",
2444
+ "instance",
2445
+ "local"
2446
+ ];
2447
+ function answersToMutations(answers, questions) {
2448
+ const out = [];
2449
+ for (const q of questions) {
2450
+ const answer = answers[q.id];
2451
+ if (answer === void 0 || answer === null) continue;
2452
+ out.push(...answerToMutations(q.mutationTemplate, answer));
2453
+ }
2454
+ return out;
2455
+ }
2456
+ function answerToMutations(template, answer, _question) {
2457
+ switch (template.kind) {
2458
+ case "set-orbital-entity-name": {
2459
+ if (typeof answer !== "string" || answer.length === 0) return [];
2460
+ return [
2461
+ {
2462
+ kind: "set-orbital-entity-name",
2463
+ orbitalName: template.orbitalName,
2464
+ name: answer
2465
+ }
2466
+ ];
2467
+ }
2468
+ case "set-orbital-entity-fields": {
2469
+ if (!isEntityFieldArray(answer)) return [];
2470
+ if (answer.length === 0) return [];
2471
+ return [
2472
+ {
2473
+ kind: "set-orbital-entity-fields",
2474
+ orbitalName: template.orbitalName,
2475
+ fields: answer
2476
+ }
2477
+ ];
2478
+ }
2479
+ case "set-orbital-persistence": {
2480
+ if (!isPersistence(answer)) return [];
2481
+ return [
2482
+ {
2483
+ kind: "set-orbital-persistence",
2484
+ orbitalName: template.orbitalName,
2485
+ persistence: answer
2486
+ }
2487
+ ];
2488
+ }
2489
+ case "set-orbital-collection": {
2490
+ if (typeof answer !== "string" || answer.length === 0) return [];
2491
+ return [
2492
+ {
2493
+ kind: "set-orbital-collection",
2494
+ orbitalName: template.orbitalName,
2495
+ collection: answer
2496
+ }
2497
+ ];
2498
+ }
2499
+ case "set-orbital-page-path": {
2500
+ if (typeof answer !== "string" || answer.length === 0) return [];
2501
+ return [
2502
+ {
2503
+ kind: "set-orbital-page-path",
2504
+ orbitalName: template.orbitalName,
2505
+ pageName: template.pageName,
2506
+ path: answer
2507
+ }
2508
+ ];
2509
+ }
2510
+ case "set-trait-override-config": {
2511
+ if (!isFactoryParamValue(answer)) return [];
2512
+ return [
2513
+ {
2514
+ kind: "set-trait-override-config",
2515
+ orbitalName: template.orbitalName,
2516
+ traitName: template.traitName,
2517
+ key: template.configKey,
2518
+ value: answer
2519
+ }
2520
+ ];
2521
+ }
2522
+ case "add-extra-trait": {
2523
+ if (!isTraitReference(answer)) return [];
2524
+ return [
2525
+ {
2526
+ kind: "add-extra-trait",
2527
+ orbitalName: template.orbitalName,
2528
+ trait: answer
2529
+ }
2530
+ ];
2531
+ }
2532
+ case "remove-extra-trait": {
2533
+ if (typeof answer !== "string" || answer.length === 0) return [];
2534
+ return [
2535
+ {
2536
+ kind: "remove-extra-trait",
2537
+ orbitalName: template.orbitalName,
2538
+ ref: answer
2539
+ }
2540
+ ];
2541
+ }
2542
+ case "set-rule": {
2543
+ if (typeof answer !== "string") return [];
2544
+ if (answer !== "yes") return [];
2545
+ const rule = {
2546
+ id: `${template.capability}::${template.appliesTo.join(",")}`,
2547
+ capability: template.capability,
2548
+ description: `User accepted ${template.capability} for ${template.appliesTo.join(", ")}.`,
2549
+ appliesTo: template.appliesTo
2550
+ };
2551
+ return [{ kind: "set-rule", rule }];
2552
+ }
2553
+ case "remove-rule": {
2554
+ return [{ kind: "remove-rule", ruleId: template.ruleId }];
2555
+ }
2556
+ }
2557
+ }
2558
+ function isEntityFieldArray(a) {
2559
+ if (!Array.isArray(a)) return false;
2560
+ for (const x of a) {
2561
+ if (typeof x !== "object" || x === null) return false;
2562
+ if (!("name" in x) || !("type" in x)) return false;
2563
+ if (typeof x.name !== "string" || typeof x.type !== "string") return false;
2564
+ }
2565
+ return true;
2566
+ }
2567
+ function isPersistence(a) {
2568
+ return typeof a === "string" && PERSISTENCE_VALUES.includes(a);
2569
+ }
2570
+ function isFactoryParamValue(a) {
2571
+ if (a === null) return false;
2572
+ const t = typeof a;
2573
+ if (t === "string" || t === "number" || t === "boolean") return true;
2574
+ if (Array.isArray(a)) return true;
2575
+ if (t === "object") return true;
2576
+ return false;
2577
+ }
2578
+ function isTraitReference(a) {
2579
+ if (typeof a !== "object" || a === null || Array.isArray(a)) return false;
2580
+ if (!("ref" in a)) return false;
2581
+ return typeof a.ref === "string";
2582
+ }
2583
+
2293
2584
  // src/factory/translate.ts
2294
2585
  function translateOverlaysToParams(binding, signature, presentation, ruleOverlay, traitOverlay, catalog) {
2295
2586
  const warnings = [];
@@ -2437,8 +2728,9 @@ function mergeTraitOverride(traitName, entry, trait, params, warnings) {
2437
2728
  }
2438
2729
  function applyRuleOverlay(overlay, signature, binding, catalog, params, warnings) {
2439
2730
  if (!overlay) return;
2731
+ const matchableNames = collectMatchableEntityNames(signature, binding);
2440
2732
  for (const rule of overlay.rules) {
2441
- if (!ruleAppliesToBinding(rule, binding)) continue;
2733
+ if (!ruleAppliesToAnyName(rule, matchableNames)) continue;
2442
2734
  if (!catalog) {
2443
2735
  warnings.push({
2444
2736
  field: `ruleOverlay.rules.${rule.id}`,
@@ -2461,14 +2753,25 @@ function applyRuleOverlay(overlay, signature, binding, catalog, params, warnings
2461
2753
  }
2462
2754
  if (overlay.ownership) {
2463
2755
  for (const entry of overlay.ownership) {
2464
- if (entry.entity !== binding.entityName) continue;
2756
+ if (!matchableNames.includes(entry.entity)) continue;
2465
2757
  applyOwnership(entry, params, signature, catalog, warnings);
2466
2758
  }
2467
2759
  }
2468
2760
  }
2469
- function ruleAppliesToBinding(rule, binding) {
2761
+ function collectMatchableEntityNames(signature, binding) {
2762
+ const out = /* @__PURE__ */ new Set();
2763
+ if (binding.entityName.length > 0) out.add(binding.entityName);
2764
+ for (const ent of signature.entities) {
2765
+ if (typeof ent.name === "string" && ent.name.length > 0) out.add(ent.name);
2766
+ }
2767
+ return [...out];
2768
+ }
2769
+ function ruleAppliesToAnyName(rule, matchableNames) {
2470
2770
  if (rule.appliesTo.length === 0) return true;
2471
- return rule.appliesTo.includes(binding.entityName);
2771
+ for (const n of rule.appliesTo) {
2772
+ if (matchableNames.includes(n)) return true;
2773
+ }
2774
+ return false;
2472
2775
  }
2473
2776
  function findTraitByCapability(catalog, capability) {
2474
2777
  for (const sig of catalog) {
@@ -3283,6 +3586,6 @@ function buildPayloadForEdge(transition, guardCase) {
3283
3586
  return {};
3284
3587
  }
3285
3588
 
3286
- export { AGENT_DOMAIN_CATEGORIES, ALLOWED_CUSTOM_COMPONENTS, AgentDomainCategorySchema, AnimationDefSchema, AssetMapSchema, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingSchema, CORE_BINDINGS, ComputedEventContractSchema, ComputedEventListenerSchema, ConfigFieldDeclarationSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DeclaredTraitConfigSchema, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EffectSchema, EntityCallSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, ListenSourceSchema, 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, ServiceRefObjectSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SocketEventsSchema, SocketServiceDefSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SuggestedGuardSchema, ThemeDefinitionSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TraitCategorySchema, TraitConfigSchema, TraitConfigValueSchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitFieldRefSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, applyEventWiring, applyFactoryCallPlanMutation, atomic, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectReachableStates, composeBehaviors, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, deref, deriveCollection, despawn, detectLayoutStrategy, detectPageContentReduction, diffFactoryCalls, diffOrbitalSchemas, diffSchemaSemantics, diffSchemas, doEffects, emit, extractPayloadFieldRef, findService, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getEntity, getInteractionModelForDomain, getOperator, getPage, getPages, getRemovals, getSchemaCacheStats, getServiceNames, getTrait, getTraitConfig, getTraitName, hasService, hasSignificantPageReduction, inferTsType, isBinding, isCircuitEvent, isDestructiveChange, isEffect, isEntityCall, isEntityReference, isEntityReferenceAny, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isServiceReferenceObject, isSingletonEntity, isSocketService, isThemeReference, isTraitFieldRef, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, ref, renderUI, requiresConfirmation, safeParseOrbitalSchema, schemaToIR, set, sexpr, spawn, summarizeOrbital, summarizeSchema, swap, toBindingRoot, translateOverlaysToParams, validateAssetAnimations, validateBindingInContext, walkSExpr, walkStatePairs, watch };
3589
+ export { AGENT_DOMAIN_CATEGORIES, ALLOWED_CUSTOM_COMPONENTS, AgentDomainCategorySchema, AnimationDefSchema, AssetMapSchema, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingSchema, CORE_BINDINGS, ComputedEventContractSchema, ComputedEventListenerSchema, ConfigFieldDeclarationSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DeclaredTraitConfigSchema, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EffectSchema, EntityCallSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, ListenSourceSchema, 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, ServiceRefObjectSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SocketEventsSchema, SocketServiceDefSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SuggestedGuardSchema, ThemeDefinitionSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TraitCategorySchema, TraitConfigSchema, TraitConfigValueSchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitFieldRefSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, answerToMutations, answersToMutations, applyEventWiring, applyFactoryCallPlanMutation, atomic, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectReachableStates, composeBehaviors, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, deref, deriveCollection, deriveInputType, despawn, detectLayoutStrategy, detectPageContentReduction, diffFactoryCalls, diffOrbitalSchemas, diffSchemaSemantics, diffSchemas, doEffects, emit, extractPayloadFieldRef, findService, generateQuestions, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getEntity, getInteractionModelForDomain, getOperator, getPage, getPages, getRemovals, getSchemaCacheStats, getServiceNames, getTrait, getTraitConfig, getTraitName, hasService, hasSignificantPageReduction, inferTsType, isBinding, isCircuitEvent, isDestructiveChange, isEffect, isEntityCall, isEntityReference, isEntityReferenceAny, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isServiceReferenceObject, isSingletonEntity, isSocketService, isThemeReference, isTraitFieldRef, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, ref, renderUI, requiresConfirmation, safeParseOrbitalSchema, schemaToIR, set, sexpr, spawn, summarizeOrbital, summarizeSchema, swap, toBindingRoot, translateOverlaysToParams, validateAssetAnimations, validateBindingInContext, walkSExpr, walkStatePairs, watch };
3287
3590
  //# sourceMappingURL=index.js.map
3288
3591
  //# sourceMappingURL=index.js.map