@almadar/core 10.55.0 → 10.57.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 +15 -3
- package/dist/builders.js +27 -2
- package/dist/builders.js.map +1 -1
- package/dist/{effect-DxD-XTI8.d.ts → effect-D-_fm4No.d.ts} +35 -6
- package/dist/{entityAccess-JTWGFDja.d.ts → entityAccess-kTNoti84.d.ts} +1 -1
- package/dist/factory/index.d.ts +4 -4
- package/dist/factory-runtime/index.d.ts +68 -15
- package/dist/factory-runtime/index.js +133 -10
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/index.d.ts +49 -10
- package/dist/index.js +352 -13
- package/dist/index.js.map +1 -1
- package/dist/mock/index.d.ts +4 -4
- package/dist/mock/index.js +1 -0
- package/dist/mock/index.js.map +1 -1
- package/dist/patterns/component-mapping.json +1 -1
- package/dist/patterns/event-contracts.json +1 -1
- package/dist/patterns/index.d.ts +187 -13
- package/dist/patterns/index.js +104 -11
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/integrators-registry.json +22 -1
- package/dist/patterns/patterns-registry.json +75 -8
- package/dist/patterns/registry.json +75 -8
- package/dist/patterns/services-registry.json +21 -0
- package/dist/{schema-0C1bXRFm.d.ts → schema-CrUFqWXN.d.ts} +468 -89
- package/dist/{trait-WnYkvPdZ.d.ts → trait-A4_OlY_l.d.ts} +20 -20
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.js +26 -3
- package/dist/types/index.js.map +1 -1
- package/dist/{types-C4YztU2N.d.ts → types-AHD31Gn-.d.ts} +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -251,6 +251,7 @@ var EntityFieldSchema = z.lazy(() => {
|
|
|
251
251
|
const baseFieldShape = {
|
|
252
252
|
name: z.string().min(1, "Field name is required").optional(),
|
|
253
253
|
required: z.boolean().optional(),
|
|
254
|
+
primaryKey: z.boolean().optional(),
|
|
254
255
|
default: JsonValueSchema.optional(),
|
|
255
256
|
min: z.number().optional(),
|
|
256
257
|
max: z.number().optional(),
|
|
@@ -887,7 +888,10 @@ var TraitEntityFieldSchema = z.object({
|
|
|
887
888
|
"url",
|
|
888
889
|
"phone",
|
|
889
890
|
"uuid",
|
|
890
|
-
"image"
|
|
891
|
+
"image",
|
|
892
|
+
"trait",
|
|
893
|
+
"slot",
|
|
894
|
+
"pattern"
|
|
891
895
|
]),
|
|
892
896
|
required: z.boolean().optional(),
|
|
893
897
|
default: TraitConfigValueSchema.optional(),
|
|
@@ -1012,7 +1016,7 @@ var TraitEventListenerSchema = z.object({
|
|
|
1012
1016
|
});
|
|
1013
1017
|
var RequiredFieldSchema = z.object({
|
|
1014
1018
|
name: z.string().min(1),
|
|
1015
|
-
type: z.enum(["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum", "email", "url", "phone", "uuid", "image"]),
|
|
1019
|
+
type: z.enum(["string", "number", "boolean", "date", "array", "object", "timestamp", "datetime", "enum", "email", "url", "phone", "uuid", "image", "trait", "slot", "pattern"]),
|
|
1016
1020
|
description: z.string().optional()
|
|
1017
1021
|
});
|
|
1018
1022
|
var TraitReferenceSchema = z.object({
|
|
@@ -1705,6 +1709,23 @@ var UseDeclarationSchema = z.object({
|
|
|
1705
1709
|
'Alias must be PascalCase (e.g., "Health", "GameCore")'
|
|
1706
1710
|
)
|
|
1707
1711
|
});
|
|
1712
|
+
var ExpectDeclarationSchema = z.discriminatedUnion("kind", [
|
|
1713
|
+
z.object({
|
|
1714
|
+
kind: z.literal("identity"),
|
|
1715
|
+
name: z.string().optional(),
|
|
1716
|
+
shape: z.array(EntityFieldSchema).optional()
|
|
1717
|
+
}),
|
|
1718
|
+
z.object({
|
|
1719
|
+
kind: z.literal("entity"),
|
|
1720
|
+
name: z.string().min(1, "Expected entity name is required"),
|
|
1721
|
+
shape: z.array(EntityFieldSchema).optional()
|
|
1722
|
+
}),
|
|
1723
|
+
z.object({
|
|
1724
|
+
kind: z.literal("event"),
|
|
1725
|
+
traitName: z.string().min(1, "Expected event trait name is required"),
|
|
1726
|
+
event: z.string().min(1, "Expected event name is required")
|
|
1727
|
+
})
|
|
1728
|
+
]);
|
|
1708
1729
|
function isEntityReference(entity) {
|
|
1709
1730
|
return typeof entity === "string";
|
|
1710
1731
|
}
|
|
@@ -1830,6 +1851,8 @@ var OrbitalDefinitionSchema = z.object({
|
|
|
1830
1851
|
visual_prompt: z.string().optional(),
|
|
1831
1852
|
// Import system
|
|
1832
1853
|
uses: z.array(UseDeclarationSchema).optional(),
|
|
1854
|
+
// Consumer-side requirement declarations (`.lolo` `expects ...`)
|
|
1855
|
+
expects: z.array(ExpectDeclarationSchema).optional(),
|
|
1833
1856
|
// Theme & Services
|
|
1834
1857
|
theme: ThemeRefSchema.optional(),
|
|
1835
1858
|
services: z.array(ServiceRefSchema).optional(),
|
|
@@ -2194,7 +2217,7 @@ function getInteractionModelForDomain(domain) {
|
|
|
2194
2217
|
// src/patterns/patterns-registry.json
|
|
2195
2218
|
var patterns_registry_default = {
|
|
2196
2219
|
version: "1.0.0",
|
|
2197
|
-
exportedAt: "2026-08-
|
|
2220
|
+
exportedAt: "2026-08-07T09:57:06.909Z",
|
|
2198
2221
|
patterns: {
|
|
2199
2222
|
"entity-table": {
|
|
2200
2223
|
type: "entity-table",
|
|
@@ -5753,14 +5776,32 @@ var patterns_registry_default = {
|
|
|
5753
5776
|
"string"
|
|
5754
5777
|
]
|
|
5755
5778
|
},
|
|
5756
|
-
|
|
5779
|
+
filterType: {
|
|
5757
5780
|
types: [
|
|
5758
5781
|
"string"
|
|
5759
5782
|
],
|
|
5760
5783
|
enumValues: [
|
|
5784
|
+
"text",
|
|
5785
|
+
"select",
|
|
5786
|
+
"toggle",
|
|
5761
5787
|
"checkbox",
|
|
5788
|
+
"date",
|
|
5789
|
+
"daterange",
|
|
5790
|
+
"date-range"
|
|
5791
|
+
]
|
|
5792
|
+
},
|
|
5793
|
+
type: {
|
|
5794
|
+
types: [
|
|
5795
|
+
"string"
|
|
5796
|
+
],
|
|
5797
|
+
enumValues: [
|
|
5798
|
+
"text",
|
|
5762
5799
|
"select",
|
|
5763
|
-
"toggle"
|
|
5800
|
+
"toggle",
|
|
5801
|
+
"checkbox",
|
|
5802
|
+
"date",
|
|
5803
|
+
"daterange",
|
|
5804
|
+
"date-range"
|
|
5764
5805
|
]
|
|
5765
5806
|
},
|
|
5766
5807
|
options: {
|
|
@@ -12219,14 +12260,32 @@ var patterns_registry_default = {
|
|
|
12219
12260
|
"string"
|
|
12220
12261
|
]
|
|
12221
12262
|
},
|
|
12222
|
-
|
|
12263
|
+
filterType: {
|
|
12223
12264
|
types: [
|
|
12224
12265
|
"string"
|
|
12225
12266
|
],
|
|
12226
12267
|
enumValues: [
|
|
12268
|
+
"text",
|
|
12269
|
+
"select",
|
|
12270
|
+
"toggle",
|
|
12227
12271
|
"checkbox",
|
|
12272
|
+
"date",
|
|
12273
|
+
"daterange",
|
|
12274
|
+
"date-range"
|
|
12275
|
+
]
|
|
12276
|
+
},
|
|
12277
|
+
type: {
|
|
12278
|
+
types: [
|
|
12279
|
+
"string"
|
|
12280
|
+
],
|
|
12281
|
+
enumValues: [
|
|
12282
|
+
"text",
|
|
12228
12283
|
"select",
|
|
12229
|
-
"toggle"
|
|
12284
|
+
"toggle",
|
|
12285
|
+
"checkbox",
|
|
12286
|
+
"date",
|
|
12287
|
+
"daterange",
|
|
12288
|
+
"date-range"
|
|
12230
12289
|
]
|
|
12231
12290
|
},
|
|
12232
12291
|
options: {
|
|
@@ -19233,6 +19292,21 @@ var patterns_registry_default = {
|
|
|
19233
19292
|
],
|
|
19234
19293
|
description: "Auto zoom-to-fit after layout settles (default true)",
|
|
19235
19294
|
default: true
|
|
19295
|
+
},
|
|
19296
|
+
layout: {
|
|
19297
|
+
types: [
|
|
19298
|
+
"string"
|
|
19299
|
+
],
|
|
19300
|
+
description: "Layout mode. force = physics simulation (default); flow = layered left-to-right process flow; tree = top-down hierarchy tiers from the roots; radial = concentric rings by depth (a pure cycle renders as a single ring). Non-force layouts are deterministic.",
|
|
19301
|
+
enumValues: [
|
|
19302
|
+
"force",
|
|
19303
|
+
"flow",
|
|
19304
|
+
"tree",
|
|
19305
|
+
"radial"
|
|
19306
|
+
],
|
|
19307
|
+
default: "force",
|
|
19308
|
+
synonyms: "layout mode, flow layout, tree layout, radial layout, hierarchy layout",
|
|
19309
|
+
tier: "domain"
|
|
19236
19310
|
}
|
|
19237
19311
|
}
|
|
19238
19312
|
},
|
|
@@ -35170,14 +35244,30 @@ var patterns_registry_default = {
|
|
|
35170
35244
|
},
|
|
35171
35245
|
range: {
|
|
35172
35246
|
types: [
|
|
35173
|
-
"function"
|
|
35247
|
+
"function",
|
|
35248
|
+
"object"
|
|
35249
|
+
],
|
|
35250
|
+
properties: {
|
|
35251
|
+
from: {
|
|
35252
|
+
types: [
|
|
35253
|
+
"string"
|
|
35254
|
+
]
|
|
35255
|
+
},
|
|
35256
|
+
to: {
|
|
35257
|
+
types: [
|
|
35258
|
+
"string"
|
|
35259
|
+
]
|
|
35260
|
+
}
|
|
35261
|
+
},
|
|
35262
|
+
required: [
|
|
35263
|
+
"from",
|
|
35264
|
+
"to"
|
|
35174
35265
|
]
|
|
35175
35266
|
}
|
|
35176
35267
|
},
|
|
35177
35268
|
required: [
|
|
35178
35269
|
"label",
|
|
35179
|
-
"value"
|
|
35180
|
-
"range"
|
|
35270
|
+
"value"
|
|
35181
35271
|
]
|
|
35182
35272
|
}
|
|
35183
35273
|
},
|
|
@@ -45097,6 +45187,27 @@ var integrators_registry_default = {
|
|
|
45097
45187
|
summary: "string",
|
|
45098
45188
|
keyPoints: "array"
|
|
45099
45189
|
}
|
|
45190
|
+
},
|
|
45191
|
+
{
|
|
45192
|
+
name: "embed",
|
|
45193
|
+
description: "Generate embeddings for an array of texts",
|
|
45194
|
+
params: [
|
|
45195
|
+
{
|
|
45196
|
+
name: "texts",
|
|
45197
|
+
type: "string[]",
|
|
45198
|
+
required: true,
|
|
45199
|
+
description: "Texts to embed"
|
|
45200
|
+
},
|
|
45201
|
+
{
|
|
45202
|
+
name: "model",
|
|
45203
|
+
type: "string",
|
|
45204
|
+
required: false,
|
|
45205
|
+
description: "Embedding model ID"
|
|
45206
|
+
}
|
|
45207
|
+
],
|
|
45208
|
+
responseShape: {
|
|
45209
|
+
embeddings: "array"
|
|
45210
|
+
}
|
|
45100
45211
|
}
|
|
45101
45212
|
]
|
|
45102
45213
|
},
|
|
@@ -45617,7 +45728,7 @@ var integrators_registry_default = {
|
|
|
45617
45728
|
// src/patterns/component-mapping.json
|
|
45618
45729
|
var component_mapping_default = {
|
|
45619
45730
|
version: "1.0.0",
|
|
45620
|
-
exportedAt: "2026-08-
|
|
45731
|
+
exportedAt: "2026-08-07T09:57:06.909Z",
|
|
45621
45732
|
mappings: {
|
|
45622
45733
|
"page-header": {
|
|
45623
45734
|
component: "PageHeader",
|
|
@@ -47012,7 +47123,7 @@ var component_mapping_default = {
|
|
|
47012
47123
|
// src/patterns/event-contracts.json
|
|
47013
47124
|
var event_contracts_default = {
|
|
47014
47125
|
version: "1.0.0",
|
|
47015
|
-
exportedAt: "2026-08-
|
|
47126
|
+
exportedAt: "2026-08-07T09:57:06.909Z",
|
|
47016
47127
|
contracts: {
|
|
47017
47128
|
form: {
|
|
47018
47129
|
emits: [
|
|
@@ -48891,6 +49002,11 @@ function eventKeyPropsOf(patternType) {
|
|
|
48891
49002
|
eventKeyPropsCache.set(patternType, out);
|
|
48892
49003
|
return out;
|
|
48893
49004
|
}
|
|
49005
|
+
function isValueInputPattern(patternType) {
|
|
49006
|
+
const propsSchema = getPatternDefinition(patternType)?.propsSchema;
|
|
49007
|
+
if (!propsSchema || !("value" in propsSchema)) return false;
|
|
49008
|
+
return eventKeyPropsOf(patternType).size > 0;
|
|
49009
|
+
}
|
|
48894
49010
|
function eventListPropsOf(patternType) {
|
|
48895
49011
|
const cached = eventListPropsCache.get(patternType);
|
|
48896
49012
|
if (cached) return cached;
|
|
@@ -52200,6 +52316,229 @@ function entityAccessPolicies(schema, entityName) {
|
|
|
52200
52316
|
return entityAccessTable(schema).get(entityName);
|
|
52201
52317
|
}
|
|
52202
52318
|
|
|
52319
|
+
// src/derive-expectations.ts
|
|
52320
|
+
function inlineEntitiesOf(orbital) {
|
|
52321
|
+
const out = [];
|
|
52322
|
+
const refs = [orbital.entity, ...orbital.auxiliaryEntities ?? []];
|
|
52323
|
+
for (const ref2 of refs) {
|
|
52324
|
+
if (typeof ref2 === "object" && ref2 !== null && "fields" in ref2) {
|
|
52325
|
+
out.push(ref2);
|
|
52326
|
+
}
|
|
52327
|
+
}
|
|
52328
|
+
return out;
|
|
52329
|
+
}
|
|
52330
|
+
function walkSExprData(node, visit) {
|
|
52331
|
+
visit(node);
|
|
52332
|
+
if (node === null || typeof node !== "object") return;
|
|
52333
|
+
const children = Array.isArray(node) ? node : Object.values(node);
|
|
52334
|
+
for (const child of children) walkSExprData(child, visit);
|
|
52335
|
+
}
|
|
52336
|
+
function collectPersistPayloadKeys(data, out) {
|
|
52337
|
+
if (Array.isArray(data)) {
|
|
52338
|
+
for (const child of data) collectPersistPayloadKeys(child, out);
|
|
52339
|
+
return;
|
|
52340
|
+
}
|
|
52341
|
+
if (data !== null && typeof data === "object") {
|
|
52342
|
+
for (const key of Object.keys(data)) out.add(key);
|
|
52343
|
+
}
|
|
52344
|
+
}
|
|
52345
|
+
function isPlainString(value) {
|
|
52346
|
+
return typeof value === "string" && !value.startsWith("@");
|
|
52347
|
+
}
|
|
52348
|
+
function deriveExpectations(schema, orbitalName) {
|
|
52349
|
+
const diagnostics = [];
|
|
52350
|
+
const orbital = schema.orbitals.find((o) => o.name === orbitalName);
|
|
52351
|
+
if (orbital === void 0) {
|
|
52352
|
+
return { expectations: [], diagnostics: [{ kind: "unknown-orbital", orbital: orbitalName }] };
|
|
52353
|
+
}
|
|
52354
|
+
const ownerByEntity = /* @__PURE__ */ new Map();
|
|
52355
|
+
const defByEntity = /* @__PURE__ */ new Map();
|
|
52356
|
+
let identityDef;
|
|
52357
|
+
for (const o of schema.orbitals) {
|
|
52358
|
+
for (const def of inlineEntitiesOf(o)) {
|
|
52359
|
+
if (!ownerByEntity.has(def.name)) {
|
|
52360
|
+
ownerByEntity.set(def.name, o.name);
|
|
52361
|
+
defByEntity.set(def.name, def);
|
|
52362
|
+
}
|
|
52363
|
+
if (def.identity === true && identityDef === void 0) identityDef = def;
|
|
52364
|
+
}
|
|
52365
|
+
}
|
|
52366
|
+
const ownDefs = inlineEntitiesOf(orbital);
|
|
52367
|
+
const ownEntityNames = new Set(ownDefs.map((d) => d.name));
|
|
52368
|
+
const userFields = /* @__PURE__ */ new Set();
|
|
52369
|
+
const entityRefs = /* @__PURE__ */ new Map();
|
|
52370
|
+
const addEntityRef = (name, field) => {
|
|
52371
|
+
if (ownEntityNames.has(name)) return;
|
|
52372
|
+
const owner = ownerByEntity.get(name);
|
|
52373
|
+
if (owner === void 0 || owner === orbitalName) return;
|
|
52374
|
+
let fields = entityRefs.get(name);
|
|
52375
|
+
if (fields === void 0) {
|
|
52376
|
+
fields = /* @__PURE__ */ new Set();
|
|
52377
|
+
entityRefs.set(name, fields);
|
|
52378
|
+
}
|
|
52379
|
+
if (field !== void 0) fields.add(field);
|
|
52380
|
+
};
|
|
52381
|
+
const visitExpr = (node) => {
|
|
52382
|
+
if (typeof node === "string") {
|
|
52383
|
+
const parsed = node.startsWith("@") ? parseBinding(node) : null;
|
|
52384
|
+
if (parsed === null) return;
|
|
52385
|
+
if (parsed.root === "user") {
|
|
52386
|
+
if (parsed.path.length > 0) userFields.add(parsed.path[0]);
|
|
52387
|
+
return;
|
|
52388
|
+
}
|
|
52389
|
+
if (parsed.root === "entity" && parsed.path.length >= 2) {
|
|
52390
|
+
const relName = parsed.path[0];
|
|
52391
|
+
for (const def of ownDefs) {
|
|
52392
|
+
const rel = (def.fields ?? []).find(
|
|
52393
|
+
(f) => f.name === relName && f.type === "relation"
|
|
52394
|
+
);
|
|
52395
|
+
if (rel !== void 0 && rel.type === "relation") {
|
|
52396
|
+
addEntityRef(rel.relation.entity, parsed.path[1]);
|
|
52397
|
+
}
|
|
52398
|
+
}
|
|
52399
|
+
return;
|
|
52400
|
+
}
|
|
52401
|
+
if (parsed.type === "entity") {
|
|
52402
|
+
addEntityRef(parsed.root, parsed.path[0]);
|
|
52403
|
+
}
|
|
52404
|
+
return;
|
|
52405
|
+
}
|
|
52406
|
+
if (Array.isArray(node) && node.length > 0 && node[0] === "persist") {
|
|
52407
|
+
const target = node[2];
|
|
52408
|
+
if (target !== void 0 && isPlainString(target)) {
|
|
52409
|
+
addEntityRef(target);
|
|
52410
|
+
const data = node[3];
|
|
52411
|
+
if (data !== void 0 && typeof data !== "string") {
|
|
52412
|
+
const keys = /* @__PURE__ */ new Set();
|
|
52413
|
+
collectPersistPayloadKeys(data, keys);
|
|
52414
|
+
for (const key of keys) addEntityRef(target, key);
|
|
52415
|
+
}
|
|
52416
|
+
}
|
|
52417
|
+
return;
|
|
52418
|
+
}
|
|
52419
|
+
if (Array.isArray(node) && node.length > 0 && node[0] === "fetch") {
|
|
52420
|
+
const target = node[1];
|
|
52421
|
+
if (target !== void 0 && isPlainString(target)) {
|
|
52422
|
+
addEntityRef(target);
|
|
52423
|
+
const options = node[2];
|
|
52424
|
+
if (options !== void 0 && !Array.isArray(options) && typeof options === "object" && options !== null) {
|
|
52425
|
+
const include = options["include"];
|
|
52426
|
+
if (Array.isArray(include)) {
|
|
52427
|
+
for (const item of include) {
|
|
52428
|
+
if (typeof item === "string") addEntityRef(target, item);
|
|
52429
|
+
}
|
|
52430
|
+
}
|
|
52431
|
+
}
|
|
52432
|
+
}
|
|
52433
|
+
}
|
|
52434
|
+
};
|
|
52435
|
+
const walk = (expr) => {
|
|
52436
|
+
if (expr === null || expr === void 0) return;
|
|
52437
|
+
walkSExprData(expr, visitExpr);
|
|
52438
|
+
};
|
|
52439
|
+
const walkConfig = (config) => {
|
|
52440
|
+
if (config === void 0) return;
|
|
52441
|
+
for (const entry of Object.values(config)) {
|
|
52442
|
+
const value = isCallSiteConfigDeclaration(entry) ? entry.default : entry;
|
|
52443
|
+
if (value !== void 0) walkSExprData(value, visitExpr);
|
|
52444
|
+
}
|
|
52445
|
+
};
|
|
52446
|
+
for (const def of ownDefs) {
|
|
52447
|
+
walk(def.read_policy);
|
|
52448
|
+
walk(def.create_policy);
|
|
52449
|
+
walk(def.update_policy);
|
|
52450
|
+
walk(def.delete_policy);
|
|
52451
|
+
}
|
|
52452
|
+
for (const def of ownDefs) {
|
|
52453
|
+
for (const field of def.fields ?? []) {
|
|
52454
|
+
if (field.type === "relation" && field.name !== void 0) {
|
|
52455
|
+
addEntityRef(field.relation.entity);
|
|
52456
|
+
}
|
|
52457
|
+
}
|
|
52458
|
+
}
|
|
52459
|
+
const walkTraitRef = (t) => {
|
|
52460
|
+
if (typeof t === "string") return;
|
|
52461
|
+
if (!isInlineTrait(t)) {
|
|
52462
|
+
if (t.linkedEntity !== void 0) addEntityRef(t.linkedEntity);
|
|
52463
|
+
walkConfig(t.config);
|
|
52464
|
+
return;
|
|
52465
|
+
}
|
|
52466
|
+
if (t.linkedEntity !== void 0) addEntityRef(t.linkedEntity);
|
|
52467
|
+
walkConfig(t.config);
|
|
52468
|
+
const sm = t.stateMachine;
|
|
52469
|
+
if (sm !== void 0) {
|
|
52470
|
+
for (const g of sm.guards ?? []) walk(g.expression);
|
|
52471
|
+
for (const tr of sm.transitions) {
|
|
52472
|
+
walk(tr.guard);
|
|
52473
|
+
for (const eff of tr.effects ?? []) walk(eff);
|
|
52474
|
+
}
|
|
52475
|
+
}
|
|
52476
|
+
for (const eff of t.initialEffects ?? []) walk(eff);
|
|
52477
|
+
for (const tick of t.ticks ?? []) {
|
|
52478
|
+
walk(tick.guard);
|
|
52479
|
+
for (const eff of tick.effects) walk(eff);
|
|
52480
|
+
}
|
|
52481
|
+
for (const listener of t.listens ?? []) {
|
|
52482
|
+
walk(listener.guard);
|
|
52483
|
+
for (const value of Object.values(listener.payloadMapping ?? {})) walk(value);
|
|
52484
|
+
}
|
|
52485
|
+
};
|
|
52486
|
+
for (const t of orbital.traits) walkTraitRef(t);
|
|
52487
|
+
const expectations = [];
|
|
52488
|
+
if (identityDef !== void 0 && userFields.size > 0) {
|
|
52489
|
+
const alsoReferenced = entityRefs.get(identityDef.name);
|
|
52490
|
+
if (alsoReferenced !== void 0) {
|
|
52491
|
+
for (const field of alsoReferenced) userFields.add(field);
|
|
52492
|
+
entityRefs.delete(identityDef.name);
|
|
52493
|
+
}
|
|
52494
|
+
}
|
|
52495
|
+
if (userFields.size > 0) {
|
|
52496
|
+
const shape = [];
|
|
52497
|
+
for (const field of [...userFields].sort()) {
|
|
52498
|
+
const declared = identityDef?.fields.find((f) => f.name === field);
|
|
52499
|
+
if (declared !== void 0) {
|
|
52500
|
+
shape.push({ ...declared });
|
|
52501
|
+
} else {
|
|
52502
|
+
diagnostics.push({
|
|
52503
|
+
kind: "identity-field-not-declared",
|
|
52504
|
+
orbital: orbitalName,
|
|
52505
|
+
entity: identityDef?.name,
|
|
52506
|
+
field
|
|
52507
|
+
});
|
|
52508
|
+
}
|
|
52509
|
+
}
|
|
52510
|
+
expectations.push({
|
|
52511
|
+
kind: "identity",
|
|
52512
|
+
...identityDef !== void 0 ? { name: identityDef.name } : {},
|
|
52513
|
+
...shape.length > 0 ? { shape } : {}
|
|
52514
|
+
});
|
|
52515
|
+
}
|
|
52516
|
+
for (const name of [...entityRefs.keys()].sort()) {
|
|
52517
|
+
const referenced = entityRefs.get(name) ?? /* @__PURE__ */ new Set();
|
|
52518
|
+
const provider = defByEntity.get(name);
|
|
52519
|
+
const shape = [];
|
|
52520
|
+
for (const field of [...referenced].sort()) {
|
|
52521
|
+
const declared = provider?.fields.find((f) => f.name === field);
|
|
52522
|
+
if (declared !== void 0) {
|
|
52523
|
+
shape.push({ ...declared });
|
|
52524
|
+
} else {
|
|
52525
|
+
diagnostics.push({
|
|
52526
|
+
kind: "entity-field-not-declared",
|
|
52527
|
+
orbital: orbitalName,
|
|
52528
|
+
entity: name,
|
|
52529
|
+
field
|
|
52530
|
+
});
|
|
52531
|
+
}
|
|
52532
|
+
}
|
|
52533
|
+
expectations.push({
|
|
52534
|
+
kind: "entity",
|
|
52535
|
+
name,
|
|
52536
|
+
...shape.length > 0 ? { shape } : {}
|
|
52537
|
+
});
|
|
52538
|
+
}
|
|
52539
|
+
return { expectations, diagnostics };
|
|
52540
|
+
}
|
|
52541
|
+
|
|
52203
52542
|
// src/shared-entity/merge.ts
|
|
52204
52543
|
function mergeEntityFrame(current, orderedWrites) {
|
|
52205
52544
|
if (orderedWrites.length === 0) return current;
|
|
@@ -52210,6 +52549,6 @@ function mergeEntityFrame(current, orderedWrites) {
|
|
|
52210
52549
|
return next;
|
|
52211
52550
|
}
|
|
52212
52551
|
|
|
52213
|
-
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, COMPONENT_MAPPING, CONFIG_REF_EVENT_PATTERN, CORE_BINDINGS, CameraModeSchema, CameraSchema, ColorSliceSchema, ColorTokensSchema, ComputedEventContractSchema, ComputedEventListenerSchema, ConfigFieldDeclarationSchema, ConfigProvenanceRecordSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DEFAULT_VIEWER, DEV_TOKEN_PREFIX, DeclaredTraitConfigSchema, DensitySliceSchema, DensityTokensSchema, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EVENT_CONTRACTS, 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, INTEGRATORS_REGISTRY, IconFamilySchema, IconographySliceSchema, IconographyTokensSchema, IdentityLedgerSchema, IllustrationSliceSchema, IllustrationStyleSchema, IllustrationTokensSchema, InteractionModelSchema, KNOWN_VALIDATION_ERROR_CODES, LedgerEntrySchema, LedgerKindSchema, ListenSourceSchema, McpServiceDefSchema, MotionDurationKeySchema, MotionDurationPaletteSchema, MotionEasingKeySchema, MotionEasingPaletteSchema, MotionIntentMapSchema, MotionIntentSchema, MotionSliceSchema, MotionTokensSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalIdSchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PATTERN_REGISTRY, PATTERN_TYPES, PageIdSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PaletteEntryIdSchema, PatternTypeSchema, PayloadFieldSchema, REFERENCE_CONFIG_TYPES, RENDER_BINDING_MARKER, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, RestAuthConfigSchema, RestServiceDefSchema, SECRET_CONFIG_TYPES, SEMANTIC_STRING_TYPES, SERVICE_TYPES, SExprAtomSchema, SExprDataSchema, SExprSchema, SHEET_PROJECTIONS, SPRITE_DIRECTIONS, ScenePosSchema, SchemaMetadataSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceIdSchema, ServiceRefObjectSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SheetProjectionSchema, 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, TraitUIBindingSchema, TransitionSchema, TypeIntentMapSchema, TypeIntentSchema, TypeScaleEntrySchema, TypeScaleSchema, TypeScaleTokensSchema, TypeSizeKeySchema, TypeSliceSchema, TypeSlotSchema, TypeWeightSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, answerToMutations, answersToMutations, applyEventWiring, applyFactoryCallPlanMutation, applyListenPayloadMapping, applyRenderOverlay, asEntityId, asEventId, asOrbitalId, asPageId, asPaletteEntryId, asServiceId, asThemeId, asTraitId, atomic, buildEdgeCoveringWalk, buildGuardPayloads, buildRecommendationContext, buildReplayPaths, buildResolvedTraitConfigs, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectEmbeddedTraitReferrers, collectReachableStates, collectRenderUiPatternTypes, collectTraitConfigRefAdjacency, collectTraitEmbedAdjacency, component_mapping_default as componentMapping, composeBehaviors, configRefEventKnob, constTruth, containsEntityBinding, containsPayloadBinding, contractFieldName, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, decodeDevIdentityToken, deref, deriveCollection, deriveInputType, describeTensorMismatch, despawn, detectLayoutStrategy, detectPageContentReduction, diffFactoryCalls, diffOrbitalSchemas, diffSchemaSemantics, diffSchemas, doEffects, emit, encodeDevIdentityToken, entityAccessPolicies, entityAccessTable, event_contracts_default as eventContracts, eventKeyPropsOf, eventListPropsOf, extractPayloadFieldRef, findCompatiblePatterns, findPersonaInRoster, findService, fingerprintNode, formatRecommendationsForPrompt, gatherTensorLastDim, generatePatternDescription, generateQuestions, getAllPatternTypes, getArgs, getBindingExamples, getComponentForPattern, getDefaultAnimationsForRole, getEmittedEvents, getEntity, getEntityCardinality, getInteractionModelForDomain, getOperator, getOrbAllowedPatterns, getOrbAllowedPatternsCompact, getOrbAllowedPatternsFiltered, getOrbAllowedPatternsSlim, getPage, getPages, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, getRemovals, getSchemaCacheStats, getServiceNames, getTrait, getTraitConfig, getTraitName, hasService, hasSignificantPageReduction, idKindOf, idPrefix, inferTsType, insertChildAtPath, integrators_registry_default as integratorsRegistry, isBinding, isCallSiteConfigDeclaration, isCircuitEvent, isContentBodyPattern, isContentBodyPatternType, isContentMainWriter, isDestructiveChange, isDrawHostPattern, isDrawablePattern, isEffect, isEmailValue, isEntityAwarePattern, isEntityCall, isEntityId, isEntityReference, isEntityReferenceAny, isEventId, isEventPayloadValue, isFieldValue, isImportedTraitRef, isInlineTrait, isJsonArray, isJsonObject, isJsonPrimitive, isKnownValidationErrorCode, isMainSlotRenderUi, isMcpService, isOrbitalDefinition, isOrbitalId, isPageId, isPageReference, isPageReferenceObject, isPageReferenceString, isPaletteEntryId, isPhoneValue, isPlanSnapshot, isReferenceConfigType, isRenderBindingMarker, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isSecretConfigType, isSemanticStringType, isSemanticStringValue, isServiceId, isServiceReference, isServiceReferenceObject, isSessionHistoryEntry, isSocketService, isTensorValue, isThemeId, isThemeReference, isTraitFieldRef, isTraitId, isUrlValue, isUuidValue, isValidBinding, isValidPatternType, ledgerCurName, ledgerRename, ledgerResolveName, mapTensorLastDim, mergeEntityFrame, mintId, navigate, navigatePatternPath, normalizeCallSiteConfigToValues, normalizeTraitRef, normalizeUserContext, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, patterns_registry_default as patternsRegistry, persist, persistenceModeAllowsOverrides, personaFromIdentityRow, recommendPatterns, reduceToOwners, ref, registry, removeChildAtPath, renderUI, renderUiPatternTypesOf, replaceChildAtPath, requiresConfirmation, resolveConfigRefEventName, resolveContentOwners, resolveDefaultViewer, resolvePageContentOwner, resolvePersonaSpec, safeParseOrbitalSchema, schemaToIR, set, setPropAtPath, sexpr, spawn, summarizeOrbital, summarizeSchema, swap, tensorLastDimSize, tensorShape, toBindingRoot, traitDeclaresConfigForward, translateOverlaysToParams, validateAssetAnimations, validateBindingInContext, validateContract, walkSExpr, walkStatePairs, watch, widenTier };
|
|
52552
|
+
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, COMPONENT_MAPPING, CONFIG_REF_EVENT_PATTERN, CORE_BINDINGS, CameraModeSchema, CameraSchema, ColorSliceSchema, ColorTokensSchema, ComputedEventContractSchema, ComputedEventListenerSchema, ConfigFieldDeclarationSchema, ConfigProvenanceRecordSchema, CustomPatternDefinitionSchema, CustomPatternMapSchema, DEFAULT_INTERACTION_MODELS, DEFAULT_VIEWER, DEV_TOKEN_PREFIX, DeclaredTraitConfigSchema, DensitySliceSchema, DensityTokensSchema, DesignPreferencesSchema, DesignTokensSchema, DomainCategorySchema, DomainContextSchema, DomainVocabularySchema, ENTITY_ROLES, EVENT_CONTRACTS, EffectSchema, ElevationSliceSchema, ElevationTokensSchema, EntityCallSchema, EntityFieldContractSchema, EntityFieldSchema, EntityIdSchema, EntityPersistenceSchema, EntityRefSchema, EntityRefStringSchema, EntityRoleSchema, EntitySchema, EntitySemanticRoleSchema, EventIdSchema, EventListenerSchema, EventPayloadFieldSchema, EventSchema, EventScopeSchema, EventSemanticRoleSchema, EventSourceSchema, ExpectDeclarationSchema, ExpressionSchema, FIELD_TYPES, FieldSchema, FieldTypeSchema, GameSubCategorySchema, GeometrySliceSchema, GeometryTokensSchema, GuardSchema, INTEGRATORS_REGISTRY, IconFamilySchema, IconographySliceSchema, IconographyTokensSchema, IdentityLedgerSchema, IllustrationSliceSchema, IllustrationStyleSchema, IllustrationTokensSchema, InteractionModelSchema, KNOWN_VALIDATION_ERROR_CODES, LedgerEntrySchema, LedgerKindSchema, ListenSourceSchema, McpServiceDefSchema, MotionDurationKeySchema, MotionDurationPaletteSchema, MotionEasingKeySchema, MotionEasingPaletteSchema, MotionIntentMapSchema, MotionIntentSchema, MotionSliceSchema, MotionTokensSchema, NodeClassificationSchema, OrbitalConfigSchema, OrbitalDefinitionSchema, OrbitalEntitySchema, OrbitalIdSchema, OrbitalPageSchema, OrbitalPageStrictSchema, OrbitalSchemaSchema, OrbitalTraitRefSchema, OrbitalUnitSchema, OrbitalSchema as OrbitalZodSchema, PATTERN_REGISTRY, PATTERN_TYPES, PageIdSchema, PageRefObjectSchema, PageRefSchema, PageRefStringSchema, PageSchema, PageTraitRefSchema, PaletteEntryIdSchema, PatternTypeSchema, PayloadFieldSchema, REFERENCE_CONFIG_TYPES, RENDER_BINDING_MARKER, RelatedLinkSchema, RelationConfigSchema, RequiredFieldSchema, RestAuthConfigSchema, RestServiceDefSchema, SECRET_CONFIG_TYPES, SEMANTIC_STRING_TYPES, SERVICE_TYPES, SExprAtomSchema, SExprDataSchema, SExprSchema, SHEET_PROJECTIONS, SPRITE_DIRECTIONS, ScenePosSchema, SchemaMetadataSchema, SemanticAssetRefSchema, ServiceDefinitionSchema, ServiceIdSchema, ServiceRefObjectSchema, ServiceRefSchema, ServiceRefStringSchema, ServiceTypeSchema, SheetProjectionSchema, 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, TraitUIBindingSchema, TransitionSchema, TypeIntentMapSchema, TypeIntentSchema, TypeScaleEntrySchema, TypeScaleSchema, TypeScaleTokensSchema, TypeSizeKeySchema, TypeSliceSchema, TypeSlotSchema, TypeWeightSchema, UISlotSchema, UI_SLOTS, UXHintsSchema, UseDeclarationSchema, UserPersonaSchema, VISUAL_STYLES, ViewTypeSchema, VisualStyleSchema, answerToMutations, answersToMutations, applyEventWiring, applyFactoryCallPlanMutation, applyListenPayloadMapping, applyRenderOverlay, asEntityId, asEventId, asOrbitalId, asPageId, asPaletteEntryId, asServiceId, asThemeId, asTraitId, atomic, buildEdgeCoveringWalk, buildGuardPayloads, buildRecommendationContext, buildReplayPaths, buildResolvedTraitConfigs, buildStateGraph, callService, categorizeRemovals, classifyWorkflow, clearSchemaCache, collectBindings, collectEmbeddedTraitReferrers, collectReachableStates, collectRenderUiPatternTypes, collectTraitConfigRefAdjacency, collectTraitEmbedAdjacency, component_mapping_default as componentMapping, composeBehaviors, configRefEventKnob, constTruth, containsEntityBinding, containsPayloadBinding, contractFieldName, createAssetKey, createEmptyResolvedPage, createEmptyResolvedTrait, createLazyService, createResolvedField, createTypedEventBus, decodeDevIdentityToken, deref, deriveCollection, deriveExpectations, deriveInputType, describeTensorMismatch, despawn, detectLayoutStrategy, detectPageContentReduction, diffFactoryCalls, diffOrbitalSchemas, diffSchemaSemantics, diffSchemas, doEffects, emit, encodeDevIdentityToken, entityAccessPolicies, entityAccessTable, event_contracts_default as eventContracts, eventKeyPropsOf, eventListPropsOf, extractPayloadFieldRef, findCompatiblePatterns, findPersonaInRoster, findService, fingerprintNode, formatRecommendationsForPrompt, gatherTensorLastDim, generatePatternDescription, generateQuestions, getAllPatternTypes, getArgs, getBindingExamples, getComponentForPattern, getDefaultAnimationsForRole, getEmittedEvents, getEntity, getEntityCardinality, getInteractionModelForDomain, getOperator, getOrbAllowedPatterns, getOrbAllowedPatternsCompact, getOrbAllowedPatternsFiltered, getOrbAllowedPatternsSlim, getPage, getPages, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, getRemovals, getSchemaCacheStats, getServiceNames, getTrait, getTraitConfig, getTraitName, hasService, hasSignificantPageReduction, idKindOf, idPrefix, inferTsType, insertChildAtPath, integrators_registry_default as integratorsRegistry, isBinding, isCallSiteConfigDeclaration, isCircuitEvent, isContentBodyPattern, isContentBodyPatternType, isContentMainWriter, isDestructiveChange, isDrawHostPattern, isDrawablePattern, isEffect, isEmailValue, isEntityAwarePattern, isEntityCall, isEntityId, isEntityReference, isEntityReferenceAny, isEventId, isEventPayloadValue, isFieldValue, isImportedTraitRef, isInlineTrait, isJsonArray, isJsonObject, isJsonPrimitive, isKnownValidationErrorCode, isMainSlotRenderUi, isMcpService, isOrbitalDefinition, isOrbitalId, isPageId, isPageReference, isPageReferenceObject, isPageReferenceString, isPaletteEntryId, isPhoneValue, isPlanSnapshot, isReferenceConfigType, isRenderBindingMarker, isResolvedIR, isRestService, isRuntimeEntity, isSExpr, isSExprAtom, isSExprCall, isSExprEffect, isSecretConfigType, isSemanticStringType, isSemanticStringValue, isServiceId, isServiceReference, isServiceReferenceObject, isSessionHistoryEntry, isSocketService, isTensorValue, isThemeId, isThemeReference, isTraitFieldRef, isTraitId, isUrlValue, isUuidValue, isValidBinding, isValidPatternType, isValueInputPattern, ledgerCurName, ledgerRename, ledgerResolveName, mapTensorLastDim, mergeEntityFrame, mintId, navigate, navigatePatternPath, normalizeCallSiteConfigToValues, normalizeTraitRef, normalizeUserContext, notify, parseAssetKey, parseBinding, parseEntityRef, parseImportedTraitRef, parseOrbitalSchema, parsePageRef, parseServiceRef, patterns_registry_default as patternsRegistry, persist, persistenceModeAllowsOverrides, personaFromIdentityRow, recommendPatterns, reduceToOwners, ref, registry, removeChildAtPath, renderUI, renderUiPatternTypesOf, replaceChildAtPath, requiresConfirmation, resolveConfigRefEventName, resolveContentOwners, resolveDefaultViewer, resolvePageContentOwner, resolvePersonaSpec, safeParseOrbitalSchema, schemaToIR, set, setPropAtPath, sexpr, spawn, summarizeOrbital, summarizeSchema, swap, tensorLastDimSize, tensorShape, toBindingRoot, traitDeclaresConfigForward, translateOverlaysToParams, validateAssetAnimations, validateBindingInContext, validateContract, walkSExpr, walkStatePairs, watch, widenTier };
|
|
52214
52553
|
//# sourceMappingURL=index.js.map
|
|
52215
52554
|
//# sourceMappingURL=index.js.map
|