@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/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AGENT_DOMAIN_CATEGORIES,
|
|
1
|
+
import { d as OrbitalSchema, S as State, O as OrbitalDefinition } 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, 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, c as EntityRow, 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, aL as FieldValue, 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, 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, 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, bS as SExpr, 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, 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 { ResolvedIR, ResolvedEntity, ResolvedPage, ResolvedTrait, SchemaChange, CategorizedRemovals, PageContentReduction, SemanticSchemaChange } from './types/index.js';
|
|
4
4
|
export { AgentCodeSearchResult, AgentCompactResult, AgentCompactStrategy, AgentContext, AgentGenerateOptions, AgentMemoryCategory, AgentMemoryRecord, AppSummary, BINDING_CONTEXT_RULES, BINDING_DOCS, BindingContext, BindingSchema, ChangeAuthor, ChangeSetDocument, ChangeSummary, CreateFlow, DEFAULT_INTERACTION_MODELS, DeleteFlow, EditFlow, GitHubLink, HistoryMeta, InteractionModel, InteractionModelInput, InteractionModelSchema, LazyService, ListInteraction, OperatorName, PatternTypeSchema, PersistActionName, ResolvedEntityBinding, ResolvedField, ResolvedNavigation, ResolvedPattern, ResolvedSection, ResolvedSectionEvent, ResolvedTraitBinding, ResolvedTraitDataEntity, ResolvedTraitEvent, ResolvedTraitGuard, ResolvedTraitListener, ResolvedTraitState, ResolvedTraitTick, ResolvedTraitTransition, ResolvedTraitUIBinding, SaveOptions, SaveResult, SemanticChangeKind, ServiceAction, ServiceActionName, ServiceContract, ServiceEvents, SnapshotDocument, StatsView, StoreContract, StoreFilter, StoreFilterOp, TransitionFrom, ValidationDocument, ValidationIssue, ValidationMeta, ValidationResults, ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllOperators, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isResolvedIR, validateBindingInContext } from './types/index.js';
|
|
5
5
|
export { ASTNode, ComparisonCondition, ComparisonOperator, DomainBehavior, DomainChunk, DomainDocument, DomainEffect, DomainEntity, DomainField, DomainFieldType, DomainGuard, DomainPage, DomainPageAction, DomainPageSection, DomainRelationship, DomainTick, DomainToSchemaResult, DomainTransition, EFFECT_REGISTRY, EffectMapping, EffectType, FIELD_TYPE_REGISTRY, FieldCheckCondition, FieldReference, FieldTypeMapping, GUARD_REGISTRY, GuardCondition, GuardMapping, KEYWORDS, Lexer, LogicalCondition, LogicalOperator, MULTI_WORD_KEYWORDS, MappingStore, MergeResult, ParseError, ParseResult, RelationshipType, SchemaToDomainResult, SectionMapping, SourceLocation, SourceRange, Token, TokenType, UserCheckCondition, applySectionUpdate, computeSchemaHash, convertDomainToSchema, convertEntitiesToDomain, convertPagesToDomain, convertSchemaToDomain, convertTraitsToDomain, createMappingStore, deleteSection, detectChanges, domainKeywordToSchemaType, findMapping, findMappingByPath, findMappingsByType, formatBehaviorToDomain, formatBehaviorToSchema, formatDomainGuardToSchema, formatEntityToDomain, formatEntityToSchema, formatGuardConditionToDomain, formatGuardToDomain, formatGuardToSchema, formatMergeSummary, formatPageToDomain, formatPageToSchema, formatSchemaEntityToDomain, formatSchemaGuardToDomain, formatSchemaPageToDomain, formatSchemaTraitToDomain, generateDomainLanguageReference, generateSectionId, getEffectMapping, getFieldTypeMapping, getGuardMapping, getRegisteredEffects, getRegisteredFieldTypes, getRegisteredGuards, getRegistryStats, getSchemaPath, hasSchemaChanged, isEffectRegistered, isFieldTypeRegistered, isGuardRegistered, mergeDomainChunks, parseBehavior, parseDomainEffect, parseDomainEffects, parseDomainGuard, parseEntity, parseGuard, parsePage, parseSectionId, removeMapping, resolveConflict, schemaEntityToDomainEntity, schemaPageToDomainPage, schemaTraitToDomainBehavior, schemaTypeToDomainKeyword, tokenize, updateMappingRange, updateSchemaHash, upsertMapping, validateDomainChunk } from './domain-language/index.js';
|
|
6
|
-
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-
|
|
6
|
+
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-Bp32KayC.js';
|
|
7
7
|
export { BFSNode, BFSPathNode, EdgeWalkTransition, GraphTransition, GuardPayload, ReplayStep, ReplayTransition, StateEdge, WalkStep, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, collectReachableStates, extractPayloadFieldRef, walkStatePairs } from './state-machine/index.js';
|
|
8
8
|
export { CATEGORIES, CategoryMeta, OPERATORS, OPERATORS_SCHEMA, OPERATOR_NAMES, OperatorCategory, OperatorMeta, OperatorStats, OperatorsSchema, TargetPlatform, getOperatorMeta, getOperatorStats, getOperatorsByCategory, getOperatorsForTarget, isEffectOperator, isGuardOperator, isKnownOperator, validateOperatorArity } from '@almadar/operators';
|
|
9
9
|
export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,9 @@ import { OPERATOR_NAMES } from '@almadar/operators';
|
|
|
3
3
|
export { CATEGORIES, OPERATORS, OPERATORS_SCHEMA, OPERATOR_NAMES, getOperatorMeta, getOperatorStats, getOperatorsByCategory, getOperatorsForTarget, isEffectOperator, isGuardOperator, isKnownOperator, validateOperatorArity } from '@almadar/operators';
|
|
4
4
|
import { PATTERN_TYPES, getPatternDefinition } from '@almadar/patterns';
|
|
5
5
|
export { PATTERN_TYPES, isValidPatternType } from '@almadar/patterns';
|
|
6
|
+
import 'fs';
|
|
7
|
+
import 'path';
|
|
8
|
+
import 'url';
|
|
6
9
|
|
|
7
10
|
// src/types/orbital.ts
|
|
8
11
|
var FieldTypeSchema = z.enum([
|
|
@@ -50,34 +53,61 @@ var FieldFormatSchema = z.enum([
|
|
|
50
53
|
"datetime",
|
|
51
54
|
"uuid"
|
|
52
55
|
]);
|
|
56
|
+
var FIELD_TYPE_ALIASES = {
|
|
57
|
+
text: "string",
|
|
58
|
+
int: "number",
|
|
59
|
+
float: "number",
|
|
60
|
+
ts: "timestamp"
|
|
61
|
+
};
|
|
53
62
|
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;
|
|
63
|
+
() => z.preprocess(
|
|
64
|
+
(input) => {
|
|
65
|
+
if (input !== null && typeof input === "object" && "type" in input && typeof input.type === "string") {
|
|
66
|
+
const raw = input.type;
|
|
67
|
+
const canonical = FIELD_TYPE_ALIASES[raw];
|
|
68
|
+
if (canonical !== void 0) {
|
|
69
|
+
return { ...input, type: canonical };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return input;
|
|
79
73
|
},
|
|
80
|
-
{
|
|
74
|
+
z.object({
|
|
75
|
+
name: z.string().min(1, "Field name is required"),
|
|
76
|
+
type: FieldTypeSchema,
|
|
77
|
+
required: z.boolean().optional(),
|
|
78
|
+
default: z.unknown().optional(),
|
|
79
|
+
values: z.array(z.string()).optional(),
|
|
80
|
+
enum: z.array(z.string()).optional(),
|
|
81
|
+
format: FieldFormatSchema.optional(),
|
|
82
|
+
min: z.number().optional(),
|
|
83
|
+
max: z.number().optional(),
|
|
84
|
+
items: EntityFieldSchema.optional(),
|
|
85
|
+
relation: RelationConfigSchema.optional()
|
|
86
|
+
}).refine(
|
|
87
|
+
(field) => field.type !== "relation" || field.relation !== void 0,
|
|
88
|
+
{ message: 'Relation config is required when type is "relation"', path: ["relation"] }
|
|
89
|
+
).refine(
|
|
90
|
+
// Enum fields must carry their allowed values. Without this refine,
|
|
91
|
+
// the type was lying about what's valid — bare `type: 'enum'` without
|
|
92
|
+
// `values` passed zod but failed `orb validate` downstream with
|
|
93
|
+
// ORB_E_EMPTY_ENUM_VALUES, stalling the agent pipeline for 20 minutes.
|
|
94
|
+
// `enum` is the legacy field-name alias; accept either.
|
|
95
|
+
(field) => {
|
|
96
|
+
if (field.type !== "enum") return true;
|
|
97
|
+
const vals = field.values ?? field.enum;
|
|
98
|
+
return Array.isArray(vals) && vals.length > 0;
|
|
99
|
+
},
|
|
100
|
+
{ message: "Enum field requires a non-empty `values` array", path: ["values"] }
|
|
101
|
+
).refine(
|
|
102
|
+
// Array fields must describe their element shape. Bare `type: 'array'`
|
|
103
|
+
// with no `items` forces downstream consumers (builders, UI renderers,
|
|
104
|
+
// persistence) to guess, so reject it at the schema boundary.
|
|
105
|
+
(field) => {
|
|
106
|
+
if (field.type !== "array") return true;
|
|
107
|
+
return field.items !== void 0;
|
|
108
|
+
},
|
|
109
|
+
{ message: "Array field requires an `items` schema describing each element", path: ["items"] }
|
|
110
|
+
)
|
|
81
111
|
)
|
|
82
112
|
);
|
|
83
113
|
var FieldSchema = EntityFieldSchema;
|
|
@@ -555,6 +585,8 @@ var RequiredFieldSchema = z.object({
|
|
|
555
585
|
});
|
|
556
586
|
var TraitReferenceSchema = z.object({
|
|
557
587
|
ref: z.string().min(1),
|
|
588
|
+
// Phase 1.2: optional registry path disambiguator, pairs with `ref`.
|
|
589
|
+
from: z.string().optional(),
|
|
558
590
|
linkedEntity: z.string().optional(),
|
|
559
591
|
name: z.string().optional(),
|
|
560
592
|
events: z.record(
|
|
@@ -994,6 +1026,8 @@ var PageRefStringSchema = z.string().regex(
|
|
|
994
1026
|
);
|
|
995
1027
|
var PageRefObjectSchema = z.object({
|
|
996
1028
|
ref: PageRefStringSchema,
|
|
1029
|
+
// Phase 1.2: optional registry path disambiguator, pairs with `ref`.
|
|
1030
|
+
from: z.string().optional(),
|
|
997
1031
|
path: z.string().startsWith("/").optional(),
|
|
998
1032
|
linkedEntity: z.string().optional(),
|
|
999
1033
|
traits: z.array(TraitRefSchema).optional()
|