@almadar/core 10.36.0 → 10.38.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.
@@ -160,13 +160,18 @@ function isJsonArray(value) {
160
160
  }
161
161
 
162
162
  // src/types/field.ts
163
- var FieldTypeSchema = z.enum([
163
+ var FIELD_TYPES = [
164
164
  "string",
165
165
  "number",
166
166
  "boolean",
167
167
  "date",
168
168
  "timestamp",
169
169
  "datetime",
170
+ "email",
171
+ "url",
172
+ "phone",
173
+ "uuid",
174
+ "image",
170
175
  "array",
171
176
  "object",
172
177
  "enum",
@@ -174,7 +179,12 @@ var FieldTypeSchema = z.enum([
174
179
  "trait",
175
180
  "slot",
176
181
  "pattern"
177
- ]);
182
+ ];
183
+ var SEMANTIC_STRING_TYPES = ["email", "url", "phone", "uuid", "image"];
184
+ function isSemanticStringType(type) {
185
+ return SEMANTIC_STRING_TYPES.includes(type);
186
+ }
187
+ var FieldTypeSchema = z.enum(FIELD_TYPES);
178
188
  var RelationCardinalitySchema = z.enum([
179
189
  "one",
180
190
  "many",
@@ -202,17 +212,35 @@ var RelationConfigSchema = z.object({
202
212
  };
203
213
  return normalized;
204
214
  });
205
- var FieldFormatSchema = z.enum([
206
- "email",
207
- "url",
208
- "phone",
209
- "date",
210
- "datetime",
211
- "uuid",
212
- "image",
213
- "avatar",
214
- "thumbnail"
215
- ]);
215
+ var EMAIL_RE = /^[^\s@]+@[^\s@.]+\.[^\s@]+$/;
216
+ var URL_RE = /^https?:\/\/[^\s]+$/;
217
+ var PHONE_RE = /^[+]?[\d\s().-]{7,}$/;
218
+ var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
219
+ function isEmailValue(value) {
220
+ return EMAIL_RE.test(value);
221
+ }
222
+ function isUrlValue(value) {
223
+ return URL_RE.test(value);
224
+ }
225
+ function isPhoneValue(value) {
226
+ return PHONE_RE.test(value);
227
+ }
228
+ function isUuidValue(value) {
229
+ return UUID_RE.test(value);
230
+ }
231
+ function isSemanticStringValue(type, value) {
232
+ switch (type) {
233
+ case "email":
234
+ return isEmailValue(value);
235
+ case "url":
236
+ case "image":
237
+ return isUrlValue(value);
238
+ case "phone":
239
+ return isPhoneValue(value);
240
+ case "uuid":
241
+ return isUuidValue(value);
242
+ }
243
+ }
216
244
  var FIELD_TYPE_ALIASES = {
217
245
  text: "string",
218
246
  int: "number",
@@ -224,7 +252,6 @@ var EntityFieldSchema = z.lazy(() => {
224
252
  name: z.string().min(1, "Field name is required").optional(),
225
253
  required: z.boolean().optional(),
226
254
  default: JsonValueSchema.optional(),
227
- format: FieldFormatSchema.optional(),
228
255
  min: z.number().optional(),
229
256
  max: z.number().optional(),
230
257
  properties: z.record(EntityFieldSchema).optional(),
@@ -261,6 +288,11 @@ var EntityFieldSchema = z.lazy(() => {
261
288
  scalarVariant("date"),
262
289
  scalarVariant("timestamp"),
263
290
  scalarVariant("datetime"),
291
+ scalarVariant("email"),
292
+ scalarVariant("url"),
293
+ scalarVariant("phone"),
294
+ scalarVariant("uuid"),
295
+ scalarVariant("image"),
264
296
  scalarVariant("trait"),
265
297
  scalarVariant("slot"),
266
298
  scalarVariant("pattern"),
@@ -760,6 +792,10 @@ var REFERENCE_CONFIG_TYPES = ["entity", "trait", "event"];
760
792
  function isReferenceConfigType(type) {
761
793
  return REFERENCE_CONFIG_TYPES.includes(type);
762
794
  }
795
+ var SECRET_CONFIG_TYPES = ["secret"];
796
+ function isSecretConfigType(type) {
797
+ return SECRET_CONFIG_TYPES.includes(type);
798
+ }
763
799
  var ConfigFieldItemsDeclarationSchema = z.lazy(
764
800
  () => z.object({
765
801
  type: z.string().optional(),
@@ -811,7 +847,12 @@ var TraitEntityFieldSchema = z.object({
811
847
  "object",
812
848
  "timestamp",
813
849
  "datetime",
814
- "enum"
850
+ "enum",
851
+ "email",
852
+ "url",
853
+ "phone",
854
+ "uuid",
855
+ "image"
815
856
  ]),
816
857
  required: z.boolean().optional(),
817
858
  default: TraitConfigValueSchema.optional(),
@@ -829,11 +870,20 @@ var TraitDataEntitySchema = z.object({
829
870
  singleton: z.boolean().optional(),
830
871
  pages: z.array(z.string()).optional()
831
872
  });
873
+ var DURATION_INTERVAL = /^\d+(ms|s|m|h|d)$/;
874
+ var CRON_INTERVAL = /^\S+(\s+\S+){4}$/;
875
+ var TickIntervalSchema = z.union([
876
+ z.literal("frame"),
877
+ z.number().positive(),
878
+ z.string().refine((v) => DURATION_INTERVAL.test(v) || CRON_INTERVAL.test(v), {
879
+ message: 'interval must be "frame", a positive number of milliseconds, a duration ("500ms"/"5s"/"1m"/"1h"/"1d"), or a 5-field cron expression ("0 9 * * *")'
880
+ })
881
+ ]);
832
882
  var TraitTickSchema = z.object({
833
883
  name: z.string().min(1),
834
884
  description: z.string().optional(),
835
885
  priority: z.number().optional(),
836
- interval: z.union([z.literal("frame"), z.number().positive()]),
886
+ interval: TickIntervalSchema,
837
887
  appliesTo: z.array(z.string()).optional(),
838
888
  pages: z.array(z.string()).optional(),
839
889
  pageIds: z.array(PageIdSchema).optional(),
@@ -927,7 +977,7 @@ var TraitEventListenerSchema = z.object({
927
977
  });
928
978
  var RequiredFieldSchema = z.object({
929
979
  name: z.string().min(1),
930
- type: z.enum(["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum"]),
980
+ type: z.enum(["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum", "email", "url", "phone", "uuid", "image"]),
931
981
  description: z.string().optional()
932
982
  });
933
983
  var TraitReferenceSchema = z.object({
@@ -2179,6 +2229,9 @@ var PATTERN_TYPES = [
2179
2229
  "hero-section",
2180
2230
  "hstack",
2181
2231
  "icon",
2232
+ "import-preview-tree",
2233
+ "import-progress",
2234
+ "import-source-picker",
2182
2235
  "infinite-scroll-sentinel",
2183
2236
  "input",
2184
2237
  "input-group",
@@ -2605,6 +2658,6 @@ function widenTier(tier) {
2605
2658
  return tier;
2606
2659
  }
2607
2660
 
2608
- export { AGENT_DOMAIN_CATEGORIES, ALLOWED_CUSTOM_COMPONENTS, ANIMATION_NAMES, ANONYMOUS_USER, ASSET_ASPECTS, ASSET_DIMENSIONS, AgentDomainCategorySchema, AnimationDefSchema, AnimationNameSchema, AssetAspectSchema, AssetCatalogEntrySchema, AssetCatalogSchema, AssetDimensionSchema, AssetSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingSchema, CAMERA_MODES, CONFIG_REF_EVENT_PATTERN, CORE_BINDINGS, CameraModeSchema, CameraSchema, ColorSliceSchema, ColorTokensSchema, ComputedEventContractSchema, ComputedEventListenerSchema, ConfigFieldDeclarationSchema, ConfigProvenanceRecordSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DEV_TOKEN_PREFIX, DeclaredTraitConfigSchema, DensitySliceSchema, DensityTokensSchema, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EffectSchema, ElevationSliceSchema, ElevationTokensSchema, EntityCallSchema, EntityFieldContractSchema, EntityFieldSchema, EntityIdSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventIdSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FieldFormatSchema, FieldSchema, FieldTypeSchema, GameSubCategorySchema, GeometrySliceSchema, GeometryTokensSchema, GuardSchema, IconFamilySchema, IconographySliceSchema, IconographyTokensSchema, IdentityLedgerSchema, IllustrationSliceSchema, IllustrationStyleSchema, IllustrationTokensSchema, InteractionModelSchema, KNOWN_VALIDATION_ERROR_CODES, LedgerEntrySchema, LedgerKindSchema, ListenSourceSchema, MOCK_PERSONAS, McpServiceDefSchema, MotionDurationKeySchema, MotionDurationPaletteSchema, MotionEasingKeySchema, MotionEasingPaletteSchema, MotionIntentMapSchema, MotionIntentSchema, MotionSliceSchema, MotionTokensSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalIdSchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PATTERN_TYPES, PageIdSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PaletteEntryIdSchema, PatternTypeSchema, PayloadFieldSchema, REFERENCE_CONFIG_TYPES, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, RestAuthConfigSchema, RestServiceDefSchema, SERVICE_TYPES, SExprAtomSchema, SExprSchema, SPRITE_DIRECTIONS, ScenePosSchema, SchemaMetadataSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceIdSchema, ServiceRefObjectSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SkinSpecSchema, SocketEventsSchema, SocketServiceDefSchema, SpacingScaleSchema, SpriteDirectionSchema, SpriteSheetAtlasSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SubTextureSchema, SuggestedGuardSchema, TextureAtlasSchema, ThemeDefinitionSchema, ThemeIdSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TilesheetSchema, TraitCategorySchema, TraitConfigSchema, TraitConfigValueSchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitFieldRefSchema, TraitIdSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, TypeIntentMapSchema, TypeIntentSchema, TypeScaleEntrySchema, TypeScaleSchema, TypeScaleTokensSchema, TypeSizeKeySchema, TypeSliceSchema, TypeSlotSchema, TypeWeightSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, asEntityId, asEventId, asOrbitalId, asPageId, asPaletteEntryId, asServiceId, asThemeId, asTraitId, atomic, callService, collectBindings, configRefEventKnob, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, decodeDevIdentityToken, deref, deriveCollection, despawn, doEffects, emit, encodeDevIdentityToken, findMockPersona, findService, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, idKindOf, idPrefix, inferTsType, isBinding, isCallSiteConfigDeclaration, isCircuitEvent, isEffect, isEntityCall, isEntityId, isEntityReference, isEntityReferenceAny, isEventId, isEventPayloadValue, isFieldValue, isImportedTraitRef, isInlineTrait, isJsonArray, isJsonObject, isJsonPrimitive, isKnownValidationErrorCode, isMcpService, isOrbitalDefinition, isOrbitalId, isPageId, isPageReference, isPageReferenceObject, isPageReferenceString, isPaletteEntryId, isPlanSnapshot, isReferenceConfigType, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceId, isServiceReference, isServiceReferenceObject, isSessionHistoryEntry, isSocketService, isThemeId, isThemeReference, isTraitFieldRef, isTraitId, isValidBinding, isValidPatternType, ledgerCurName, ledgerRename, ledgerResolveName, mintId, navigate, normalizeCallSiteConfigToValues, normalizeTraitRef, normalizeUserContext, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, persistenceModeAllowsOverrides, ref, renderUI, resolveConfigRefEventName, resolvePersonaSpec, safeParseOrbitalSchema, set, sexpr, spawn, swap, toBindingRoot, validateAssetAnimations, validateBindingInContext, walkSExpr, watch, widenTier };
2661
+ export { AGENT_DOMAIN_CATEGORIES, ALLOWED_CUSTOM_COMPONENTS, ANIMATION_NAMES, ANONYMOUS_USER, ASSET_ASPECTS, ASSET_DIMENSIONS, AgentDomainCategorySchema, AnimationDefSchema, AnimationNameSchema, AssetAspectSchema, AssetCatalogEntrySchema, AssetCatalogSchema, AssetDimensionSchema, AssetSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingSchema, CAMERA_MODES, CONFIG_REF_EVENT_PATTERN, CORE_BINDINGS, CameraModeSchema, CameraSchema, ColorSliceSchema, ColorTokensSchema, ComputedEventContractSchema, ComputedEventListenerSchema, ConfigFieldDeclarationSchema, ConfigProvenanceRecordSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DEV_TOKEN_PREFIX, DeclaredTraitConfigSchema, DensitySliceSchema, DensityTokensSchema, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EffectSchema, ElevationSliceSchema, ElevationTokensSchema, EntityCallSchema, EntityFieldContractSchema, EntityFieldSchema, EntityIdSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventIdSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FIELD_TYPES, FieldSchema, FieldTypeSchema, GameSubCategorySchema, GeometrySliceSchema, GeometryTokensSchema, GuardSchema, IconFamilySchema, IconographySliceSchema, IconographyTokensSchema, IdentityLedgerSchema, IllustrationSliceSchema, IllustrationStyleSchema, IllustrationTokensSchema, InteractionModelSchema, KNOWN_VALIDATION_ERROR_CODES, LedgerEntrySchema, LedgerKindSchema, ListenSourceSchema, MOCK_PERSONAS, McpServiceDefSchema, MotionDurationKeySchema, MotionDurationPaletteSchema, MotionEasingKeySchema, MotionEasingPaletteSchema, MotionIntentMapSchema, MotionIntentSchema, MotionSliceSchema, MotionTokensSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalIdSchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PATTERN_TYPES, PageIdSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PaletteEntryIdSchema, PatternTypeSchema, PayloadFieldSchema, REFERENCE_CONFIG_TYPES, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, RestAuthConfigSchema, RestServiceDefSchema, SECRET_CONFIG_TYPES, SEMANTIC_STRING_TYPES, SERVICE_TYPES, SExprAtomSchema, SExprSchema, SPRITE_DIRECTIONS, ScenePosSchema, SchemaMetadataSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceIdSchema, ServiceRefObjectSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SkinSpecSchema, SocketEventsSchema, SocketServiceDefSchema, SpacingScaleSchema, SpriteDirectionSchema, SpriteSheetAtlasSchema, StateMachineSchema, StateSchema, StateSemanticRoleSchema, SubTextureSchema, SuggestedGuardSchema, TextureAtlasSchema, ThemeDefinitionSchema, ThemeIdSchema, ThemeRefSchema, ThemeRefStringSchema, ThemeTokensSchema, ThemeVariantSchema, TickIntervalSchema, TilesheetSchema, TraitCategorySchema, TraitConfigSchema, TraitConfigValueSchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitFieldRefSchema, TraitIdSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, TypeIntentMapSchema, TypeIntentSchema, TypeScaleEntrySchema, TypeScaleSchema, TypeScaleTokensSchema, TypeSizeKeySchema, TypeSliceSchema, TypeSlotSchema, TypeWeightSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, asEntityId, asEventId, asOrbitalId, asPageId, asPaletteEntryId, asServiceId, asThemeId, asTraitId, atomic, callService, collectBindings, configRefEventKnob, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, decodeDevIdentityToken, deref, deriveCollection, despawn, doEffects, emit, encodeDevIdentityToken, findMockPersona, findService, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, idKindOf, idPrefix, inferTsType, isBinding, isCallSiteConfigDeclaration, isCircuitEvent, isEffect, isEmailValue, isEntityCall, isEntityId, isEntityReference, isEntityReferenceAny, isEventId, isEventPayloadValue, isFieldValue, isImportedTraitRef, isInlineTrait, isJsonArray, isJsonObject, isJsonPrimitive, isKnownValidationErrorCode, isMcpService, isOrbitalDefinition, isOrbitalId, isPageId, isPageReference, isPageReferenceObject, isPageReferenceString, isPaletteEntryId, isPhoneValue, isPlanSnapshot, isReferenceConfigType, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isSecretConfigType, isSemanticStringType, isSemanticStringValue, isServiceId, isServiceReference, isServiceReferenceObject, isSessionHistoryEntry, isSocketService, isThemeId, isThemeReference, isTraitFieldRef, isTraitId, isUrlValue, isUuidValue, isValidBinding, isValidPatternType, ledgerCurName, ledgerRename, ledgerResolveName, mintId, navigate, normalizeCallSiteConfigToValues, normalizeTraitRef, normalizeUserContext, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, persistenceModeAllowsOverrides, ref, renderUI, resolveConfigRefEventName, resolvePersonaSpec, safeParseOrbitalSchema, set, sexpr, spawn, swap, toBindingRoot, validateAssetAnimations, validateBindingInContext, walkSExpr, watch, widenTier };
2609
2662
  //# sourceMappingURL=index.js.map
2610
2663
  //# sourceMappingURL=index.js.map