@almadar/core 5.3.2 → 5.4.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/domain-language/index.js +15 -0
- package/dist/domain-language/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +44 -1
- package/dist/types/index.js +19 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -105,6 +105,49 @@ declare function validateBindingInContext(binding: {
|
|
|
105
105
|
*/
|
|
106
106
|
declare function getBindingExamples(context: BindingContext): string[];
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Binding root classification
|
|
110
|
+
*
|
|
111
|
+
* The prefix of an `@X.path` binding expression identifies which runtime
|
|
112
|
+
* context resolves the rest of the path. This type is the TS-side mirror
|
|
113
|
+
* of `OirBindingRoot` in `orbital-core`'s IR; publishing it from
|
|
114
|
+
* `@almadar/core` lets the codegen, the runtime binding resolver, and
|
|
115
|
+
* the verifier's schema walker all refer to the same narrow union.
|
|
116
|
+
*
|
|
117
|
+
* Distinct from {@link ParsedBinding.root} (which is a plain string): use
|
|
118
|
+
* `BindingRoot` whenever you need exhaustiveness over the known prefixes.
|
|
119
|
+
*
|
|
120
|
+
* - `entity`: `@entity.field` — the trait's linked entity (first row on
|
|
121
|
+
* the client, `getById` result on the server).
|
|
122
|
+
* - `payload`: `@payload.x` — the last event's payload.
|
|
123
|
+
* - `state`: `@state.x` — the state machine's `state` slot (rare;
|
|
124
|
+
* mostly used for guard/effect contexts).
|
|
125
|
+
* - `config`: `@config.x` — the trait ref's merged config from the
|
|
126
|
+
* molecule call site.
|
|
127
|
+
* - `user`: `@user.x` — authenticated user / agent context.
|
|
128
|
+
* - `trait`: `@trait.x` — render-time reference to another trait's
|
|
129
|
+
* mounted view. Resolved by `<TraitFrame>` at runtime, not by the
|
|
130
|
+
* SExpression compiler.
|
|
131
|
+
* - `item`: `@item.x` — iterator variable inside a `map` / repeat
|
|
132
|
+
* pattern.
|
|
133
|
+
* - `now`: `@now` — current timestamp (ISO string).
|
|
134
|
+
* - `computed`: `@computed.x` — evaluator-computed value (Phase 4.5).
|
|
135
|
+
* - `other`: catch-all for unknown prefixes or entity-reference
|
|
136
|
+
* bindings (`@User.name`, `@_item`).
|
|
137
|
+
*
|
|
138
|
+
* @packageDocumentation
|
|
139
|
+
*/
|
|
140
|
+
type BindingRoot = 'entity' | 'payload' | 'state' | 'config' | 'user' | 'trait' | 'item' | 'now' | 'computed' | 'other';
|
|
141
|
+
/** Every known binding root, in a stable order — useful for exhaustiveness checks. */
|
|
142
|
+
declare const BINDING_ROOTS: readonly BindingRoot[];
|
|
143
|
+
/**
|
|
144
|
+
* Narrow a raw binding-root string (e.g. the `root` field of
|
|
145
|
+
* `ParsedBinding` from `./expression.ts`) to a `BindingRoot`. Returns
|
|
146
|
+
* `'other'` for entity-reference roots like `@User.name` or unknown
|
|
147
|
+
* prefixes.
|
|
148
|
+
*/
|
|
149
|
+
declare function toBindingRoot(root: string): BindingRoot;
|
|
150
|
+
|
|
108
151
|
/**
|
|
109
152
|
* Agent Types
|
|
110
153
|
*
|
|
@@ -1101,4 +1144,4 @@ type BusEventListener = (event: BusEvent) => void;
|
|
|
1101
1144
|
/** Returned by `on()` / `once()` to detach a listener. */
|
|
1102
1145
|
type Unsubscribe = () => void;
|
|
1103
1146
|
|
|
1104
|
-
export { type AgentCodeSearchResult, type AgentCompactResult, type AgentCompactStrategy, type AgentContext, type AgentGenerateOptions, type AgentMemoryCategory, type AgentMemoryRecord, type AppSummary, BINDING_CONTEXT_RULES, BINDING_DOCS, type BindingContext, BindingSchema, type BusEvent, type BusEventListener, type BusEventSource, type CategorizedRemovals, type ChangeAuthor, type ChangeSetDocument, type ChangeSummary, type ContextExtensions, type CreateFlow, DEFAULT_INTERACTION_MODELS, type DeleteFlow, type EditFlow, EntityRow, EventPayload, FieldValue, type GitHubLink, type HistoryMeta, type InteractionModel, type InteractionModelInput, InteractionModelSchema, type LazyService, type ListInteraction, type PageContentReduction, PatternTypeSchema, type PersistActionName, type ResolvedEntity, type ResolvedEntityBinding, type ResolvedField, type ResolvedIR, type ResolvedNavigation, type ResolvedPage, type ResolvedPattern, type ResolvedSection, type ResolvedSectionEvent, type ResolvedTrait, type ResolvedTraitBinding, type ResolvedTraitDataEntity, type ResolvedTraitEvent, type ResolvedTraitGuard, type ResolvedTraitListener, type ResolvedTraitState, type ResolvedTraitTick, type ResolvedTraitTransition, type ResolvedTraitUIBinding, SExpr, type SaveOptions, type SaveResult, type SchemaChange, type SemanticChangeKind, type SemanticSchemaChange, type ServiceAction, type ServiceActionName, type ServiceContract, type ServiceEvents, type SnapshotDocument, type StatsView, type StoreContract, type StoreFilter, type StoreFilterOp, TraitConfig, type TransitionFrom, type Unsubscribe, type ValidationDocument, type ValidationIssue, type ValidationMeta, type ValidationResults, type ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isResolvedIR, validateBindingInContext };
|
|
1147
|
+
export { type AgentCodeSearchResult, type AgentCompactResult, type AgentCompactStrategy, type AgentContext, type AgentGenerateOptions, type AgentMemoryCategory, type AgentMemoryRecord, type AppSummary, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, type BindingContext, type BindingRoot, BindingSchema, type BusEvent, type BusEventListener, type BusEventSource, type CategorizedRemovals, type ChangeAuthor, type ChangeSetDocument, type ChangeSummary, type ContextExtensions, type CreateFlow, DEFAULT_INTERACTION_MODELS, type DeleteFlow, type EditFlow, EntityRow, EventPayload, FieldValue, type GitHubLink, type HistoryMeta, type InteractionModel, type InteractionModelInput, InteractionModelSchema, type LazyService, type ListInteraction, type PageContentReduction, PatternTypeSchema, type PersistActionName, type ResolvedEntity, type ResolvedEntityBinding, type ResolvedField, type ResolvedIR, type ResolvedNavigation, type ResolvedPage, type ResolvedPattern, type ResolvedSection, type ResolvedSectionEvent, type ResolvedTrait, type ResolvedTraitBinding, type ResolvedTraitDataEntity, type ResolvedTraitEvent, type ResolvedTraitGuard, type ResolvedTraitListener, type ResolvedTraitState, type ResolvedTraitTick, type ResolvedTraitTransition, type ResolvedTraitUIBinding, SExpr, type SaveOptions, type SaveResult, type SchemaChange, type SemanticChangeKind, type SemanticSchemaChange, type ServiceAction, type ServiceActionName, type ServiceContract, type ServiceEvents, type SnapshotDocument, type StatsView, type StoreContract, type StoreFilter, type StoreFilterOp, TraitConfig, type TransitionFrom, type Unsubscribe, type ValidationDocument, type ValidationIssue, type ValidationMeta, type ValidationResults, type ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isResolvedIR, toBindingRoot, validateBindingInContext };
|
package/dist/types/index.js
CHANGED
|
@@ -1240,6 +1240,24 @@ function getBindingExamples(context) {
|
|
|
1240
1240
|
examples.push("@GameConfig.gravity", "@Filter.searchTerm");
|
|
1241
1241
|
return examples;
|
|
1242
1242
|
}
|
|
1243
|
+
|
|
1244
|
+
// src/types/binding.ts
|
|
1245
|
+
var BINDING_ROOTS = [
|
|
1246
|
+
"entity",
|
|
1247
|
+
"payload",
|
|
1248
|
+
"state",
|
|
1249
|
+
"config",
|
|
1250
|
+
"user",
|
|
1251
|
+
"trait",
|
|
1252
|
+
"item",
|
|
1253
|
+
"now",
|
|
1254
|
+
"computed",
|
|
1255
|
+
"other"
|
|
1256
|
+
];
|
|
1257
|
+
var KNOWN_ROOTS = new Set(BINDING_ROOTS.filter((r) => r !== "other"));
|
|
1258
|
+
function toBindingRoot(root) {
|
|
1259
|
+
return KNOWN_ROOTS.has(root) ? root : "other";
|
|
1260
|
+
}
|
|
1243
1261
|
var InteractionModelSchema = z.object({
|
|
1244
1262
|
createFlow: z.enum(["modal", "page", "inline", "none"]),
|
|
1245
1263
|
editFlow: z.enum(["modal", "page", "inline", "none"]),
|
|
@@ -1382,6 +1400,6 @@ function isResolvedIR(ir) {
|
|
|
1382
1400
|
return typeof r.appName === "string" && r.traits instanceof Map && r.pages instanceof Map;
|
|
1383
1401
|
}
|
|
1384
1402
|
|
|
1385
|
-
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, 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, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, atomic, callService, collectBindings, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, deref, deriveCollection, despawn, doEffects, emit, findService, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, inferTsType, isBinding, isCircuitEvent, isEffect, isEntityCall, isEntityReference, isEntityReferenceAny, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isServiceReferenceObject, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, ref, renderUI, safeParseOrbitalSchema, set, sexpr, spawn, swap, validateAssetAnimations, validateBindingInContext, walkSExpr, watch };
|
|
1403
|
+
export { AGENT_DOMAIN_CATEGORIES, ALLOWED_CUSTOM_COMPONENTS, AgentDomainCategorySchema, AnimationDefSchema, AssetMapSchema, AssetMappingSchema, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingSchema, CORE_BINDINGS, ComputedEventContractSchema, ComputedEventListenerSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, 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, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, atomic, callService, collectBindings, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, deref, deriveCollection, despawn, doEffects, emit, findService, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getInteractionModelForDomain, getOperator, getServiceNames, getTraitConfig, getTraitName, hasService, inferTsType, isBinding, isCircuitEvent, isEffect, isEntityCall, isEntityReference, isEntityReferenceAny, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isServiceReferenceObject, isSingletonEntity, isSocketService, isThemeReference, isValidBinding, navigate, normalizeTraitRef, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, persist, ref, renderUI, safeParseOrbitalSchema, set, sexpr, spawn, swap, toBindingRoot, validateAssetAnimations, validateBindingInContext, walkSExpr, watch };
|
|
1386
1404
|
//# sourceMappingURL=index.js.map
|
|
1387
1405
|
//# sourceMappingURL=index.js.map
|