@almadar/core 4.4.2 → 4.6.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 +47 -3
- package/dist/builders.js +159 -27
- package/dist/builders.js.map +1 -1
- package/dist/{compose-behaviors-Da0YDcli.d.ts → compose-behaviors-Bp32KayC.d.ts} +1 -1
- package/dist/domain-language/index.d.ts +1 -1
- package/dist/domain-language/index.js +57 -26
- package/dist/domain-language/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +60 -26
- package/dist/index.js.map +1 -1
- package/dist/{schema-B0Yin-RM.d.ts → schema-CLFPg1xW.d.ts} +98 -47
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +57 -26
- package/dist/types/index.js.map +1 -1
- package/package.json +6 -6
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AGENT_DOMAIN_CATEGORIES,
|
|
1
|
+
import { c as EntityRow, aL as FieldValue, bS as SExpr } from '../schema-CLFPg1xW.js';
|
|
2
|
+
export { A as AGENT_DOMAIN_CATEGORIES, g as ALLOWED_CUSTOM_COMPONENTS, h as AgentDomainCategory, i as AgentDomainCategorySchema, j as AgentEffect, k as AllowedCustomComponent, l as AnimationDef, m as AnimationDefInput, n as AnimationDefSchema, d as AppSchema, o as AssetMap, p as AssetMapInput, q as AssetMapSchema, r as AssetMapping, s as AssetMappingInput, t as AssetMappingSchema, u as AtomicEffect, C as CORE_BINDINGS, v as CallServiceConfig, w as CallServiceEffect, x as ComputedEventContract, y as ComputedEventContractSchema, z as ComputedEventListener, B as ComputedEventListenerSchema, D as CoreBinding, F as CustomPatternDefinition, G as CustomPatternDefinitionInput, H as CustomPatternDefinitionSchema, I as CustomPatternMap, J as CustomPatternMapInput, K as CustomPatternMapSchema, L as DerefEffect, M as DesignPreferences, N as DesignPreferencesInput, Q as DesignPreferencesSchema, R as DesignTokens, U as DesignTokensInput, V as DesignTokensSchema, W as DespawnEffect, X as DoEffect, Y as DomainCategory, Z as DomainCategorySchema, _ as DomainContext, $ as DomainContextInput, a0 as DomainContextSchema, a1 as DomainVocabulary, a2 as DomainVocabularySchema, a3 as ENTITY_ROLES, a4 as Effect, a5 as EffectInput, a6 as EffectSchema, a7 as EmitEffect, f as Entity, a8 as EntityCall, a9 as EntityCallSchema, aa as EntityData, E as EntityField, ab as EntityFieldInput, ac as EntityFieldSchema, b as EntityPersistence, ad as EntityPersistenceSchema, ae as EntityRef, af as EntityRefSchema, ag as EntityRefStringSchema, ah as EntityRole, ai as EntityRoleSchema, aj as EntitySchema, ak as EntitySemanticRole, al as EntitySemanticRoleSchema, am as EvalContext, an as Event, ao as EventInput, ap as EventListener, aq as EventListenerSchema, ar as EventPayload, as as EventPayloadField, at as EventPayloadFieldSchema, au as EventSchema, av as EventScope, aw as EventScopeSchema, ax as EventSemanticRole, ay as EventSemanticRoleSchema, az as EventSource, aA as EventSourceSchema, aB as Expression, aC as ExpressionInput, aD as ExpressionSchema, aE as FetchEffect, aF as Field, aG as FieldFormat, aH as FieldFormatSchema, aI as FieldSchema, aJ as FieldType, aK as FieldTypeSchema, aM as FullOrbitalUnit, aN as GAME_TYPES, aO as GameSubCategory, aP as GameSubCategorySchema, aQ as GameType, aR as GameTypeSchema, aS as Guard, aT as GuardInput, aU as GuardSchema, aV as LogEffect, aW as LogMeta, aX as McpServiceDef, aY as McpServiceDefSchema, aZ as NavigateEffect, a_ as NodeClassification, a$ as NodeClassificationSchema, b0 as NotifyEffect, aM as Orbital, b1 as OrbitalConfig, b2 as OrbitalConfigInput, b3 as OrbitalConfigSchema, O as OrbitalDefinition, b4 as OrbitalDefinitionSchema, b5 as OrbitalEntity, b6 as OrbitalEntityInput, b7 as OrbitalEntitySchema, b8 as OrbitalInput, b9 as OrbitalPage, ba as OrbitalPageInput, bb as OrbitalPageSchema, bc as OrbitalPageStrictInput, bd as OrbitalPageStrictSchema, d as OrbitalSchema, be as OrbitalSchemaInput, bf as OrbitalSchemaSchema, bg as OrbitalTraitRef, bh as OrbitalTraitRefSchema, bi as OrbitalUnit, bj as OrbitalUnitSchema, bk as OrbitalZodSchema, P as Page, bl as PageRef, bm as PageRefObject, bn as PageRefObjectSchema, bo as PageRefSchema, bp as PageRefStringSchema, bq as PageSchema, br as PageTraitRef, bs as PageTraitRefSchema, bt as ParsedBinding, bu as PayloadField, bv as PayloadFieldSchema, bw as PersistEffect, bx as PresentationType, by as RefEffect, bz as RelatedLink, bA as RelatedLinkSchema, bB as RelationConfig, bC as RelationConfigSchema, bD as RenderItemLambda, bE as RenderUIConfig, bF as RenderUIEffect, bG as RenderUINode, bH as RequiredField, bI as RequiredFieldSchema, bJ as ResolvedAsset, bK as ResolvedAssetInput, bL as ResolvedAssetSchema, bM as ResolvedPatternProps, bN as RestAuthConfig, bO as RestAuthConfigSchema, bP as RestServiceDef, bQ as RestServiceDefSchema, bR as SERVICE_TYPES, bT as SExprAtom, bU as SExprAtomSchema, bV as SExprInput, bW as SExprSchema, bX as SemanticAssetRef, bY as SemanticAssetRefInput, bZ as SemanticAssetRefSchema, b_ as ServiceDefinition, b$ as ServiceDefinitionSchema, c0 as ServiceParams, c1 as ServiceRef, c2 as ServiceRefObject, c3 as ServiceRefObjectSchema, c4 as ServiceRefSchema, c5 as ServiceRefStringSchema, c6 as ServiceType, c7 as ServiceTypeSchema, c8 as SetEffect, c9 as SocketEvents, ca as SocketEventsSchema, cb as SocketServiceDef, cc as SocketServiceDefSchema, cd as SpawnEffect, S as State, ce as StateInput, cf as StateMachine, cg as StateMachineInput, ch as StateMachineSchema, ci as StateSchema, cj as StateSemanticRole, ck as StateSemanticRoleSchema, cl as SuggestedGuard, cm as SuggestedGuardSchema, cn as SwapEffect, co as ThemeDefinition, cp as ThemeDefinitionSchema, cq as ThemeRef, cr as ThemeRefSchema, cs as ThemeRefStringSchema, ct as ThemeTokens, cu as ThemeTokensSchema, cv as ThemeVariant, cw as ThemeVariantSchema, e as Trait, cx as TraitCategory, cy as TraitCategorySchema, cz as TraitDataEntity, cA as TraitDataEntitySchema, cB as TraitEntityField, cC as TraitEntityFieldSchema, a as TraitEventContract, cD as TraitEventContractSchema, cE as TraitEventListener, cF as TraitEventListenerSchema, cG as TraitInput, cH as TraitRef, cI as TraitRefSchema, T as TraitReference, cJ as TraitReferenceInput, cK as TraitReferenceSchema, cL as TraitSchema, cM as TraitTick, cN as TraitTickSchema, cO as TraitUIBinding, cP as Transition, cQ as TransitionInput, cR as TransitionSchema, cS as TypedEffect, cT as UISlot, cU as UISlotSchema, cV as UI_SLOTS, cW as UXHints, cX as UXHintsSchema, cY as UseDeclaration, cZ as UseDeclarationSchema, c_ as UserPersona, c$ as UserPersonaInput, d0 as UserPersonaSchema, d1 as VISUAL_STYLES, d2 as ViewType, d3 as ViewTypeSchema, d4 as VisualStyle, d5 as VisualStyleSchema, d6 as WatchEffect, d7 as WatchOptions, d8 as atomic, d9 as callService, da as collectBindings, db as createAssetKey, dc as deref, dd as deriveCollection, de as despawn, df as doEffects, dg as emit, dh as findService, di as getArgs, dj as getDefaultAnimationsForRole, dk as getOperator, dl as getServiceNames, dm as getTraitConfig, dn as getTraitName, dp as hasService, dq as isBinding, dr as isCircuitEvent, ds as isEffect, dt as isEntityCall, du as isEntityReference, dv as isEntityReferenceAny, dw as isImportedTraitRef, dx as isInlineTrait, dy as isMcpService, dz as isOrbitalDefinition, dA as isPageReference, dB as isPageReferenceObject, dC as isPageReferenceString, dD as isRestService, dE as isRuntimeEntity, dF as isSExpr, dG as isSExprAtom, dH as isSExprCall, dI as isSExprEffect, dJ as isServiceReference, dK as isServiceReferenceObject, dL as isSingletonEntity, dM as isSocketService, dN as isThemeReference, dO as isValidBinding, dP as navigate, dQ as normalizeTraitRef, dR as notify, dS as parseAssetKey, dT as parseBinding, dU as parseEntityRef, dV as parseImportedTraitRef, dW as parseOrbitalSchema, dX as parsePageRef, dY as parseServiceRef, dZ as persist, d_ as ref, d$ as renderUI, e0 as safeParseOrbitalSchema, e1 as set, e2 as sexpr, e3 as spawn, e4 as swap, e5 as validateAssetAnimations, e6 as walkSExpr, e7 as watch } from '../schema-CLFPg1xW.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export { CATEGORIES, CategoryMeta, OPERATORS, OPERATORS_SCHEMA, OPERATOR_NAMES, OperatorCategory, OperatorMeta, OperatorStats, OperatorsSchema, TargetPlatform, getOperatorMeta, getOperatorStats, getOperatorsByCategory, getOperatorsForTarget, isEffectOperator, isGuardOperator, isKnownOperator, validateOperatorArity } from '@almadar/operators';
|
|
5
5
|
export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
|
package/dist/types/index.js
CHANGED
|
@@ -50,34 +50,61 @@ var FieldFormatSchema = z.enum([
|
|
|
50
50
|
"datetime",
|
|
51
51
|
"uuid"
|
|
52
52
|
]);
|
|
53
|
+
var FIELD_TYPE_ALIASES = {
|
|
54
|
+
text: "string",
|
|
55
|
+
int: "number",
|
|
56
|
+
float: "number",
|
|
57
|
+
ts: "timestamp"
|
|
58
|
+
};
|
|
53
59
|
var EntityFieldSchema = z.lazy(
|
|
54
|
-
() => z.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
items: EntityFieldSchema.optional(),
|
|
65
|
-
relation: RelationConfigSchema.optional()
|
|
66
|
-
}).refine(
|
|
67
|
-
(field) => field.type !== "relation" || field.relation !== void 0,
|
|
68
|
-
{ message: 'Relation config is required when type is "relation"', path: ["relation"] }
|
|
69
|
-
).refine(
|
|
70
|
-
// Enum fields must carry their allowed values. Without this refine,
|
|
71
|
-
// the type was lying about what's valid — bare `type: 'enum'` without
|
|
72
|
-
// `values` passed zod but failed `orb validate` downstream with
|
|
73
|
-
// ORB_E_EMPTY_ENUM_VALUES, stalling the agent pipeline for 20 minutes.
|
|
74
|
-
// `enum` is the legacy field-name alias; accept either.
|
|
75
|
-
(field) => {
|
|
76
|
-
if (field.type !== "enum") return true;
|
|
77
|
-
const vals = field.values ?? field.enum;
|
|
78
|
-
return Array.isArray(vals) && vals.length > 0;
|
|
60
|
+
() => z.preprocess(
|
|
61
|
+
(input) => {
|
|
62
|
+
if (input !== null && typeof input === "object" && "type" in input && typeof input.type === "string") {
|
|
63
|
+
const raw = input.type;
|
|
64
|
+
const canonical = FIELD_TYPE_ALIASES[raw];
|
|
65
|
+
if (canonical !== void 0) {
|
|
66
|
+
return { ...input, type: canonical };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return input;
|
|
79
70
|
},
|
|
80
|
-
{
|
|
71
|
+
z.object({
|
|
72
|
+
name: z.string().min(1, "Field name is required"),
|
|
73
|
+
type: FieldTypeSchema,
|
|
74
|
+
required: z.boolean().optional(),
|
|
75
|
+
default: z.unknown().optional(),
|
|
76
|
+
values: z.array(z.string()).optional(),
|
|
77
|
+
enum: z.array(z.string()).optional(),
|
|
78
|
+
format: FieldFormatSchema.optional(),
|
|
79
|
+
min: z.number().optional(),
|
|
80
|
+
max: z.number().optional(),
|
|
81
|
+
items: EntityFieldSchema.optional(),
|
|
82
|
+
relation: RelationConfigSchema.optional()
|
|
83
|
+
}).refine(
|
|
84
|
+
(field) => field.type !== "relation" || field.relation !== void 0,
|
|
85
|
+
{ message: 'Relation config is required when type is "relation"', path: ["relation"] }
|
|
86
|
+
).refine(
|
|
87
|
+
// Enum fields must carry their allowed values. Without this refine,
|
|
88
|
+
// the type was lying about what's valid — bare `type: 'enum'` without
|
|
89
|
+
// `values` passed zod but failed `orb validate` downstream with
|
|
90
|
+
// ORB_E_EMPTY_ENUM_VALUES, stalling the agent pipeline for 20 minutes.
|
|
91
|
+
// `enum` is the legacy field-name alias; accept either.
|
|
92
|
+
(field) => {
|
|
93
|
+
if (field.type !== "enum") return true;
|
|
94
|
+
const vals = field.values ?? field.enum;
|
|
95
|
+
return Array.isArray(vals) && vals.length > 0;
|
|
96
|
+
},
|
|
97
|
+
{ message: "Enum field requires a non-empty `values` array", path: ["values"] }
|
|
98
|
+
).refine(
|
|
99
|
+
// Array fields must describe their element shape. Bare `type: 'array'`
|
|
100
|
+
// with no `items` forces downstream consumers (builders, UI renderers,
|
|
101
|
+
// persistence) to guess, so reject it at the schema boundary.
|
|
102
|
+
(field) => {
|
|
103
|
+
if (field.type !== "array") return true;
|
|
104
|
+
return field.items !== void 0;
|
|
105
|
+
},
|
|
106
|
+
{ message: "Array field requires an `items` schema describing each element", path: ["items"] }
|
|
107
|
+
)
|
|
81
108
|
)
|
|
82
109
|
);
|
|
83
110
|
var FieldSchema = EntityFieldSchema;
|
|
@@ -555,6 +582,8 @@ var RequiredFieldSchema = z.object({
|
|
|
555
582
|
});
|
|
556
583
|
var TraitReferenceSchema = z.object({
|
|
557
584
|
ref: z.string().min(1),
|
|
585
|
+
// Phase 1.2: optional registry path disambiguator, pairs with `ref`.
|
|
586
|
+
from: z.string().optional(),
|
|
558
587
|
linkedEntity: z.string().optional(),
|
|
559
588
|
name: z.string().optional(),
|
|
560
589
|
events: z.record(
|
|
@@ -994,6 +1023,8 @@ var PageRefStringSchema = z.string().regex(
|
|
|
994
1023
|
);
|
|
995
1024
|
var PageRefObjectSchema = z.object({
|
|
996
1025
|
ref: PageRefStringSchema,
|
|
1026
|
+
// Phase 1.2: optional registry path disambiguator, pairs with `ref`.
|
|
1027
|
+
from: z.string().optional(),
|
|
997
1028
|
path: z.string().startsWith("/").optional(),
|
|
998
1029
|
linkedEntity: z.string().optional(),
|
|
999
1030
|
traits: z.array(TraitRefSchema).optional()
|