@almadar/core 8.8.1 → 9.0.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.js CHANGED
@@ -869,19 +869,184 @@ var DesignPreferencesSchema = z.object({
869
869
  darkMode: z.boolean().optional(),
870
870
  uxHints: UXHintsSchema.optional()
871
871
  });
872
+ var SpacingScaleSchema = z.object({
873
+ space0: z.string().optional(),
874
+ space1: z.string().optional(),
875
+ space2: z.string().optional(),
876
+ space3: z.string().optional(),
877
+ space4: z.string().optional(),
878
+ space5: z.string().optional(),
879
+ space6: z.string().optional(),
880
+ space7: z.string().optional(),
881
+ space8: z.string().optional(),
882
+ space9: z.string().optional(),
883
+ space10: z.string().optional(),
884
+ space11: z.string().optional(),
885
+ space12: z.string().optional()
886
+ });
887
+ var DensityTokensSchema = z.object({
888
+ spacing: SpacingScaleSchema.optional(),
889
+ buttonHeightSm: z.string().optional(),
890
+ buttonHeightMd: z.string().optional(),
891
+ buttonHeightLg: z.string().optional(),
892
+ inputHeightSm: z.string().optional(),
893
+ inputHeightMd: z.string().optional(),
894
+ inputHeightLg: z.string().optional(),
895
+ rowHeightCompact: z.string().optional(),
896
+ rowHeightNormal: z.string().optional(),
897
+ rowHeightSpacious: z.string().optional(),
898
+ cardPaddingSm: z.string().optional(),
899
+ cardPaddingMd: z.string().optional(),
900
+ cardPaddingLg: z.string().optional(),
901
+ dialogPadding: z.string().optional(),
902
+ sectionGap: z.string().optional()
903
+ });
904
+ var TypeScaleEntrySchema = z.object({
905
+ size: z.string(),
906
+ lineHeight: z.string()
907
+ });
908
+ var TypeSlotSchema = z.enum(["display", "body", "mono"]);
909
+ var TypeSizeKeySchema = z.enum([
910
+ "xs",
911
+ "sm",
912
+ "base",
913
+ "lg",
914
+ "xl",
915
+ "2xl",
916
+ "3xl",
917
+ "4xl",
918
+ "display-1",
919
+ "display-2"
920
+ ]);
921
+ var TypeWeightSchema = z.enum(["normal", "medium", "bold"]);
922
+ var TypeIntentSchema = z.object({
923
+ slot: TypeSlotSchema,
924
+ size: TypeSizeKeySchema,
925
+ weight: TypeWeightSchema
926
+ });
927
+ var TypeScaleSchema = z.object({
928
+ xs: TypeScaleEntrySchema.optional(),
929
+ sm: TypeScaleEntrySchema.optional(),
930
+ base: TypeScaleEntrySchema.optional(),
931
+ lg: TypeScaleEntrySchema.optional(),
932
+ xl: TypeScaleEntrySchema.optional(),
933
+ "2xl": TypeScaleEntrySchema.optional(),
934
+ "3xl": TypeScaleEntrySchema.optional(),
935
+ "4xl": TypeScaleEntrySchema.optional(),
936
+ "display-1": TypeScaleEntrySchema.optional(),
937
+ "display-2": TypeScaleEntrySchema.optional()
938
+ });
939
+ var TypeIntentMapSchema = z.object({
940
+ headingMajor: TypeIntentSchema.optional(),
941
+ headingMinor: TypeIntentSchema.optional(),
942
+ bodyEmphasis: TypeIntentSchema.optional(),
943
+ bodyDefault: TypeIntentSchema.optional(),
944
+ bodyQuiet: TypeIntentSchema.optional(),
945
+ caption: TypeIntentSchema.optional(),
946
+ numeric: TypeIntentSchema.optional()
947
+ });
948
+ var TypeScaleTokensSchema = z.object({
949
+ displayFamily: z.string().optional(),
950
+ bodyFamily: z.string().optional(),
951
+ monoFamily: z.string().optional(),
952
+ scale: TypeScaleSchema.optional(),
953
+ intents: TypeIntentMapSchema.optional()
954
+ });
955
+ var MotionDurationKeySchema = z.enum([
956
+ "instant",
957
+ "fast",
958
+ "normal",
959
+ "slow",
960
+ "dramatic"
961
+ ]);
962
+ var MotionEasingKeySchema = z.enum([
963
+ "linear",
964
+ "standard",
965
+ "emphasized",
966
+ "spring"
967
+ ]);
968
+ var MotionIntentSchema = z.object({
969
+ duration: MotionDurationKeySchema,
970
+ easing: MotionEasingKeySchema
971
+ });
972
+ var MotionDurationPaletteSchema = z.object({
973
+ instant: z.string().optional(),
974
+ fast: z.string().optional(),
975
+ normal: z.string().optional(),
976
+ slow: z.string().optional(),
977
+ dramatic: z.string().optional()
978
+ });
979
+ var MotionEasingPaletteSchema = z.object({
980
+ linear: z.string().optional(),
981
+ standard: z.string().optional(),
982
+ emphasized: z.string().optional(),
983
+ spring: z.string().optional()
984
+ });
985
+ var MotionIntentMapSchema = z.object({
986
+ enter: MotionIntentSchema.optional(),
987
+ exit: MotionIntentSchema.optional(),
988
+ hover: MotionIntentSchema.optional(),
989
+ press: MotionIntentSchema.optional(),
990
+ expand: MotionIntentSchema.optional(),
991
+ transition: MotionIntentSchema.optional()
992
+ });
993
+ var MotionTokensSchema = z.object({
994
+ durations: MotionDurationPaletteSchema.optional(),
995
+ easings: MotionEasingPaletteSchema.optional(),
996
+ intents: MotionIntentMapSchema.optional()
997
+ });
998
+ var IconFamilySchema = z.enum([
999
+ "lucide",
1000
+ "phosphor-outline",
1001
+ "phosphor-fill",
1002
+ "phosphor-duotone",
1003
+ "tabler",
1004
+ "fa-solid"
1005
+ ]);
1006
+ var IconographyTokensSchema = z.object({
1007
+ family: IconFamilySchema.optional(),
1008
+ strokeWidth: z.string().optional(),
1009
+ defaultSize: z.string().optional()
1010
+ });
1011
+ var ElevationTokensSchema = z.object({
1012
+ cardElevation: z.string().optional(),
1013
+ popoverElevation: z.string().optional(),
1014
+ dialogElevation: z.string().optional(),
1015
+ toastElevation: z.string().optional()
1016
+ });
1017
+ var GeometryTokensSchema = z.object({
1018
+ radiusContainer: z.string().optional(),
1019
+ radiusInteractive: z.string().optional(),
1020
+ radiusPill: z.string().optional(),
1021
+ borderHairline: z.string().optional(),
1022
+ borderStandard: z.string().optional(),
1023
+ borderHeavy: z.string().optional()
1024
+ });
872
1025
  var ThemeTokensSchema = z.object({
873
1026
  colors: z.record(z.string(), z.string()).optional(),
874
1027
  radii: z.record(z.string(), z.string()).optional(),
875
1028
  spacing: z.record(z.string(), z.string()).optional(),
876
1029
  typography: z.record(z.string(), z.string()).optional(),
877
- shadows: z.record(z.string(), z.string()).optional()
1030
+ shadows: z.record(z.string(), z.string()).optional(),
1031
+ density: DensityTokensSchema.optional(),
1032
+ typeScale: TypeScaleTokensSchema.optional(),
1033
+ motion: MotionTokensSchema.optional(),
1034
+ iconography: IconographyTokensSchema.optional(),
1035
+ elevation: ElevationTokensSchema.optional(),
1036
+ geometry: GeometryTokensSchema.optional()
878
1037
  });
