@almadar/core 7.14.1 → 7.14.3
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 +2 -2
- package/dist/{compose-behaviors-BJTsmdSN.d.ts → compose-behaviors-Dgj9KYGP.d.ts} +1 -1
- package/dist/domain-language/index.d.ts +1 -1
- package/dist/domain-language/index.js +1 -0
- package/dist/domain-language/index.js.map +1 -1
- package/dist/index.d.ts +79 -7
- package/dist/index.js +143 -11
- package/dist/index.js.map +1 -1
- package/dist/{schema-DEkM0GfA.d.ts → schema-CgNnvuCR.d.ts} +330 -299
- package/dist/types/index.d.ts +25 -12
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +9 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AGENT_DOMAIN_CATEGORIES,
|
|
1
|
+
import { bh as OrbitalSchema, ci as State, b6 as OrbitalDefinition } from './schema-CgNnvuCR.js';
|
|
2
|
+
export { A as AGENT_DOMAIN_CATEGORIES, a as ALLOWED_CUSTOM_COMPONENTS, b as AgentDomainCategory, c as AgentDomainCategorySchema, d as AgentEffect, e as AllowedCustomComponent, f as AnimationDef, g as AnimationDefInput, h as AnimationDefSchema, i as AssetMap, j as AssetMapInput, k as AssetMapSchema, l as AssetMapping, m as AssetMappingInput, n as AssetMappingSchema, o as AtomicEffect, C as CallServiceConfig, p as CallServiceEffect, q as CheckpointLoadEffect, r as CheckpointSaveEffect, s as ComputedEventContract, t as ComputedEventContractSchema, u as ComputedEventListener, v as ComputedEventListenerSchema, w as ConfigFieldDeclaration, x as ConfigFieldDeclarationSchema, y as CustomPatternDefinition, z as CustomPatternDefinitionInput, B as CustomPatternDefinitionSchema, D as CustomPatternMap, E as CustomPatternMapInput, F as CustomPatternMapSchema, G as DeclaredTraitConfig, H as DeclaredTraitConfigSchema, I as DerefEffect, J as DesignPreferences, K as DesignPreferencesInput, L as DesignPreferencesSchema, M as DesignTokens, N as DesignTokensInput, O as DesignTokensSchema, P as DespawnEffect, Q as DoEffect, R as DomainCategory, S as DomainCategorySchema, T as DomainContext, U as DomainContextInput, V as DomainContextSchema, W as DomainVocabulary, X as DomainVocabularySchema, Y as ENTITY_ROLES, Z as Effect, _ as EffectInput, $ as EffectSchema, a0 as EmitConfig, a1 as EmitEffect, a2 as Entity, a3 as EntityCall, a4 as EntityCallSchema, a5 as EntityData, a6 as EntityField, a7 as EntityFieldInput, a8 as EntityFieldSchema, a9 as EntityPersistence, aa as EntityPersistenceSchema, ab as EntityRef, ac as EntityRefSchema, ad as EntityRefStringSchema, ae as EntityRole, af as EntityRoleSchema, ag as EntityRow, ah as EntitySchema, ai as EntitySemanticRole, aj as EntitySemanticRoleSchema, ak as EvaluateConfig, al as EvaluateEffect, am as Event, an as EventInput, ao as EventListener, ap as EventListenerSchema, aq as EventPayloadField, ar as EventPayloadFieldSchema, as as EventSchema, at as EventScope, au as EventScopeSchema, av as EventSemanticRole, aw as EventSemanticRoleSchema, ax as EventSource, ay as EventSourceSchema, az as FetchEffect, aA as FetchOptions, aB as FetchResult, aC as Field, aD as FieldFormat, aE as FieldFormatSchema, aF as FieldSchema, aG as FieldType, aH as FieldTypeSchema, aI as FieldValue, aJ as ForwardConfig, aK as ForwardEffect, b2 as FullOrbitalUnit, aL as GAME_TYPES, aM as GameSubCategory, aN as GameSubCategorySchema, aO as GameType, aP as GameTypeSchema, aQ as Guard, aR as GuardInput, aS as GuardSchema, aT as ListenSource, aU as ListenSourceSchema, aV as LogEffect, aW as McpServiceDef, aX as McpServiceDefSchema, aY as NavigateEffect, aZ as NnConfig, a_ as NnLayer, a$ as NodeClassification, b0 as NodeClassificationSchema, b1 as NotifyEffect, b2 as Orbital, b3 as OrbitalConfig, b4 as OrbitalConfigInput, b5 as OrbitalConfigSchema, b7 as OrbitalDefinitionSchema, b8 as OrbitalEntity, b9 as OrbitalEntityInput, ba as OrbitalEntitySchema, bb as OrbitalInput, bc as OrbitalPage, bd as OrbitalPageInput, be as OrbitalPageSchema, bf as OrbitalPageStrictInput, bg as OrbitalPageStrictSchema, bj as OrbitalSchemaInput, bk as OrbitalSchemaSchema, bl as OrbitalSchemaWithTraits, bm as OrbitalTraitRef, bn as OrbitalTraitRefSchema, bo as OrbitalUnit, bp as OrbitalUnitSchema, bi as OrbitalZodSchema, bq as OsEffect, br as Page, bs as PageRef, bt as PageRefObject, bu as PageRefObjectSchema, bv as PageRefSchema, bw as PageRefStringSchema, bx as PageSchema, by as PageTraitRef, bz as PageTraitRefSchema, bA as PayloadField, bB as PayloadFieldSchema, bC as PersistData, bD as PersistEffect, bE as PersistEmitConfig, bF as PresentationType, bG as RefEffect, bH as RelatedLink, bI as RelatedLinkSchema, bJ as RelationConfig, bK as RelationConfigSchema, bL as RenderItemLambda, bM as RenderUIConfig, bN as RenderUIEffect, bO as RenderUINode, bP as RequiredField, bQ as RequiredFieldSchema, bR as ResolvedAsset, bS as ResolvedAssetInput, bT as ResolvedAssetSchema, bU as ResolvedPatternProps, bV as RestAuthConfig, bW as RestAuthConfigSchema, bX as RestServiceDef, bY as RestServiceDefSchema, bZ as SERVICE_TYPES, b_ as SemanticAssetRef, b$ as SemanticAssetRefInput, c0 as SemanticAssetRefSchema, c1 as ServiceDefinition, c2 as ServiceDefinitionSchema, c3 as ServiceParams, c4 as ServiceParamsValue, c5 as ServiceRef, c6 as ServiceRefObject, c7 as ServiceRefObjectSchema, c8 as ServiceRefSchema, c9 as ServiceRefStringSchema, ca as ServiceType, cb as ServiceTypeSchema, cc as SetEffect, cd as SocketEvents, ce as SocketEventsSchema, cf as SocketServiceDef, cg as SocketServiceDefSchema, ch as SpawnEffect, cj as StateInput, ck as StateMachine, cl as StateMachineInput, cm as StateMachineSchema, cn as StateSchema, co as StateSemanticRole, cp as StateSemanticRoleSchema, cq as SuggestedGuard, cr as SuggestedGuardSchema, cs as SwapEffect, ct as ThemeDefinition, cu as ThemeDefinitionSchema, cv as ThemeRef, cw as ThemeRefSchema, cx as ThemeRefStringSchema, cy as ThemeTokens, cz as ThemeTokensSchema, cA as ThemeVariant, cB as ThemeVariantSchema, cC as TrainConfig, cD as TrainEffect, cE as Trait, cF as TraitCategory, cG as TraitCategorySchema, cH as TraitConfig, cI as TraitConfigObject, cJ as TraitConfigSchema, cK as TraitConfigValue, cL as TraitConfigValueSchema, cM as TraitDataEntity, cN as TraitDataEntitySchema, cO as TraitEntityField, cP as TraitEntityFieldSchema, cQ as TraitEventContract, cR as TraitEventContractSchema, cS as TraitEventListener, cT as TraitEventListenerSchema, cU as TraitInput, cV as TraitRef, cW as TraitRefSchema, cX as TraitReference, cY as TraitReferenceInput, cZ as TraitReferenceSchema, c_ as TraitSchema, c$ as TraitTick, d0 as TraitTickSchema, d1 as TraitUIBinding, d2 as Transition, d3 as TransitionInput, d4 as TransitionSchema, d5 as TypedEffect, d6 as UISlot, d7 as UISlotSchema, d8 as UI_SLOTS, d9 as UXHints, da as UXHintsSchema, db as UseDeclaration, dc as UseDeclarationSchema, dd as UserPersona, de as UserPersonaInput, df as UserPersonaSchema, dg as VISUAL_STYLES, dh as ViewType, di as ViewTypeSchema, dj as VisualStyle, dk as VisualStyleSchema, dl as WatchEffect, dm as WatchOptions, dn as atomic, dp as callService, dq as createAssetKey, dr as deref, ds as deriveCollection, dt as despawn, du as doEffects, dv as emit, dw as findService, dx as getDefaultAnimationsForRole, dy as getServiceNames, dz as getTraitConfig, dA as getTraitName, dB as hasService, dC as isCircuitEvent, dD as isEffect, dE as isEntityCall, dF as isEntityReference, dG as isEntityReferenceAny, dH as isImportedTraitRef, dI as isInlineTrait, dJ as isMcpService, dK as isOrbitalDefinition, dL as isPageReference, dM as isPageReferenceObject, dN as isPageReferenceString, dO as isRestService, dP as isRuntimeEntity, dQ as isSExprEffect, dR as isServiceReference, dS as isServiceReferenceObject, dT as isSingletonEntity, dU as isSocketService, dV as isThemeReference, dW as navigate, dX as normalizeTraitRef, dY as notify, dZ as parseAssetKey, d_ as parseEntityRef, d$ as parseImportedTraitRef, e0 as parseOrbitalSchema, e1 as parsePageRef, e2 as parseServiceRef, e3 as persist, e4 as ref, e5 as renderUI, e6 as safeParseOrbitalSchema, e7 as set, e8 as spawn, e9 as swap, ea as validateAssetAnimations, eb as watch } from './schema-CgNnvuCR.js';
|
|
3
3
|
export { C as CORE_BINDINGS, a as CoreBinding, E as EvalContext, b as EventPayload, c as EventPayloadValue, d as Expression, e as ExpressionInput, f as ExpressionSchema, L as LogMeta, P as ParsedBinding, S as SExpr, g as SExprAtom, h as SExprAtomSchema, i as SExprInput, j as SExprSchema, k as collectBindings, l as getArgs, m as getOperator, n as isBinding, o as isSExpr, p as isSExprAtom, q as isSExprCall, r as isValidBinding, s as parseBinding, t as sexpr, w as walkSExpr } from './expression-CkBbMSmB.js';
|
|
4
|
-
import { ResolvedIR, ResolvedEntity, ResolvedPage, ResolvedTrait, SchemaChange, CategorizedRemovals, PageContentReduction, SemanticSchemaChange } from './types/index.js';
|
|
4
|
+
import { ResolvedIR, ResolvedEntity, ResolvedPage, ResolvedTrait, ChangesetValue, SchemaChange, CategorizedRemovals, PageContentReduction, SemanticSchemaChange } from './types/index.js';
|
|
5
5
|
export { AgentCodeSearchResult, AgentCompactResult, AgentCompactStrategy, AgentContext, AgentGenerateOptions, AgentMemoryCategory, AgentMemoryRecord, AppSummary, AssetLoadStatus, BINDING_CONTEXT_RULES, BINDING_DOCS, BINDING_ROOTS, BindingContext, BindingRoot, BindingSchema, BridgeHealth, BusEvent, BusEventListener, BusEventSource, ChangeAuthor, ChangeSetDocument, ChangeSummary, CheckStatus, ContextExtensions, CreateFlow, DEFAULT_INTERACTION_MODELS, DeleteFlow, EditFlow, EffectTrace, EventEmit, EventKey, EventListen, EventLogEntry, GitHubLink, HistoryMeta, InteractionModel, InteractionModelInput, InteractionModelSchema, LazyService, ListInteraction, OrbitalVerificationAPI, PatternTypeSchema, PersistActionName, ResolvedEntityBinding, ResolvedField, ResolvedNavigation, ResolvedPattern, ResolvedSection, ResolvedSectionEvent, ResolvedTraitBinding, ResolvedTraitDataEntity, ResolvedTraitEvent, ResolvedTraitGuard, ResolvedTraitListener, ResolvedTraitState, ResolvedTraitTick, ResolvedTraitTransition, ResolvedTraitUIBinding, SaveOptions, SaveResult, SemanticChangeKind, ServerResponseTrace, ServiceAction, ServiceActionName, ServiceContract, ServiceEvents, SnapshotDocument, StatsView, StoreContract, StoreFilter, StoreFilterOp, TraitFieldRef, TraitFieldRefSchema, TraitStateSnapshot, TransitionFrom, TransitionTrace, Unsubscribe, ValidationDocument, ValidationIssue, ValidationMeta, ValidationResults, VerificationCheck, VerificationSnapshot, VerificationSummary, ViewFlow, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, getAllPatternTypes, getBindingExamples, getInteractionModelForDomain, inferTsType, isResolvedIR, isTraitFieldRef, toBindingRoot, validateBindingInContext } from './types/index.js';
|
|
6
6
|
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';
|
|
7
|
-
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-
|
|
7
|
+
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-Dgj9KYGP.js';
|
|
8
8
|
export { PATTERN_TYPES, PatternConfig, PatternType, isValidPatternType } from '@almadar/patterns';
|
|
9
9
|
export { BFSNode, BFSPathNode, EdgeWalkTransition, GraphTransition, GuardPayload, ReplayStep, ReplayTransition, StateEdge, WalkStep, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, collectReachableStates, extractPayloadFieldRef, walkStatePairs } from './state-machine/index.js';
|
|
10
10
|
import 'zod';
|
|
@@ -20,11 +20,19 @@ import 'zod';
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Clear the schema resolution cache.
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* With WeakMap-on-reference caching, cache entries die naturally when
|
|
25
|
+
* the schema object is GC'd, so explicit clearing is rarely necessary.
|
|
26
|
+
* Kept for hot-reload paths that want to force fresh resolution; since
|
|
27
|
+
* WeakMap has no `clear()`, we swap in a fresh instance.
|
|
24
28
|
*/
|
|
25
29
|
declare function clearSchemaCache(): void;
|
|
26
30
|
/**
|
|
27
|
-
* Get cache statistics (for debugging)
|
|
31
|
+
* Get cache statistics (for debugging).
|
|
32
|
+
*
|
|
33
|
+
* WeakMap doesn't expose size or keys; the best we can do is signal
|
|
34
|
+
* that the cache is identity-keyed. Kept for API parity with the old
|
|
35
|
+
* Map-based cache.
|
|
28
36
|
*/
|
|
29
37
|
declare function getSchemaCacheStats(): {
|
|
30
38
|
size: number;
|
|
@@ -146,6 +154,70 @@ declare function hasSignificantPageReduction(reductions: PageContentReduction[])
|
|
|
146
154
|
* for canvas focus derivation, CLI narration, and selective re-verification.
|
|
147
155
|
*/
|
|
148
156
|
declare function diffSchemaSemantics(before: OrbitalSchema, after: OrbitalSchema): SemanticSchemaChange[];
|
|
157
|
+
/**
|
|
158
|
+
* Source label for a changeset. The persistence layer accepts the canonical
|
|
159
|
+
* agent labels plus `skill-agent:<skill>`-style identifiers, so the type stays
|
|
160
|
+
* open as a string.
|
|
161
|
+
*/
|
|
162
|
+
type SchemaDiffSource = 'requirements-agent' | 'builder-agent' | 'user' | 'auto-fix' | (string & {});
|
|
163
|
+
/** Tracking granularity used when generating the diff. */
|
|
164
|
+
type SchemaDiffMode = 'initial' | 'update';
|
|
165
|
+
/** Author identification carried on the changeset envelope. */
|
|
166
|
+
interface SchemaDiffAuthor {
|
|
167
|
+
userId: string;
|
|
168
|
+
name?: string;
|
|
169
|
+
}
|
|
170
|
+
/** Options that shape the resulting diff envelope. */
|
|
171
|
+
interface SchemaDiffOptions {
|
|
172
|
+
mode: SchemaDiffMode;
|
|
173
|
+
author: SchemaDiffAuthor;
|
|
174
|
+
source: SchemaDiffSource;
|
|
175
|
+
}
|
|
176
|
+
/** Per-change entry in the diff envelope. */
|
|
177
|
+
interface SchemaDiffChange {
|
|
178
|
+
operation: 'add' | 'modify' | 'remove' | 'rename' | 'merge' | 'set';
|
|
179
|
+
path: string;
|
|
180
|
+
value?: ChangesetValue;
|
|
181
|
+
previousValue?: ChangesetValue;
|
|
182
|
+
}
|
|
183
|
+
/** Aggregate orbital/trait deltas surfaced by the diff. */
|
|
184
|
+
interface SchemaDiffSummary {
|
|
185
|
+
orbitalsAdded: string[];
|
|
186
|
+
orbitalsRemoved: string[];
|
|
187
|
+
orbitalsModified: string[];
|
|
188
|
+
traitsAdded: string[];
|
|
189
|
+
traitsModified: string[];
|
|
190
|
+
traitsRemoved: string[];
|
|
191
|
+
}
|
|
192
|
+
/** Changeset envelope produced by `diffOrbitalSchemas`. */
|
|
193
|
+
interface SchemaDiffChangeset {
|
|
194
|
+
id: string;
|
|
195
|
+
source: SchemaDiffSource;
|
|
196
|
+
author: SchemaDiffAuthor;
|
|
197
|
+
description: string;
|
|
198
|
+
changes: SchemaDiffChange[];
|
|
199
|
+
}
|
|
200
|
+
/** Result of comparing two OrbitalSchema versions. */
|
|
201
|
+
interface SchemaDiff {
|
|
202
|
+
hasChanges: boolean;
|
|
203
|
+
changeCount: number;
|
|
204
|
+
changeset: SchemaDiffChangeset;
|
|
205
|
+
summary: SchemaDiffSummary;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Compare two `OrbitalSchema` versions and produce a changeset envelope.
|
|
209
|
+
*
|
|
210
|
+
* Higher-level companion to `diffSchemas`: where `diffSchemas` returns a flat
|
|
211
|
+
* list of `SchemaChange` entries keyed by structural path, this returns the
|
|
212
|
+
* envelope the persistence layer ships to Firestore (id, author, source,
|
|
213
|
+
* summary buckets).
|
|
214
|
+
*
|
|
215
|
+
* Identifier generation: `changeset.id` is a deterministic `chg_<hex>` value
|
|
216
|
+
* derived from the schema name + change count when `globalThis.crypto.randomUUID`
|
|
217
|
+
* is unavailable; otherwise a UUID is used. Callers that need a stable id
|
|
218
|
+
* across regenerations should supply one themselves.
|
|
219
|
+
*/
|
|
220
|
+
declare function diffOrbitalSchemas(before: OrbitalSchema | null, after: OrbitalSchema, options: SchemaDiffOptions): SchemaDiff;
|
|
149
221
|
|
|
150
222
|
/**
|
|
151
223
|
* Orbital Summarization
|
|
@@ -188,4 +260,4 @@ declare function summarizeOrbital(orbital: OrbitalDefinition): OrbitalDefinition
|
|
|
188
260
|
*/
|
|
189
261
|
declare function summarizeSchema(schema: OrbitalSchema): OrbitalSchema;
|
|
190
262
|
|
|
191
|
-
export { OrbitalSchema as AppSchema, CategorizedRemovals, OrbitalDefinition, OrbitalSchema, PageContentReduction, ResolvedEntity, ResolvedIR, ResolvedPage, ResolvedTrait, SchemaChange, SemanticSchemaChange, State, categorizeRemovals, classifyWorkflow, clearSchemaCache, detectPageContentReduction, diffSchemaSemantics, diffSchemas, getEntity, getPage, getPages, getRemovals, getSchemaCacheStats, getTrait, hasSignificantPageReduction, isDestructiveChange, requiresConfirmation, schemaToIR, summarizeOrbital, summarizeSchema };
|
|
263
|
+
export { OrbitalSchema as AppSchema, CategorizedRemovals, ChangesetValue, OrbitalDefinition, OrbitalSchema, PageContentReduction, ResolvedEntity, ResolvedIR, ResolvedPage, ResolvedTrait, SchemaChange, type SchemaDiff, type SchemaDiffAuthor, type SchemaDiffChange, type SchemaDiffChangeset, type SchemaDiffMode, type SchemaDiffOptions, type SchemaDiffSource, type SchemaDiffSummary, SemanticSchemaChange, State, categorizeRemovals, classifyWorkflow, clearSchemaCache, detectPageContentReduction, diffOrbitalSchemas, diffSchemaSemantics, diffSchemas, getEntity, getPage, getPages, getRemovals, getSchemaCacheStats, getTrait, hasSignificantPageReduction, isDestructiveChange, requiresConfirmation, schemaToIR, summarizeOrbital, summarizeSchema };
|
package/dist/index.js
CHANGED
|
@@ -1173,6 +1173,7 @@ var OrbitalConfigSchema = z.object({
|
|
|
1173
1173
|
var OrbitalSchemaSchema = z.object({
|
|
1174
1174
|
name: z.string().min(1, "Schema name is required"),
|
|
1175
1175
|
description: z.string().optional(),
|
|
1176
|
+
summary: z.string().optional(),
|
|
1176
1177
|
version: z.string().optional(),
|
|
1177
1178
|
domainContext: DomainContextSchema.optional(),
|
|
1178
1179
|
design: DesignPreferencesSchema.optional(),
|
|
@@ -1431,20 +1432,17 @@ function isResolvedIR(ir) {
|
|
|
1431
1432
|
}
|
|
1432
1433
|
|
|
1433
1434
|
// src/resolver.ts
|
|
1434
|
-
var schemaCache = /* @__PURE__ */ new
|
|
1435
|
+
var schemaCache = /* @__PURE__ */ new WeakMap();
|
|
1435
1436
|
function clearSchemaCache() {
|
|
1436
|
-
schemaCache
|
|
1437
|
+
schemaCache = /* @__PURE__ */ new WeakMap();
|
|
1437
1438
|
}
|
|
1438
1439
|
function getSchemaCacheStats() {
|
|
1439
|
-
return {
|
|
1440
|
-
size: schemaCache.size,
|
|
1441
|
-
keys: Array.from(schemaCache.keys())
|
|
1442
|
-
};
|
|
1440
|
+
return { size: -1, keys: [] };
|
|
1443
1441
|
}
|
|
1444
1442
|
function schemaToIR(schema, useCache = true) {
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1443
|
+
if (useCache) {
|
|
1444
|
+
const cached = schemaCache.get(schema);
|
|
1445
|
+
if (cached) return cached;
|
|
1448
1446
|
}
|
|
1449
1447
|
const ir = {
|
|
1450
1448
|
appName: schema.name,
|
|
@@ -1559,7 +1557,7 @@ function schemaToIR(schema, useCache = true) {
|
|
|
1559
1557
|
}
|
|
1560
1558
|
}
|
|
1561
1559
|
if (useCache) {
|
|
1562
|
-
schemaCache.set(
|
|
1560
|
+
schemaCache.set(schema, ir);
|
|
1563
1561
|
}
|
|
1564
1562
|
return ir;
|
|
1565
1563
|
}
|
|
@@ -1972,6 +1970,140 @@ function diffSchemaSemantics(before, after) {
|
|
|
1972
1970
|
}
|
|
1973
1971
|
return changes;
|
|
1974
1972
|
}
|
|
1973
|
+
function diffOrbitalSchemas(before, after, options) {
|
|
1974
|
+
const summary = {
|
|
1975
|
+
orbitalsAdded: [],
|
|
1976
|
+
orbitalsRemoved: [],
|
|
1977
|
+
orbitalsModified: [],
|
|
1978
|
+
traitsAdded: [],
|
|
1979
|
+
traitsModified: [],
|
|
1980
|
+
traitsRemoved: []
|
|
1981
|
+
};
|
|
1982
|
+
const changes = [];
|
|
1983
|
+
if (!before) {
|
|
1984
|
+
for (const orbital of after.orbitals ?? []) {
|
|
1985
|
+
const orb = orbital;
|
|
1986
|
+
summary.orbitalsAdded.push(orb.name);
|
|
1987
|
+
changes.push({
|
|
1988
|
+
operation: "add",
|
|
1989
|
+
path: `orbitals[${summary.orbitalsAdded.length - 1}]`,
|
|
1990
|
+
value: orb
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
} else {
|
|
1994
|
+
const beforeOrbitals = /* @__PURE__ */ new Map();
|
|
1995
|
+
for (const o of before.orbitals ?? []) {
|
|
1996
|
+
const orb = o;
|
|
1997
|
+
beforeOrbitals.set(orb.name, orb);
|
|
1998
|
+
}
|
|
1999
|
+
const afterOrbitals = /* @__PURE__ */ new Map();
|
|
2000
|
+
for (const o of after.orbitals ?? []) {
|
|
2001
|
+
const orb = o;
|
|
2002
|
+
afterOrbitals.set(orb.name, orb);
|
|
2003
|
+
}
|
|
2004
|
+
let idx = 0;
|
|
2005
|
+
for (const [name, orb] of afterOrbitals) {
|
|
2006
|
+
const prev = beforeOrbitals.get(name);
|
|
2007
|
+
if (!prev) {
|
|
2008
|
+
summary.orbitalsAdded.push(name);
|
|
2009
|
+
changes.push({
|
|
2010
|
+
operation: "add",
|
|
2011
|
+
path: `orbitals[${idx}]`,
|
|
2012
|
+
value: orb
|
|
2013
|
+
});
|
|
2014
|
+
} else if (JSON.stringify(prev) !== JSON.stringify(orb)) {
|
|
2015
|
+
summary.orbitalsModified.push(name);
|
|
2016
|
+
changes.push({
|
|
2017
|
+
operation: "merge",
|
|
2018
|
+
path: `orbitals[${idx}]`,
|
|
2019
|
+
previousValue: prev,
|
|
2020
|
+
value: orb
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
2023
|
+
idx++;
|
|
2024
|
+
}
|
|
2025
|
+
for (const [name, orb] of beforeOrbitals) {
|
|
2026
|
+
if (!afterOrbitals.has(name)) {
|
|
2027
|
+
summary.orbitalsRemoved.push(name);
|
|
2028
|
+
changes.push({
|
|
2029
|
+
operation: "remove",
|
|
2030
|
+
path: `orbitals[${name}]`,
|
|
2031
|
+
previousValue: orb
|
|
2032
|
+
});
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
if (before.name !== after.name) {
|
|
2036
|
+
changes.push({
|
|
2037
|
+
operation: "set",
|
|
2038
|
+
path: "name",
|
|
2039
|
+
previousValue: before.name,
|
|
2040
|
+
value: after.name
|
|
2041
|
+
});
|
|
2042
|
+
}
|
|
2043
|
+
if (before.version !== after.version) {
|
|
2044
|
+
changes.push({
|
|
2045
|
+
operation: "set",
|
|
2046
|
+
path: "version",
|
|
2047
|
+
previousValue: before.version,
|
|
2048
|
+
value: after.version
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
if (before.description !== after.description) {
|
|
2052
|
+
changes.push({
|
|
2053
|
+
operation: "set",
|
|
2054
|
+
path: "description",
|
|
2055
|
+
previousValue: before.description,
|
|
2056
|
+
value: after.description
|
|
2057
|
+
});
|
|
2058
|
+
}
|
|
2059
|
+
if (before.summary !== after.summary) {
|
|
2060
|
+
changes.push({
|
|
2061
|
+
operation: "set",
|
|
2062
|
+
path: "summary",
|
|
2063
|
+
previousValue: before.summary,
|
|
2064
|
+
value: after.summary
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
const hasChanges = changes.length > 0;
|
|
2069
|
+
const description = describeDiff(summary, options.mode, after.name);
|
|
2070
|
+
return {
|
|
2071
|
+
hasChanges,
|
|
2072
|
+
changeCount: changes.length,
|
|
2073
|
+
changeset: {
|
|
2074
|
+
id: generateChangesetId(after.name, changes.length),
|
|
2075
|
+
source: options.source,
|
|
2076
|
+
author: options.author,
|
|
2077
|
+
description,
|
|
2078
|
+
changes
|
|
2079
|
+
},
|
|
2080
|
+
summary
|
|
2081
|
+
};
|
|
2082
|
+
}
|
|
2083
|
+
function describeDiff(summary, mode, schemaName) {
|
|
2084
|
+
const parts = [];
|
|
2085
|
+
if (summary.orbitalsAdded.length > 0) {
|
|
2086
|
+
parts.push(`+${summary.orbitalsAdded.length} orbital(s)`);
|
|
2087
|
+
}
|
|
2088
|
+
if (summary.orbitalsModified.length > 0) {
|
|
2089
|
+
parts.push(`~${summary.orbitalsModified.length} orbital(s)`);
|
|
2090
|
+
}
|
|
2091
|
+
if (summary.orbitalsRemoved.length > 0) {
|
|
2092
|
+
parts.push(`-${summary.orbitalsRemoved.length} orbital(s)`);
|
|
2093
|
+
}
|
|
2094
|
+
if (parts.length === 0) return "No changes";
|
|
2095
|
+
return `${mode === "initial" ? "Initial" : "Update"} ${schemaName}: ${parts.join(", ")}`;
|
|
2096
|
+
}
|
|
2097
|
+
function generateChangesetId(seed, count) {
|
|
2098
|
+
const cryptoApi = globalThis.crypto;
|
|
2099
|
+
if (cryptoApi?.randomUUID) return cryptoApi.randomUUID();
|
|
2100
|
+
let hash = 0;
|
|
2101
|
+
const source = `${seed}:${count}:${Date.now()}`;
|
|
2102
|
+
for (let i = 0; i < source.length; i++) {
|
|
2103
|
+
hash = hash * 31 + source.charCodeAt(i) | 0;
|
|
2104
|
+
}
|
|
2105
|
+
return `chg_${(hash >>> 0).toString(16)}_${count}`;
|
|
2106
|
+
}
|
|
1975
2107
|
|
|
1976
2108
|
// src/summarize.ts
|
|
1977
2109
|
var CRUD_STATES = /* @__PURE__ */ new Set(["browsing", "creating", "editing", "viewing", "deleting"]);
|
|
@@ -8663,6 +8795,6 @@ function buildPayloadForEdge(transition, guardCase) {
|
|
|
8663
8795
|
return {};
|
|
8664
8796
|
}
|
|
8665
8797
|
|
|
8666
|
-
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, EFFECT_REGISTRY, ENTITY_ROLES, EffectSchema, EntityCallSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FIELD_TYPE_REGISTRY, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GUARD_REGISTRY, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, KEYWORDS, Lexer, ListenSourceSchema, MULTI_WORD_KEYWORDS, 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, TokenType, TraitCategorySchema, TraitConfigSchema, TraitConfigValueSchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitFieldRefSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, applyEventWiring, applySectionUpdate, atomic, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectReachableStates, composeBehaviors, computeSchemaHash, convertDomainToSchema, convertEntitiesToDomain, convertPagesToDomain, convertSchemaToDomain, convertTraitsToDomain, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createMappingStore, createResolvedField, createTypedEventBus, deleteSection, deref, deriveCollection, despawn, detectChanges, detectLayoutStrategy, detectPageContentReduction, diffSchemaSemantics, diffSchemas, doEffects, domainKeywordToSchemaType, emit, extractPayloadFieldRef, findMapping, findMappingByPath, findMappingsByType, findService, formatBehaviorToDomain, formatBehaviorToSchema, formatDomainGuardToSchema, formatEntityToDomain, formatEntityToSchema, formatGuardConditionToDomain, formatGuardToDomain, formatGuardToSchema, formatMergeSummary, formatPageToDomain, formatPageToSchema, formatSchemaEntityToDomain, formatSchemaGuardToDomain, formatSchemaPageToDomain, formatSchemaTraitToDomain, generateDomainLanguageReference, generateSectionId, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getEffectMapping, getEntity, getFieldTypeMapping, getGuardMapping, getInteractionModelForDomain, getOperator, getPage, getPages, getRegisteredEffects, getRegisteredFieldTypes, getRegisteredGuards, getRegistryStats, getRemovals, getSchemaCacheStats, getSchemaPath, getServiceNames, getTrait, getTraitConfig, getTraitName, hasSchemaChanged, hasService, hasSignificantPageReduction, inferTsType, isBinding, isCircuitEvent, isDestructiveChange, isEffect, isEffectRegistered, isEntityCall, isEntityReference, isEntityReferenceAny, isFieldTypeRegistered, isGuardRegistered, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isServiceReferenceObject, isSingletonEntity, isSocketService, isThemeReference, isTraitFieldRef, isValidBinding, mergeDomainChunks, navigate, normalizeTraitRef, notify, parseAssetKey, parseBehavior, parseBinding, parseDomainEffect, parseDomainEffects, parseDomainGuard, parseEntity, parseEntityRef, parseGuard, parseImportedTraitRef, parseOrbitalSchema, parsePage, parsePageRef, parseSectionId, parseServiceRef, persist, ref, removeMapping, renderUI, requiresConfirmation, resolveConflict, safeParseOrbitalSchema, schemaEntityToDomainEntity, schemaPageToDomainPage, schemaToIR, schemaTraitToDomainBehavior, schemaTypeToDomainKeyword, set, sexpr, spawn, summarizeOrbital, summarizeSchema, swap, toBindingRoot, tokenize, updateMappingRange, updateSchemaHash, upsertMapping, validateAssetAnimations, validateBindingInContext, validateDomainChunk, walkSExpr, walkStatePairs, watch };
|
|
8798
|
+
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, EFFECT_REGISTRY, ENTITY_ROLES, EffectSchema, EntityCallSchema, EntityFieldSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpressionSchema, FIELD_TYPE_REGISTRY, FieldFormatSchema, FieldSchema, FieldTypeSchema, GAME_TYPES, GUARD_REGISTRY, GameSubCategorySchema, GameTypeSchema, GuardSchema, InteractionModelSchema, KEYWORDS, Lexer, ListenSourceSchema, MULTI_WORD_KEYWORDS, 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, TokenType, TraitCategorySchema, TraitConfigSchema, TraitConfigValueSchema, TraitDataEntitySchema, TraitEntityFieldSchema, TraitEventContractSchema, TraitEventListenerSchema, TraitFieldRefSchema, TraitRefSchema, TraitReferenceSchema, TraitSchema, TraitTickSchema, TransitionSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, applyEventWiring, applySectionUpdate, atomic, buildEdgeCoveringWalk, buildGuardPayloads, buildReplayPaths, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectReachableStates, composeBehaviors, computeSchemaHash, convertDomainToSchema, convertEntitiesToDomain, convertPagesToDomain, convertSchemaToDomain, convertTraitsToDomain, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createMappingStore, createResolvedField, createTypedEventBus, deleteSection, deref, deriveCollection, despawn, detectChanges, detectLayoutStrategy, detectPageContentReduction, diffOrbitalSchemas, diffSchemaSemantics, diffSchemas, doEffects, domainKeywordToSchemaType, emit, extractPayloadFieldRef, findMapping, findMappingByPath, findMappingsByType, findService, formatBehaviorToDomain, formatBehaviorToSchema, formatDomainGuardToSchema, formatEntityToDomain, formatEntityToSchema, formatGuardConditionToDomain, formatGuardToDomain, formatGuardToSchema, formatMergeSummary, formatPageToDomain, formatPageToSchema, formatSchemaEntityToDomain, formatSchemaGuardToDomain, formatSchemaPageToDomain, formatSchemaTraitToDomain, generateDomainLanguageReference, generateSectionId, getAllPatternTypes, getArgs, getBindingExamples, getDefaultAnimationsForRole, getEffectMapping, getEntity, getFieldTypeMapping, getGuardMapping, getInteractionModelForDomain, getOperator, getPage, getPages, getRegisteredEffects, getRegisteredFieldTypes, getRegisteredGuards, getRegistryStats, getRemovals, getSchemaCacheStats, getSchemaPath, getServiceNames, getTrait, getTraitConfig, getTraitName, hasSchemaChanged, hasService, hasSignificantPageReduction, inferTsType, isBinding, isCircuitEvent, isDestructiveChange, isEffect, isEffectRegistered, isEntityCall, isEntityReference, isEntityReferenceAny, isFieldTypeRegistered, isGuardRegistered, isImportedTraitRef, isInlineTrait, isMcpService, isOrbitalDefinition, isPageReference, isPageReferenceObject, isPageReferenceString, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isServiceReference, isServiceReferenceObject, isSingletonEntity, isSocketService, isThemeReference, isTraitFieldRef, isValidBinding, mergeDomainChunks, navigate, normalizeTraitRef, notify, parseAssetKey, parseBehavior, parseBinding, parseDomainEffect, parseDomainEffects, parseDomainGuard, parseEntity, parseEntityRef, parseGuard, parseImportedTraitRef, parseOrbitalSchema, parsePage, parsePageRef, parseSectionId, parseServiceRef, persist, ref, removeMapping, renderUI, requiresConfirmation, resolveConflict, safeParseOrbitalSchema, schemaEntityToDomainEntity, schemaPageToDomainPage, schemaToIR, schemaTraitToDomainBehavior, schemaTypeToDomainKeyword, set, sexpr, spawn, summarizeOrbital, summarizeSchema, swap, toBindingRoot, tokenize, updateMappingRange, updateSchemaHash, upsertMapping, validateAssetAnimations, validateBindingInContext, validateDomainChunk, walkSExpr, walkStatePairs, watch };
|
|
8667
8799
|
//# sourceMappingURL=index.js.map
|
|
8668
8800
|
//# sourceMappingURL=index.js.map
|