879
1038
  var ThemeVariantSchema = z.object({
880
1039
  colors: z.record(z.string(), z.string()).optional(),
881
1040
  radii: z.record(z.string(), z.string()).optional(),
882
1041
  spacing: z.record(z.string(), z.string()).optional(),
883
1042
  typography: z.record(z.string(), z.string()).optional(),
884
- shadows: z.record(z.string(), z.string()).optional()
1043
+ shadows: z.record(z.string(), z.string()).optional(),
1044
+ density: DensityTokensSchema.optional(),
1045
+ typeScale: TypeScaleTokensSchema.optional(),
1046
+ motion: MotionTokensSchema.optional(),
1047
+ iconography: IconographyTokensSchema.optional(),
1048
+ elevation: ElevationTokensSchema.optional(),
1049
+ geometry: GeometryTokensSchema.optional()
885
1050
  });
886
1051
  var ThemeDefinitionSchema = z.object({
887
1052
  name: z.string().min(1, "Theme name is required"),
@@ -2500,7 +2665,6 @@ function configKeyQuestions(call, signature) {
2500
2665
  if (TIER_D_TYPES.has(param.type)) continue;
2501
2666
  if (param.key.endsWith("Event")) continue;
2502
2667
  if (TIER_D_NAMED_PRIMITIVES.has(param.key)) continue;
2503
- if (isAlreadyCustomized(call, trait.name, param.key)) continue;
2504
2668
  out.push(buildConfigKeyQuestion(call, trait, param));
2505
2669
  }
2506
2670
  }
@@ -2509,7 +2673,9 @@ function configKeyQuestions(call, signature) {
2509
2673
  function buildConfigKeyQuestion(call, trait, param) {
2510
2674
  const label = param.label ?? humanizeKey(param.key);
2511
2675
  const question = `${label}?`;
2512
- 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.`);
2676
+ const callSiteOverride = callSiteOverrideValue(call, trait.name, param.key);
2677
+ const effectiveDefault = callSiteOverride !== void 0 ? callSiteOverride : param.default;
2678
+ const reason = param.description ?? `Customizes "${param.key}" on the ${trait.name} trait. ` + (effectiveDefault !== void 0 ? `Default: ${stringifyDefault(effectiveDefault)}.` : `No default \u2014 leave blank to inherit the factory's behavior.`);
2513
2679
  const out = {
2514
2680
  id: `${call.orbital}.${trait.name}.${param.key}`,
2515
2681
  orbitalName: call.orbital,
@@ -2523,8 +2689,8 @@ function buildConfigKeyQuestion(call, trait, param) {
2523
2689
  configKey: param.key
2524
2690
  }
2525
2691
  };
2526
- if (param.default !== void 0) {
2527
- out.defaultValue = param.default;
2692
+ if (effectiveDefault !== void 0) {
2693
+ out.defaultValue = effectiveDefault;
2528
2694
  }
2529
2695
  if (param.enumValues && param.enumValues.length > 0) {
2530
2696
  out.suggestedAnswers = param.enumValues;
@@ -2540,10 +2706,13 @@ function buildConfigKeyQuestion(call, trait, param) {
2540
2706
  }
2541
2707
  return out;
2542
2708
  }
2543
- function isAlreadyCustomized(call, traitName, configKey) {
2709
+ function callSiteOverrideValue(call, traitName, configKey) {
2544
2710
  const override = call.params.traitOverrides?.[traitName];
2545
- if (!override?.config) return false;
2546
- return Object.prototype.hasOwnProperty.call(override.config, configKey);
2711
+ if (!override?.config) return void 0;
2712
+ if (!Object.prototype.hasOwnProperty.call(override.config, configKey)) {
2713
+ return void 0;
2714
+ }
2715
+ return override.config[configKey];
2547
2716
  }
2548
2717
  function deriveInputType(param) {
2549
2718
  if (param.type.startsWith("[")) {
@@ -3779,6 +3948,6 @@ function buildPayloadForEdge(transition, guardCase) {
3779
3948
  return {};
3780
3949
  }
3781
3950
 
3782
- 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, KNOWN_VALIDATION_ERROR_CODES, 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, isJsonArray, isJsonObject, isJsonPrimitive, isKnownValidationErrorCode, 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 };
3951
+ 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, DensityTokensSchema, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EffectSchema, ElevationTokensSchema, EntityCallSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GameSubCategorySchema, GameTypeSchema, GeometryTokensSchema, GuardSchema, IconFamilySchema, IconographyTokensSchema, InteractionModelSchema, KNOWN_VALIDATION_ERROR_CODES, ListenSourceSchema, McpServiceDefSchema, MotionDurationKeySchema, MotionDurationPaletteSchema, MotionEasingKeySchema, MotionEasingPaletteSchema, MotionIntentMapSchema, MotionIntentSchema, MotionTokensSchema, 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, SpacingScaleSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SuggestedGuardSchema, ThemeDefinitionSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TraitCategorySchema, TraitConfigSchema, TraitConfigValueSchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitFieldRefSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, TypeIntentMapSchema, TypeIntentSchema, TypeScaleEntrySchema, TypeScaleSchema, TypeScaleTokensSchema, TypeSizeKeySchema, TypeSlotSchema, TypeWeightSchema, 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, isJsonArray, isJsonObject, isJsonPrimitive, isKnownValidationErrorCode, 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 };
3783
3952
  //# sourceMappingURL=index.js.map
3784
3953
  //# sourceMappingURL=index.js.map