@almadar/core 10.129.0 → 11.0.1
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/behavior-package.d.ts +49 -11
- package/dist/behavior-package.js +1 -1
- package/dist/{orbital-CkFdDS9f.d.ts → builders-BdgbY7Th.d.ts} +5828 -6917
- package/dist/builders.d.ts +6 -6
- package/dist/builders.js +7 -6
- package/dist/{bus-CcbB__oo.d.ts → bus-C0hFDNFR.d.ts} +262 -354
- package/dist/chunk-347APWFM.js +286 -0
- package/dist/chunk-347APWFM.js.map +1 -0
- package/dist/chunk-5WQ3U7NJ.js +2363 -0
- package/dist/chunk-5WQ3U7NJ.js.map +1 -0
- package/dist/chunk-5YTPYMPZ.js +99 -0
- package/dist/chunk-5YTPYMPZ.js.map +1 -0
- package/dist/chunk-66Q5VX2F.js +3810 -0
- package/dist/chunk-66Q5VX2F.js.map +1 -0
- package/dist/chunk-7GHJU5WI.js +39 -0
- package/dist/chunk-7GHJU5WI.js.map +1 -0
- package/dist/chunk-B4MNHGBP.js +8 -0
- package/dist/chunk-B4MNHGBP.js.map +1 -0
- package/dist/chunk-E4T2MQAV.js +24 -0
- package/dist/chunk-E4T2MQAV.js.map +1 -0
- package/dist/chunk-ENOCKYGA.js +412 -0
- package/dist/chunk-ENOCKYGA.js.map +1 -0
- package/dist/chunk-FGT5OS2Y.js +918 -0
- package/dist/chunk-FGT5OS2Y.js.map +1 -0
- package/dist/chunk-GF7KCLNR.js +3284 -0
- package/dist/chunk-GF7KCLNR.js.map +1 -0
- package/dist/chunk-PNGFWLHD.js +1567 -0
- package/dist/chunk-PNGFWLHD.js.map +1 -0
- package/dist/{chunk-X4SC7FGF.js → chunk-RGACZEYC.js} +99 -96
- package/dist/chunk-RGACZEYC.js.map +1 -0
- package/dist/{chunk-RYPVOI6H.js → chunk-SNZYN7UA.js} +2541 -433
- package/dist/{chunk-RYPVOI6H.js.map → chunk-SNZYN7UA.js.map} +1 -1
- package/dist/{chunk-KDMV222Q.js → chunk-TDNQT3M3.js} +304 -373
- package/dist/chunk-TDNQT3M3.js.map +1 -0
- package/dist/chunk-VG7BRFUD.js +152 -0
- package/dist/chunk-VG7BRFUD.js.map +1 -0
- package/dist/chunk-Z7BI7DE7.js +1293 -0
- package/dist/chunk-Z7BI7DE7.js.map +1 -0
- package/dist/{domain-Dz3jP-UM.d.ts → domain-Cpmja5ak.d.ts} +55 -55
- package/dist/{effect-CiEVLsZz.d.ts → effect-DZaXwSAz.d.ts} +283 -453
- package/dist/{effect-result-Bebwu9yT.d.ts → effect-result-1HpXgeBc.d.ts} +656 -851
- package/dist/{expression-D0Fs0riG.d.ts → expression-DirYKz-f.d.ts} +5 -13
- package/dist/factory/index.d.ts +7 -144
- package/dist/factory/index.js +8 -8
- package/dist/factory-runtime/index.d.ts +7 -6
- package/dist/factory-runtime/index.js +527 -8
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/fixtures.d.ts +9 -11
- package/dist/fixtures.js +12 -8
- package/dist/fixtures.js.map +1 -1
- package/dist/i18n/index.d.ts +15 -19
- package/dist/i18n/index.js +2 -1
- package/dist/{index-BC-Jycqj.d.ts → index-D7SxwNdv.d.ts} +34 -734
- package/dist/index.d.ts +92 -247
- package/dist/index.js +322 -986
- package/dist/index.js.map +1 -1
- package/dist/kernel-wire.d.ts +3 -3
- package/dist/kernel-wire.js +3 -79
- package/dist/kernel-wire.js.map +1 -1
- package/dist/language/constructs.json +22 -2
- package/dist/language/program-types.json +203 -22
- package/dist/language/protocols.json +46 -0
- package/dist/language/ui-vocabulary.json +1697 -0
- package/dist/language/validation-codes.json +1222 -1212
- package/dist/language/vocabulary.json +44 -8
- package/dist/language-data.d.ts +7 -4
- package/dist/language-data.js +20 -14
- package/dist/language-data.js.map +1 -1
- package/dist/patterns/component-mapping.json +11 -1
- package/dist/patterns/definitions.d.ts +2 -2
- package/dist/patterns/definitions.js +1 -1
- package/dist/patterns/event-contracts.json +1 -15
- package/dist/patterns/game-font-families.json +13 -0
- package/dist/patterns/index.d.ts +24 -120
- package/dist/patterns/index.js +3 -3
- package/dist/patterns/pattern-tile-geometry.json +1065 -0
- package/dist/patterns/patterns-registry.json +2539 -431
- package/dist/patterns/registry.json +2539 -431
- package/dist/trait-sRjIivFq.d.ts +3519 -0
- package/dist/types/index.d.ts +9 -10
- package/dist/types/index.js +11 -5
- package/dist/{types-DGwrltUF.d.ts → types-C6_yPMpn.d.ts} +3 -3
- package/fixtures/events-wire/client-effects-by-trait/response.json +0 -18
- package/fixtures/events-wire/client-effects-provenance/response.json +0 -18
- package/fixtures/events-wire/effect-results-every-kind/response.json +2 -27
- package/fixtures/events-wire/navigate-1/response.json +8 -5
- package/fixtures/events-wire/navigate-2/response.json +11 -8
- package/fixtures/events-wire/navigate-3/response.json +14 -11
- package/fixtures/events-wire/navigate-back/response.json +7 -4
- package/fixtures/events-wire/render-ui-3/response.json +12 -9
- package/fixtures/events-wire/render-ui-clear/response.json +0 -7
- package/fixtures/events-wire/sse-stream/response.json +0 -20
- package/fixtures/events-wire/sse-stream/stream.json +0 -20
- package/fixtures/events-wire/stateless-traits/response.json +14 -5
- package/fixtures/kernel-wire/golden/basic-entity.json +1687 -0
- package/fixtures/kernel-wire/golden/entity-rerender.json +743 -0
- package/fixtures/kernel-wire/golden/rollback.json +793 -0
- package/fixtures/kernel-wire/golden/tick-counter.json +1538 -0
- package/fixtures/kernel-wire/golden/two-orbital-chore.json +847 -0
- package/fixtures/kernel-wire/golden/two-orbital-task.json +457 -0
- package/fixtures/kernel-wire/played-step.json +136 -0
- package/fixtures/kernel-wire/scripts/basic-entity.json +28 -0
- package/fixtures/kernel-wire/scripts/entity-rerender.json +13 -0
- package/fixtures/kernel-wire/scripts/rollback.json +53 -0
- package/fixtures/kernel-wire/scripts/tick-counter.json +26 -0
- package/fixtures/kernel-wire/scripts/two-orbital-chore.json +9 -0
- package/fixtures/kernel-wire/scripts/two-orbital-task.json +9 -0
- package/package.json +28 -19
- package/dist/builders-DmZE5By0.d.ts +0 -2663
- package/dist/chunk-45I2O4SJ.js +0 -4646
- package/dist/chunk-45I2O4SJ.js.map +0 -1
- package/dist/chunk-6LR43Z5E.js +0 -3061
- package/dist/chunk-6LR43Z5E.js.map +0 -1
- package/dist/chunk-GIUA3NUJ.js +0 -809
- package/dist/chunk-GIUA3NUJ.js.map +0 -1
- package/dist/chunk-GTY53NS5.js +0 -1908
- package/dist/chunk-GTY53NS5.js.map +0 -1
- package/dist/chunk-JOHDVS6J.js +0 -1614
- package/dist/chunk-JOHDVS6J.js.map +0 -1
- package/dist/chunk-KDMV222Q.js.map +0 -1
- package/dist/chunk-QRHJUS3D.js +0 -23
- package/dist/chunk-QRHJUS3D.js.map +0 -1
- package/dist/chunk-QUOTJULD.js +0 -4009
- package/dist/chunk-QUOTJULD.js.map +0 -1
- package/dist/chunk-V5VNGRVU.js +0 -66
- package/dist/chunk-V5VNGRVU.js.map +0 -1
- package/dist/chunk-X4SC7FGF.js.map +0 -1
- package/dist/entityAccess-BPSz1i2n.d.ts +0 -80
- package/dist/mock/index.d.ts +0 -153
- package/dist/mock/index.js +0 -190
- package/dist/mock/index.js.map +0 -1
- package/dist/schema-T5RT5s6H.d.ts +0 -282
- package/dist/state-machine/index.d.ts +0 -359
- package/dist/state-machine/index.js +0 -3
- package/dist/state-machine/index.js.map +0 -1
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
"expects",
|
|
7
7
|
"entity",
|
|
8
8
|
"type",
|
|
9
|
-
"derived",
|
|
10
9
|
"trait",
|
|
11
10
|
"initial",
|
|
12
11
|
"state",
|
|
@@ -20,6 +19,7 @@
|
|
|
20
19
|
"config",
|
|
21
20
|
"when",
|
|
22
21
|
"with",
|
|
22
|
+
"per",
|
|
23
23
|
"from",
|
|
24
24
|
"to",
|
|
25
25
|
"every",
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"sys",
|
|
43
43
|
"desktop",
|
|
44
44
|
"kv",
|
|
45
|
+
"dev",
|
|
46
|
+
"mem",
|
|
47
|
+
"kernel",
|
|
48
|
+
"ffi",
|
|
49
|
+
"credentials",
|
|
45
50
|
"on",
|
|
46
51
|
"name",
|
|
47
52
|
"fields",
|
|
@@ -75,6 +80,7 @@
|
|
|
75
80
|
"noindex",
|
|
76
81
|
"version",
|
|
77
82
|
"translationOf",
|
|
83
|
+
"notFound",
|
|
78
84
|
"label",
|
|
79
85
|
"input",
|
|
80
86
|
"http",
|
|
@@ -96,6 +102,7 @@
|
|
|
96
102
|
"server",
|
|
97
103
|
"browser",
|
|
98
104
|
"identity",
|
|
105
|
+
"self",
|
|
99
106
|
"background",
|
|
100
107
|
"visible",
|
|
101
108
|
"store"
|
|
@@ -132,7 +139,10 @@
|
|
|
132
139
|
"roles",
|
|
133
140
|
"invariant",
|
|
134
141
|
"holds",
|
|
135
|
-
"ensures"
|
|
142
|
+
"ensures",
|
|
143
|
+
"index",
|
|
144
|
+
"derived",
|
|
145
|
+
"display"
|
|
136
146
|
],
|
|
137
147
|
"sigils": [
|
|
138
148
|
"entity",
|
|
@@ -159,15 +169,12 @@
|
|
|
159
169
|
"navigate-back",
|
|
160
170
|
"render-ui",
|
|
161
171
|
"notify",
|
|
162
|
-
"ref",
|
|
163
172
|
"call-service",
|
|
164
|
-
"http",
|
|
165
|
-
"redis",
|
|
166
|
-
"postgres",
|
|
167
173
|
"cancel-call",
|
|
168
174
|
"random-bytes",
|
|
169
175
|
"credential-status",
|
|
170
176
|
"credential-forget",
|
|
177
|
+
"credential-connect",
|
|
171
178
|
"credential-list",
|
|
172
179
|
"credential-set",
|
|
173
180
|
"credential-remove",
|
|
@@ -182,7 +189,6 @@
|
|
|
182
189
|
"if",
|
|
183
190
|
"let",
|
|
184
191
|
"fn",
|
|
185
|
-
"lambda",
|
|
186
192
|
"quote",
|
|
187
193
|
"quasiquote",
|
|
188
194
|
"unquote",
|
|
@@ -194,11 +200,22 @@
|
|
|
194
200
|
"number",
|
|
195
201
|
"int",
|
|
196
202
|
"float",
|
|
203
|
+
"i8",
|
|
204
|
+
"i16",
|
|
205
|
+
"i32",
|
|
206
|
+
"i64",
|
|
207
|
+
"u8",
|
|
208
|
+
"u16",
|
|
209
|
+
"u32",
|
|
210
|
+
"u64",
|
|
211
|
+
"f32",
|
|
212
|
+
"f64",
|
|
197
213
|
"bool",
|
|
198
214
|
"boolean",
|
|
199
215
|
"timestamp",
|
|
200
216
|
"date",
|
|
201
217
|
"datetime",
|
|
218
|
+
"instant",
|
|
202
219
|
"duration",
|
|
203
220
|
"money",
|
|
204
221
|
"file",
|
|
@@ -255,7 +272,9 @@
|
|
|
255
272
|
"_resolved": "_resolved",
|
|
256
273
|
"access": "access",
|
|
257
274
|
"access_waivers": "access_waivers",
|
|
275
|
+
"additionalProperties": "additionalProperties",
|
|
258
276
|
"address": "address",
|
|
277
|
+
"after": "after",
|
|
259
278
|
"alias": "alias",
|
|
260
279
|
"animations": "animations",
|
|
261
280
|
"answers": "answers",
|
|
@@ -267,6 +286,7 @@
|
|
|
267
286
|
"auth": "auth",
|
|
268
287
|
"auxiliaryEntities": "auxiliaryEntities",
|
|
269
288
|
"awaitRender": "awaitRender",
|
|
289
|
+
"backgroundTicks": "backgroundTicks",
|
|
270
290
|
"bakedName": "bakedName",
|
|
271
291
|
"baseUrl": "baseUrl",
|
|
272
292
|
"behavior": "behavior",
|
|
@@ -300,6 +320,7 @@
|
|
|
300
320
|
"delete_policy": "delete_policy",
|
|
301
321
|
"density": "density",
|
|
302
322
|
"deployment": "deployment",
|
|
323
|
+
"derived": "derived",
|
|
303
324
|
"description": "description",
|
|
304
325
|
"description_visual_prompt": "description_visual_prompt",
|
|
305
326
|
"design": "design",
|
|
@@ -310,6 +331,9 @@
|
|
|
310
331
|
"diagram": "diagram",
|
|
311
332
|
"dimension": "dimension",
|
|
312
333
|
"dispatch": "dispatch",
|
|
334
|
+
"dispatchFacts": "dispatchFacts",
|
|
335
|
+
"dispatchMode": "dispatchMode",
|
|
336
|
+
"display": "display",
|
|
313
337
|
"displayName": "displayName",
|
|
314
338
|
"domainContext": "domainContext",
|
|
315
339
|
"effectRow": "effectRow",
|
|
@@ -365,6 +389,7 @@
|
|
|
365
389
|
"identity": "identity",
|
|
366
390
|
"illustration": "illustration",
|
|
367
391
|
"inbound": "inbound",
|
|
392
|
+
"indexes": "indexes",
|
|
368
393
|
"indexing": "indexing",
|
|
369
394
|
"initialEffects": "initialEffects",
|
|
370
395
|
"input": "input",
|
|
@@ -375,6 +400,7 @@
|
|
|
375
400
|
"invariants": "invariants",
|
|
376
401
|
"isFinal": "isFinal",
|
|
377
402
|
"isInitial": "isInitial",
|
|
403
|
+
"isNotFound": "isNotFound",
|
|
378
404
|
"isTerminal": "isTerminal",
|
|
379
405
|
"item": "item",
|
|
380
406
|
"items": "items",
|
|
@@ -389,6 +415,7 @@
|
|
|
389
415
|
"ledger": "ledger",
|
|
390
416
|
"linkedEntity": "linkedEntity",
|
|
391
417
|
"linkedEntityId": "linkedEntityId",
|
|
418
|
+
"links": "links",
|
|
392
419
|
"listPattern": "listPattern",
|
|
393
420
|
"listened": "listened",
|
|
394
421
|
"listens": "listens",
|
|
@@ -408,15 +435,19 @@
|
|
|
408
435
|
"name": "name",
|
|
409
436
|
"nestedForwardedFrom": "nestedForwardedFrom",
|
|
410
437
|
"net": "net",
|
|
438
|
+
"nullable": "nullable",
|
|
411
439
|
"omit": "omit",
|
|
412
440
|
"onDelete": "onDelete",
|
|
413
441
|
"onEntry": "onEntry",
|
|
414
442
|
"onExit": "onExit",
|
|
415
443
|
"only": "only",
|
|
444
|
+
"operatorSites": "operatorSites",
|
|
445
|
+
"orb": "orb",
|
|
416
446
|
"orbRef": "orbRef",
|
|
417
447
|
"orbital": "orbital",
|
|
418
448
|
"orbitalId": "orbitalId",
|
|
419
449
|
"orbitals": "orbitals",
|
|
450
|
+
"orderBy": "orderBy",
|
|
420
451
|
"origin": "origin",
|
|
421
452
|
"originalEvent": "originalEvent",
|
|
422
453
|
"originalName": "originalName",
|
|
@@ -437,6 +468,7 @@
|
|
|
437
468
|
"payloadSchema": "payloadSchema",
|
|
438
469
|
"persistence": "persistence",
|
|
439
470
|
"personas": "personas",
|
|
471
|
+
"places": "places",
|
|
440
472
|
"presentation": "presentation",
|
|
441
473
|
"primaryColor": "primaryColor",
|
|
442
474
|
"primaryEntity": "primaryEntity",
|
|
@@ -447,12 +479,14 @@
|
|
|
447
479
|
"properties": "properties",
|
|
448
480
|
"props": "props",
|
|
449
481
|
"protocol": "protocol",
|
|
482
|
+
"protocols": "protocols",
|
|
450
483
|
"provides": "provides",
|
|
451
484
|
"publicDir": "publicDir",
|
|
452
485
|
"radii": "radii",
|
|
453
486
|
"read": "read",
|
|
454
487
|
"read_policy": "read_policy",
|
|
455
488
|
"reconnect": "reconnect",
|
|
489
|
+
"record": "record",
|
|
456
490
|
"ref": "ref",
|
|
457
491
|
"refId": "refId",
|
|
458
492
|
"reference": "reference",
|
|
@@ -542,6 +576,7 @@
|
|
|
542
576
|
"triggersId": "triggersId",
|
|
543
577
|
"type": "type",
|
|
544
578
|
"typeArgs": "typeArgs",
|
|
579
|
+
"typeContractVersion": "typeContractVersion",
|
|
545
580
|
"typeParams": "typeParams",
|
|
546
581
|
"typeScale": "typeScale",
|
|
547
582
|
"typeWhen": "typeWhen",
|
|
@@ -563,6 +598,7 @@
|
|
|
563
598
|
"viewType": "viewType",
|
|
564
599
|
"visual_prompt": "visual_prompt",
|
|
565
600
|
"vocabulary": "vocabulary",
|
|
566
|
-
"whileVisible": "whileVisible"
|
|
601
|
+
"whileVisible": "whileVisible",
|
|
602
|
+
"wired": "wired"
|
|
567
603
|
}
|
|
568
604
|
}
|
package/dist/language-data.d.ts
CHANGED
|
@@ -7,25 +7,28 @@ import 'zod';
|
|
|
7
7
|
interface InstalledVocabularyPack {
|
|
8
8
|
package: string;
|
|
9
9
|
version: string;
|
|
10
|
-
/** The
|
|
11
|
-
|
|
10
|
+
/** The language versions the pack is written for (`orbVocabulary.language`). */
|
|
11
|
+
language: string;
|
|
12
12
|
vocabulary: VocabularyPack;
|
|
13
13
|
}
|
|
14
14
|
interface LanguageBundle {
|
|
15
15
|
core: {
|
|
16
16
|
version: string;
|
|
17
|
-
|
|
17
|
+
/** The language version core provides (`orbLanguage.version`). */
|
|
18
|
+
language: string;
|
|
18
19
|
patterns: JsonValue;
|
|
19
20
|
componentMapping: JsonValue;
|
|
20
21
|
eventContracts: JsonValue;
|
|
21
22
|
services: JsonValue;
|
|
22
23
|
bindingRules: JsonValue;
|
|
23
24
|
programTypes: JsonValue;
|
|
25
|
+
protocols: JsonValue;
|
|
24
26
|
themes: ThemeDefinition[];
|
|
25
27
|
};
|
|
26
28
|
std: {
|
|
27
29
|
version: string;
|
|
28
|
-
|
|
30
|
+
/** The language versions std is written for (`orbLanguage.language`). */
|
|
31
|
+
language: string;
|
|
29
32
|
operators: JsonValue;
|
|
30
33
|
};
|
|
31
34
|
/** Every installed language pack ({@link readVocabularyPacks}); English is built in. */
|
package/dist/language-data.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { installedPackageDirs, userStoreDir } from './chunk-
|
|
2
|
-
import { parseVocabularyPack } from './chunk-
|
|
1
|
+
import { installedPackageDirs, userStoreDir } from './chunk-RGACZEYC.js';
|
|
2
|
+
import { parseVocabularyPack } from './chunk-5WQ3U7NJ.js';
|
|
3
|
+
import './chunk-B4MNHGBP.js';
|
|
3
4
|
import { readFileSync, existsSync, readdirSync } from 'fs';
|
|
4
5
|
import { join, dirname, resolve } from 'path';
|
|
5
6
|
|
|
@@ -19,18 +20,22 @@ function findManifest(name, fromDir) {
|
|
|
19
20
|
dir = parent;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
function readLanguagePackage(name, fromDir) {
|
|
23
|
+
function readLanguagePackage(name, fromDir, languageKey) {
|
|
23
24
|
const manifestPath = findManifest(name, fromDir);
|
|
24
25
|
if (!manifestPath) throw new LanguageDataError(`${name} is not installed (searched from ${fromDir})`);
|
|
25
26
|
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
26
27
|
if (!manifest.orbLanguage) throw new LanguageDataError(`${manifestPath} declares no \`orbLanguage\` block`);
|
|
27
|
-
if (!manifest.orbLanguage
|
|
28
|
+
if (!manifest.orbLanguage[languageKey]) throw new LanguageDataError(`${manifestPath} declares no \`orbLanguage.${languageKey}\``);
|
|
28
29
|
return { root: dirname(manifestPath), version: manifest.version ?? "", block: manifest.orbLanguage };
|
|
29
30
|
}
|
|
31
|
+
function declaredText(pkg, field) {
|
|
32
|
+
const value = pkg.block[field];
|
|
33
|
+
if (!value) throw new LanguageDataError(`${pkg.root}/package.json declares no \`orbLanguage.${field}\``);
|
|
34
|
+
if (typeof value !== "string") throw new LanguageDataError(`${pkg.root}/package.json: \`orbLanguage.${field}\` is not a single value`);
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
30
37
|
function declared(pkg, field) {
|
|
31
|
-
|
|
32
|
-
if (!rel) throw new LanguageDataError(`${pkg.root}/package.json declares no \`orbLanguage.${field}\``);
|
|
33
|
-
return join(pkg.root, rel);
|
|
38
|
+
return join(pkg.root, declaredText(pkg, field));
|
|
34
39
|
}
|
|
35
40
|
function readJson(path) {
|
|
36
41
|
return JSON.parse(readFileSync(path, "utf8"));
|
|
@@ -44,8 +49,8 @@ function readVocabularyPacks(fromDir, userStore = userStoreDir()) {
|
|
|
44
49
|
const block = manifest.orbVocabulary;
|
|
45
50
|
if (!block || !manifest.name || seen.has(manifest.name)) continue;
|
|
46
51
|
seen.add(manifest.name);
|
|
47
|
-
if (!block.
|
|
48
|
-
throw new LanguageDataError(`${manifest.name} (${manifestPath}): \`orbVocabulary\` needs \`
|
|
52
|
+
if (!block.language || !block.vocabulary) {
|
|
53
|
+
throw new LanguageDataError(`${manifest.name} (${manifestPath}): \`orbVocabulary\` needs \`language\` and \`vocabulary\``);
|
|
49
54
|
}
|
|
50
55
|
const file = join(dir, block.vocabulary);
|
|
51
56
|
if (!existsSync(file)) throw new LanguageDataError(`${manifest.name}: declared vocabulary ${file} does not exist`);
|
|
@@ -55,7 +60,7 @@ function readVocabularyPacks(fromDir, userStore = userStoreDir()) {
|
|
|
55
60
|
} catch (e) {
|
|
56
61
|
throw new LanguageDataError(`${manifest.name}: ${e instanceof Error ? e.message : String(e)}`);
|
|
57
62
|
}
|
|
58
|
-
packs.push({ package: manifest.name, version: manifest.version ?? "",
|
|
63
|
+
packs.push({ package: manifest.name, version: manifest.version ?? "", language: block.language, vocabulary });
|
|
59
64
|
}
|
|
60
65
|
const byCode = /* @__PURE__ */ new Map();
|
|
61
66
|
for (const pack of packs) {
|
|
@@ -67,26 +72,27 @@ function readVocabularyPacks(fromDir, userStore = userStoreDir()) {
|
|
|
67
72
|
return packs.sort((a, b) => a.package < b.package ? -1 : a.package > b.package ? 1 : 0);
|
|
68
73
|
}
|
|
69
74
|
function readLanguageBundle(fromDir, userStore = userStoreDir()) {
|
|
70
|
-
const core = readLanguagePackage("@almadar/core", fromDir);
|
|
71
|
-
const std = readLanguagePackage("@almadar/std", fromDir);
|
|
75
|
+
const core = readLanguagePackage("@almadar/core", fromDir, "version");
|
|
76
|
+
const std = readLanguagePackage("@almadar/std", fromDir, "language");
|
|
72
77
|
const themesDir = declared(core, "themes");
|
|
73
78
|
const themes = (existsSync(themesDir) ? readdirSync(themesDir) : []).filter((f) => f.endsWith(".json")).sort().map((f) => JSON.parse(readFileSync(join(themesDir, f), "utf8")));
|
|
74
79
|
if (themes.length === 0) throw new LanguageDataError(`${themesDir} holds no theme presets`);
|
|
75
80
|
return {
|
|
76
81
|
core: {
|
|
77
82
|
version: core.version,
|
|
78
|
-
|
|
83
|
+
language: declaredText(core, "version"),
|
|
79
84
|
patterns: readJson(declared(core, "patterns")),
|
|
80
85
|
componentMapping: readJson(declared(core, "componentMapping")),
|
|
81
86
|
eventContracts: readJson(declared(core, "eventContracts")),
|
|
82
87
|
services: readJson(declared(core, "services")),
|
|
83
88
|
bindingRules: readJson(declared(core, "bindingRules")),
|
|
84
89
|
programTypes: readJson(declared(core, "programTypes")),
|
|
90
|
+
protocols: readJson(declared(core, "protocols")),
|
|
85
91
|
themes
|
|
86
92
|
},
|
|
87
93
|
std: {
|
|
88
94
|
version: std.version,
|
|
89
|
-
|
|
95
|
+
language: declaredText(std, "language"),
|
|
90
96
|
operators: readJson(declared(std, "operators"))
|
|
91
97
|
},
|
|
92
98
|
vocabularies: readVocabularyPacks(fromDir, userStore)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/language-data.ts"],"names":[],"mappings":";;;;;AAyDO,IAAM,iBAAA,GAAN,cAAgC,KAAA,CAAM;AAAA,EAC3C,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,mBAAA;AAAA,EACd;AACF;AAIA,SAAS,YAAA,CAAa,MAAc,OAAA,EAAgC;AAClE,EAAA,IAAI,GAAA,GAAM,QAAQ,OAAO,CAAA;AACzB,EAAA,WAAS;AACP,IAAA,MAAM,SAAA,GAAY,IAAA,CAAK,GAAA,EAAK,cAAA,EAAgB,MAAM,cAAc,CAAA;AAChE,IAAA,IAAI,UAAA,CAAW,SAAS,CAAA,EAAG,OAAO,SAAA;AAClC,IAAA,MAAM,MAAA,GAAS,QAAQ,GAAG,CAAA;AAC1B,IAAA,IAAI,MAAA,KAAW,KAAK,OAAO,IAAA;AAC3B,IAAA,GAAA,GAAM,MAAA;AAAA,EACR;AACF;AAEA,SAAS,mBAAA,CAAoB,MAAc,OAAA,EAAkC;AAC3E,EAAA,MAAM,YAAA,GAAe,YAAA,CAAa,IAAA,EAAM,OAAO,CAAA;AAC/C,EAAA,IAAI,CAAC,cAAc,MAAM,IAAI,kBAAkB,CAAA,EAAG,IAAI,CAAA,iCAAA,EAAoC,OAAO,CAAA,CAAA,CAAG,CAAA;AACpG,EAAA,MAAM,WAAW,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,YAAA,EAAc,MAAM,CAAC,CA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AK,KAAA,CAAM,YAAA,CAAa,IAAA,CAAK,SAAA,EAAW,CAAC,CAAA,EAAG,MAAM,CAAC,CAAoB,CAAA;AACrF,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG,MAAM,IAAI,iBAAA,CAAkB,CAAA,EAAG,SAAS,CAAA,uBAAA,CAAyB,CAAA;AAC1F,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,SAAS,IAAA,CAAK,OAAA;AAAA,MACd,QAAA,EAAU,KAAK,KAAA,CAAM,QAAA;AAAA,MACrB,QAAA,EAAU,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM,UAAU,CAAC,CAAA;AAAA,MAC7C,gBAAA,EAAkB,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM,kBAAkB,CAAC,CAAA;AAAA,MAC7D,cAAA,EAAgB,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM,gBAAgB,CAAC,CAAA;AAAA,MACzD,QAAA,EAAU,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM,UAAU,CAAC,CAAA;AAAA,MAC7C,YAAA,EAAc,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM,cAAc,CAAC,CAAA;AAAA,MACrD,YAAA,EAAc,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM,cAAc,CAAC,CAAA;AAAA,MACrD;AAAA,KACF;AAAA,IACA,GAAA,EAAK;AAAA,MACH,SAAS,GAAA,CAAI,OAAA;AAAA,MACb,QAAA,EAAU,IAAI,KAAA,CAAM,QAAA;AAAA,MACpB,SAAA,EAAW,QAAA,CAAS,QAAA,CAAS,GAAA,EAAK,WAAW,CAAC;AAAA,KAChD;AAAA,IACA,YAAA,EAAc,mBAAA,CAAoB,OAAA,EAAS,SAAS;AAAA,GACtD;AACF","file":"language-data.js","sourcesContent":["/**\n * The language-data bundle a host without `node_modules` (a browser running the\n * wasm `orb` clients) hands to `install_language` — TS mirror of\n * `orbital_core::language_data::install_language_bundle`. Read from the\n * INSTALLED `@almadar/core` and `@almadar/std` through their top-level\n * `orbLanguage` declarations, the same files `orb` reads natively\n * (`docs/Almadar_Behavior_Packages.md` §14), never a hardcoded layout.\n *\n * Node-only (reads with `node:fs`): exported from the\n * `@almadar/core/language-data` subpath only (the `fixtures` precedent).\n *\n * @packageDocumentation\n */\nimport { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\n\nimport { installedPackageDirs, userStoreDir } from './behavior-package.js';\nimport { parseVocabularyPack, type LanguageCode, type VocabularyPack } from './i18n/index.js';\nimport type { ThemeDefinition } from './types/domain.js';\nimport type { JsonValue } from './types/json.js';\n\n/** One installed language pack: the npm package declaring `orbVocabulary` and its vocabulary. */\nexport interface InstalledVocabularyPack {\n package: string;\n version: string;\n /** The `orb` versions the pack supports (`orbVocabulary.compiler`). */\n compiler: string;\n vocabulary: VocabularyPack;\n}\n\nexport interface LanguageBundle {\n core: {\n version: string;\n compiler: string;\n patterns: JsonValue;\n componentMapping: JsonValue;\n eventContracts: JsonValue;\n services: JsonValue;\n bindingRules: JsonValue;\n programTypes: JsonValue;\n themes: ThemeDefinition[];\n };\n std: {\n version: string;\n compiler: string;\n operators: JsonValue;\n };\n /** Every installed language pack ({@link readVocabularyPacks}); English is built in. */\n vocabularies: InstalledVocabularyPack[];\n}\n\ninterface LanguagePackage {\n root: string;\n version: string;\n block: Record<string, string>;\n}\n\nexport class LanguageDataError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'LanguageDataError';\n }\n}\n\n/** The nearest `node_modules/<name>/package.json` walking up from `fromDir` — the\n * same walk as `orbital_core::behavior_packages::find_npm_package`. */\nfunction findManifest(name: string, fromDir: string): string | null {\n let dir = resolve(fromDir);\n for (;;) {\n const candidate = join(dir, 'node_modules', name, 'package.json');\n if (existsSync(candidate)) return candidate;\n const parent = dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n}\n\nfunction readLanguagePackage(name: string, fromDir: string): LanguagePackage {\n const manifestPath = findManifest(name, fromDir);\n if (!manifestPath) throw new LanguageDataError(`${name} is not installed (searched from ${fromDir})`);\n const manifest = JSON.parse(readFileSync(manifestPath, 'utf8')) as {\n version?: string;\n orbLanguage?: Record<string, string>;\n };\n if (!manifest.orbLanguage) throw new LanguageDataError(`${manifestPath} declares no \\`orbLanguage\\` block`);\n if (!manifest.orbLanguage.compiler) throw new LanguageDataError(`${manifestPath} declares no \\`orbLanguage.compiler\\` range`);\n return { root: dirname(manifestPath), version: manifest.version ?? '', block: manifest.orbLanguage };\n}\n\nfunction declared(pkg: LanguagePackage, field: string): string {\n const rel = pkg.block[field];\n if (!rel) throw new LanguageDataError(`${pkg.root}/package.json declares no \\`orbLanguage.${field}\\``);\n return join(pkg.root, rel);\n}\n\nfunction readJson(path: string): JsonValue {\n return JSON.parse(readFileSync(path, 'utf8')) as JsonValue;\n}\n\ninterface VocabularyManifest {\n name?: string;\n version?: string;\n orbVocabulary?: { compiler?: string; vocabulary?: string };\n}\n\n/**\n * Every installed language pack, the same rule as `orb` (`orbital-core`\n * `i18n::packs`): each package ({@link installedPackageDirs}, nearest first,\n * the user store last) whose `package.json` declares a top-level\n * `orbVocabulary`; nearest wins per package name. Two packages claiming one\n * language code, or a pack whose declared file is missing or malformed, fail\n * naming the package. Sorted by package name. Register them with\n * `registerVocabulary` from `@almadar/core/i18n` (each subpath is its own\n * bundle, so registration must go through the caller's i18n import).\n */\nexport function readVocabularyPacks(fromDir: string, userStore: string = userStoreDir()): InstalledVocabularyPack[] {\n const seen = new Set<string>();\n const packs: InstalledVocabularyPack[] = [];\n for (const dir of installedPackageDirs(fromDir, userStore)) {\n const manifestPath = join(dir, 'package.json');\n const manifest = JSON.parse(readFileSync(manifestPath, 'utf8')) as VocabularyManifest;\n const block = manifest.orbVocabulary;\n if (!block || !manifest.name || seen.has(manifest.name)) continue;\n seen.add(manifest.name);\n if (!block.compiler || !block.vocabulary) {\n throw new LanguageDataError(`${manifest.name} (${manifestPath}): \\`orbVocabulary\\` needs \\`compiler\\` and \\`vocabulary\\``);\n }\n const file = join(dir, block.vocabulary);\n if (!existsSync(file)) throw new LanguageDataError(`${manifest.name}: declared vocabulary ${file} does not exist`);\n let vocabulary: VocabularyPack;\n try {\n vocabulary = parseVocabularyPack(JSON.parse(readFileSync(file, 'utf8')), `${manifest.name}/${block.vocabulary}`);\n } catch (e) {\n throw new LanguageDataError(`${manifest.name}: ${e instanceof Error ? e.message : String(e)}`);\n }\n packs.push({ package: manifest.name, version: manifest.version ?? '', compiler: block.compiler, vocabulary });\n }\n const byCode = new Map<LanguageCode, string>();\n for (const pack of packs) {\n const code = pack.vocabulary.meta.code;\n const other = byCode.get(code);\n if (other) throw new LanguageDataError(`language \"${code}\" is claimed by two packs: ${other} and ${pack.package}`);\n byCode.set(code, pack.package);\n }\n return packs.sort((a, b) => (a.package < b.package ? -1 : a.package > b.package ? 1 : 0));\n}\n\n/** Assemble the bundle from the `@almadar/core`, `@almadar/std` and language packs installed for `fromDir`. */\nexport function readLanguageBundle(fromDir: string, userStore: string = userStoreDir()): LanguageBundle {\n const core = readLanguagePackage('@almadar/core', fromDir);\n const std = readLanguagePackage('@almadar/std', fromDir);\n const themesDir = declared(core, 'themes');\n const themes = (existsSync(themesDir) ? readdirSync(themesDir) : [])\n .filter((f) => f.endsWith('.json'))\n .sort()\n .map((f) => JSON.parse(readFileSync(join(themesDir, f), 'utf8')) as ThemeDefinition);\n if (themes.length === 0) throw new LanguageDataError(`${themesDir} holds no theme presets`);\n return {\n core: {\n version: core.version,\n compiler: core.block.compiler,\n patterns: readJson(declared(core, 'patterns')),\n componentMapping: readJson(declared(core, 'componentMapping')),\n eventContracts: readJson(declared(core, 'eventContracts')),\n services: readJson(declared(core, 'services')),\n bindingRules: readJson(declared(core, 'bindingRules')),\n programTypes: readJson(declared(core, 'programTypes')),\n themes,\n },\n std: {\n version: std.version,\n compiler: std.block.compiler,\n operators: readJson(declared(std, 'operators')),\n },\n vocabularies: readVocabularyPacks(fromDir, userStore),\n };\n}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AoB,OAAA,EAAS,SAAS;AAAA,GACtD;AACF","file":"language-data.js","sourcesContent":["/**\n * The language-data bundle a host without `node_modules` (a browser running the\n * wasm `orb` clients) hands to `install_language` — TS mirror of\n * `orbital_core::language_data::install_language_bundle`. Read from the\n * INSTALLED `@almadar/core` and `@almadar/std` through their top-level\n * `orbLanguage` declarations, the same files `orb` reads natively\n * (`docs/Almadar_Behavior_Packages.md` §14), never a hardcoded layout.\n *\n * Node-only (reads with `node:fs`): exported from the\n * `@almadar/core/language-data` subpath only (the `fixtures` precedent).\n *\n * @packageDocumentation\n */\nimport { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\n\nimport { installedPackageDirs, userStoreDir } from './behavior-package.js';\nimport { parseVocabularyPack, type LanguageCode, type VocabularyPack } from './i18n/index.js';\nimport type { ThemeDefinition } from './types/domain.js';\nimport type { JsonValue } from './types/json.js';\n\n/** One installed language pack: the npm package declaring `orbVocabulary` and its vocabulary. */\nexport interface InstalledVocabularyPack {\n package: string;\n version: string;\n /** The language versions the pack is written for (`orbVocabulary.language`). */\n language: string;\n vocabulary: VocabularyPack;\n}\n\nexport interface LanguageBundle {\n core: {\n version: string;\n /** The language version core provides (`orbLanguage.version`). */\n language: string;\n patterns: JsonValue;\n componentMapping: JsonValue;\n eventContracts: JsonValue;\n services: JsonValue;\n bindingRules: JsonValue;\n programTypes: JsonValue;\n protocols: JsonValue;\n themes: ThemeDefinition[];\n };\n std: {\n version: string;\n /** The language versions std is written for (`orbLanguage.language`). */\n language: string;\n operators: JsonValue;\n };\n /** Every installed language pack ({@link readVocabularyPacks}); English is built in. */\n vocabularies: InstalledVocabularyPack[];\n}\n\ninterface LanguagePackage {\n root: string;\n version: string;\n block: Record<string, string | string[]>;\n}\n\nexport class LanguageDataError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'LanguageDataError';\n }\n}\n\n/** The nearest `node_modules/<name>/package.json` walking up from `fromDir` — the\n * same walk as `orbital_core::behavior_packages::find_npm_package`. */\nfunction findManifest(name: string, fromDir: string): string | null {\n let dir = resolve(fromDir);\n for (;;) {\n const candidate = join(dir, 'node_modules', name, 'package.json');\n if (existsSync(candidate)) return candidate;\n const parent = dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n}\n\nfunction readLanguagePackage(name: string, fromDir: string, languageKey: 'version' | 'language'): LanguagePackage {\n const manifestPath = findManifest(name, fromDir);\n if (!manifestPath) throw new LanguageDataError(`${name} is not installed (searched from ${fromDir})`);\n const manifest = JSON.parse(readFileSync(manifestPath, 'utf8')) as {\n version?: string;\n orbLanguage?: Record<string, string | string[]>;\n };\n if (!manifest.orbLanguage) throw new LanguageDataError(`${manifestPath} declares no \\`orbLanguage\\` block`);\n if (!manifest.orbLanguage[languageKey]) throw new LanguageDataError(`${manifestPath} declares no \\`orbLanguage.${languageKey}\\``);\n return { root: dirname(manifestPath), version: manifest.version ?? '', block: manifest.orbLanguage };\n}\n\nfunction declaredText(pkg: LanguagePackage, field: string): string {\n const value = pkg.block[field];\n if (!value) throw new LanguageDataError(`${pkg.root}/package.json declares no \\`orbLanguage.${field}\\``);\n if (typeof value !== 'string') throw new LanguageDataError(`${pkg.root}/package.json: \\`orbLanguage.${field}\\` is not a single value`);\n return value;\n}\n\nfunction declared(pkg: LanguagePackage, field: string): string {\n return join(pkg.root, declaredText(pkg, field));\n}\n\nfunction readJson(path: string): JsonValue {\n return JSON.parse(readFileSync(path, 'utf8')) as JsonValue;\n}\n\ninterface VocabularyManifest {\n name?: string;\n version?: string;\n orbVocabulary?: { language?: string; vocabulary?: string };\n}\n\n/**\n * Every installed language pack, the same rule as `orb` (`orbital-core`\n * `i18n::packs`): each package ({@link installedPackageDirs}, nearest first,\n * the user store last) whose `package.json` declares a top-level\n * `orbVocabulary`; nearest wins per package name. Two packages claiming one\n * language code, or a pack whose declared file is missing or malformed, fail\n * naming the package. Sorted by package name. Register them with\n * `registerVocabulary` from `@almadar/core/i18n` (each subpath is its own\n * bundle, so registration must go through the caller's i18n import).\n */\nexport function readVocabularyPacks(fromDir: string, userStore: string = userStoreDir()): InstalledVocabularyPack[] {\n const seen = new Set<string>();\n const packs: InstalledVocabularyPack[] = [];\n for (const dir of installedPackageDirs(fromDir, userStore)) {\n const manifestPath = join(dir, 'package.json');\n const manifest = JSON.parse(readFileSync(manifestPath, 'utf8')) as VocabularyManifest;\n const block = manifest.orbVocabulary;\n if (!block || !manifest.name || seen.has(manifest.name)) continue;\n seen.add(manifest.name);\n if (!block.language || !block.vocabulary) {\n throw new LanguageDataError(`${manifest.name} (${manifestPath}): \\`orbVocabulary\\` needs \\`language\\` and \\`vocabulary\\``);\n }\n const file = join(dir, block.vocabulary);\n if (!existsSync(file)) throw new LanguageDataError(`${manifest.name}: declared vocabulary ${file} does not exist`);\n let vocabulary: VocabularyPack;\n try {\n vocabulary = parseVocabularyPack(JSON.parse(readFileSync(file, 'utf8')), `${manifest.name}/${block.vocabulary}`);\n } catch (e) {\n throw new LanguageDataError(`${manifest.name}: ${e instanceof Error ? e.message : String(e)}`);\n }\n packs.push({ package: manifest.name, version: manifest.version ?? '', language: block.language, vocabulary });\n }\n const byCode = new Map<LanguageCode, string>();\n for (const pack of packs) {\n const code = pack.vocabulary.meta.code;\n const other = byCode.get(code);\n if (other) throw new LanguageDataError(`language \"${code}\" is claimed by two packs: ${other} and ${pack.package}`);\n byCode.set(code, pack.package);\n }\n return packs.sort((a, b) => (a.package < b.package ? -1 : a.package > b.package ? 1 : 0));\n}\n\n/** Assemble the bundle from the `@almadar/core`, `@almadar/std` and language packs installed for `fromDir`. */\nexport function readLanguageBundle(fromDir: string, userStore: string = userStoreDir()): LanguageBundle {\n const core = readLanguagePackage('@almadar/core', fromDir, 'version');\n const std = readLanguagePackage('@almadar/std', fromDir, 'language');\n const themesDir = declared(core, 'themes');\n const themes = (existsSync(themesDir) ? readdirSync(themesDir) : [])\n .filter((f) => f.endsWith('.json'))\n .sort()\n .map((f) => JSON.parse(readFileSync(join(themesDir, f), 'utf8')) as ThemeDefinition);\n if (themes.length === 0) throw new LanguageDataError(`${themesDir} holds no theme presets`);\n return {\n core: {\n version: core.version,\n language: declaredText(core, 'version'),\n patterns: readJson(declared(core, 'patterns')),\n componentMapping: readJson(declared(core, 'componentMapping')),\n eventContracts: readJson(declared(core, 'eventContracts')),\n services: readJson(declared(core, 'services')),\n bindingRules: readJson(declared(core, 'bindingRules')),\n programTypes: readJson(declared(core, 'programTypes')),\n protocols: readJson(declared(core, 'protocols')),\n themes,\n },\n std: {\n version: std.version,\n language: declaredText(std, 'language'),\n operators: readJson(declared(std, 'operators')),\n },\n vocabularies: readVocabularyPacks(fromDir, userStore),\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"exportedAt": "2026-
|
|
3
|
+
"exportedAt": "2026-11-06T03:25:33.553Z",
|
|
4
4
|
"mappings": {
|
|
5
5
|
"page-header": {
|
|
6
6
|
"component": "PageHeader",
|
|
@@ -1333,6 +1333,16 @@
|
|
|
1333
1333
|
"component": "VideoEmbed",
|
|
1334
1334
|
"importPath": "@almadar/shell-web/core/atoms/VideoEmbed",
|
|
1335
1335
|
"category": "component"
|
|
1336
|
+
},
|
|
1337
|
+
"machine-panel": {
|
|
1338
|
+
"component": "MachinePanel",
|
|
1339
|
+
"importPath": "@almadar/shell-web/components/core/organisms/MachinePanel",
|
|
1340
|
+
"category": "display"
|
|
1341
|
+
},
|
|
1342
|
+
"guest-view": {
|
|
1343
|
+
"component": "GuestView",
|
|
1344
|
+
"importPath": "@almadar/shell-web/components/core/molecules/GuestView",
|
|
1345
|
+
"category": "component"
|
|
1336
1346
|
}
|
|
1337
1347
|
}
|
|
1338
1348
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { PATTERN_REGISTRY, getPatternDefinition, patternsRegistry, registry } from '../chunk-
|
|
1
|
+
export { PATTERN_REGISTRY, getPatternDefinition, patternsRegistry, registry } from '../chunk-SNZYN7UA.js';
|
|
2
2
|
//# sourceMappingURL=definitions.js.map
|
|
3
3
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"exportedAt": "2026-
|
|
3
|
+
"exportedAt": "2026-11-06T03:25:33.553Z",
|
|
4
4
|
"contracts": {
|
|
5
5
|
"form": {
|
|
6
6
|
"emits": [
|
|
@@ -98,13 +98,6 @@
|
|
|
98
98
|
"payload": {
|
|
99
99
|
"type": "object"
|
|
100
100
|
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"event": "NAVIGATE",
|
|
104
|
-
"trigger": "action",
|
|
105
|
-
"payload": {
|
|
106
|
-
"type": "object"
|
|
107
|
-
}
|
|
108
101
|
}
|
|
109
102
|
],
|
|
110
103
|
"requires": [],
|
|
@@ -799,13 +792,6 @@
|
|
|
799
792
|
"payload": {
|
|
800
793
|
"type": "object"
|
|
801
794
|
}
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
"event": "EDITOR_BLUR",
|
|
805
|
-
"trigger": "action",
|
|
806
|
-
"payload": {
|
|
807
|
-
"type": "object"
|
|
808
|
-
}
|
|
809
795
|
}
|
|
810
796
|
],
|
|
811
797
|
"requires": [],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "@almadar/pattern-sync/game-font-families-source.json",
|
|
3
|
+
"fallback": "ui-sans-serif, system-ui, sans-serif",
|
|
4
|
+
"unknownKey": "css-font-family",
|
|
5
|
+
"aliases": {
|
|
6
|
+
"fredoka": "Fredoka",
|
|
7
|
+
"future": "Kenney Future",
|
|
8
|
+
"future-narrow": "Kenney Future Narrow",
|
|
9
|
+
"pixel": "Kenney Pixel",
|
|
10
|
+
"blocks": "Kenney Blocks",
|
|
11
|
+
"mini": "Kenney Mini"
|
|
12
|
+
}
|
|
13
|
+
}
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AnyPatternConfig,
|
|
1
|
+
import { A as AnyPatternConfig, o as PatternType } from '../effect-DZaXwSAz.js';
|
|
2
2
|
import { RenderBinding, FieldValue, Effect } from '../index.js';
|
|
3
|
-
export {
|
|
3
|
+
export { p as PATTERN_TYPES, q as PatternConfig, r as PatternProps, s as PatternPropsMap, t as isValidPatternType } from '../effect-DZaXwSAz.js';
|
|
4
4
|
import { JsonValue } from '../factory/index.js';
|
|
5
5
|
import { EventPayloadValue, EventPayload, SExprObject, SExpr } from '../index.js';
|
|
6
6
|
import 'zod';
|
|
@@ -2144,6 +2144,16 @@ declare let mappings: {
|
|
|
2144
2144
|
importPath: string;
|
|
2145
2145
|
category: string;
|
|
2146
2146
|
};
|
|
2147
|
+
"machine-panel": {
|
|
2148
|
+
component: string;
|
|
2149
|
+
importPath: string;
|
|
2150
|
+
category: string;
|
|
2151
|
+
};
|
|
2152
|
+
"guest-view": {
|
|
2153
|
+
component: string;
|
|
2154
|
+
importPath: string;
|
|
2155
|
+
category: string;
|
|
2156
|
+
};
|
|
2147
2157
|
};
|
|
2148
2158
|
|
|
2149
2159
|
|
|
@@ -3325,122 +3335,6 @@ declare function renderUiEntriesOf(effects: readonly SExpr[]): Array<{
|
|
|
3325
3335
|
}>;
|
|
3326
3336
|
declare function renderUiEntriesOf(effects: readonly EffectNode[]): RenderUiEntry[];
|
|
3327
3337
|
|
|
3328
|
-
/**
|
|
3329
|
-
* Pattern Recommender
|
|
3330
|
-
*
|
|
3331
|
-
* Maps transition context (entity fields, domain category, UI state) to
|
|
3332
|
-
* ranked pattern suggestions using the registry's `suggestedFor` metadata,
|
|
3333
|
-
* category matching, and entity field type heuristics.
|
|
3334
|
-
*
|
|
3335
|
-
* Used by the design-transition tool to include top-N recommendations
|
|
3336
|
-
* in the LLM prompt context.
|
|
3337
|
-
*
|
|
3338
|
-
* @packageDocumentation
|
|
3339
|
-
*/
|
|
3340
|
-
|
|
3341
|
-
/**
|
|
3342
|
-
* Context for pattern recommendation.
|
|
3343
|
-
*/
|
|
3344
|
-
interface RecommendationContext {
|
|
3345
|
-
/** Current state name (e.g., "Browsing", "Creating") */
|
|
3346
|
-
state?: string;
|
|
3347
|
-
/** Triggering event (e.g., "INIT", "CREATE", "VIEW") */
|
|
3348
|
-
event?: string;
|
|
3349
|
-
/** Target UI slot */
|
|
3350
|
-
slot?: 'main' | 'modal' | 'drawer' | 'sidebar' | 'overlay';
|
|
3351
|
-
/** Domain category */
|
|
3352
|
-
domainCategory?: string;
|
|
3353
|
-
/** Entity field types present */
|
|
3354
|
-
entityFieldTypes?: string[];
|
|
3355
|
-
/** Entity has enum fields */
|
|
3356
|
-
hasEnumFields?: boolean;
|
|
3357
|
-
/** Entity has date/timestamp fields */
|
|
3358
|
-
hasDateFields?: boolean;
|
|
3359
|
-
/** Entity has numeric fields */
|
|
3360
|
-
hasNumericFields?: boolean;
|
|
3361
|
-
/** Entity has relation fields */
|
|
3362
|
-
hasRelationFields?: boolean;
|
|
3363
|
-
/** Entity has image/url fields */
|
|
3364
|
-
hasMediaFields?: boolean;
|
|
3365
|
-
}
|
|
3366
|
-
/**
|
|
3367
|
-
* A pattern recommendation with score and reasoning.
|
|
3368
|
-
*/
|
|
3369
|
-
interface PatternRecommendation {
|
|
3370
|
-
/** Pattern type name */
|
|
3371
|
-
pattern: PatternType;
|
|
3372
|
-
/** Relevance score (0-100) */
|
|
3373
|
-
score: number;
|
|
3374
|
-
/** Why this pattern was recommended */
|
|
3375
|
-
reason: string;
|
|
3376
|
-
/** Pattern category */
|
|
3377
|
-
category: string;
|
|
3378
|
-
/** Pattern description */
|
|
3379
|
-
description: string;
|
|
3380
|
-
/** Key props to use */
|
|
3381
|
-
keyProps: string[];
|
|
3382
|
-
}
|
|
3383
|
-
/**
|
|
3384
|
-
* Recommend patterns for a given context.
|
|
3385
|
-
*
|
|
3386
|
-
* Scoring algorithm:
|
|
3387
|
-
* 1. suggestedFor match with domain keywords (+30)
|
|
3388
|
-
* 2. suggestedFor match with event keywords (+25)
|
|
3389
|
-
* 3. Category affinity with slot (+20)
|
|
3390
|
-
* 4. Category affinity with state (+15)
|
|
3391
|
-
* 5. Entity field type bonus (+10 per matching heuristic)
|
|
3392
|
-
* 6. Entity-aware bonus for display patterns (+5)
|
|
3393
|
-
*
|
|
3394
|
-
* @returns Ranked pattern recommendations, highest score first
|
|
3395
|
-
*/
|
|
3396
|
-
declare function recommendPatterns(context: RecommendationContext, maxResults?: number): PatternRecommendation[];
|
|
3397
|
-
/**
|
|
3398
|
-
* Build recommendation context from entity field information.
|
|
3399
|
-
* Analyzes field types to set the boolean flags used by the recommender.
|
|
3400
|
-
*/
|
|
3401
|
-
declare function buildRecommendationContext(options: {
|
|
3402
|
-
state?: string;
|
|
3403
|
-
event?: string;
|
|
3404
|
-
slot?: 'main' | 'modal' | 'drawer' | 'sidebar' | 'overlay';
|
|
3405
|
-
domainCategory?: string;
|
|
3406
|
-
entityFields?: Array<{
|
|
3407
|
-
name: string;
|
|
3408
|
-
type: string;
|
|
3409
|
-
values?: string[];
|
|
3410
|
-
}>;
|
|
3411
|
-
}): RecommendationContext;
|
|
3412
|
-
/**
|
|
3413
|
-
* Format recommendations as a concise prompt section.
|
|
3414
|
-
* Used to inject into the design-transition tool's user prompt.
|
|
3415
|
-
*/
|
|
3416
|
-
declare function formatRecommendationsForPrompt(recommendations: PatternRecommendation[]): string;
|
|
3417
|
-
|
|
3418
|
-
/**
|
|
3419
|
-
* Pattern-swap compatibility — the deterministic shape gate for a contextual
|
|
3420
|
-
* pattern swap. A swap keeps the circuit closed when the replacement shares the
|
|
3421
|
-
* current pattern's entity-inlet cardinality and can emit the events the
|
|
3422
|
-
* consumer's trait listens for. Semantic ranking (which compatible pattern best
|
|
3423
|
-
* matches the user's instruction) is the embedding step, layered on top of this
|
|
3424
|
-
* gate — never the other way around.
|
|
3425
|
-
*/
|
|
3426
|
-
/** The data-inlet cardinality of a pattern (`record`/`collection`), or `null`
|
|
3427
|
-
* when the pattern has no entity inlet (layout / leaf patterns). */
|
|
3428
|
-
declare function getEntityCardinality(patternType: string): 'record' | 'collection' | null;
|
|
3429
|
-
/** Events a pattern emits, from its declared event-outlet contract. */
|
|
3430
|
-
declare function getEmittedEvents(patternType: string): string[];
|
|
3431
|
-
interface PatternSwapGate {
|
|
3432
|
-
/** Events the replacement MUST be able to emit (the trait's listened set), so
|
|
3433
|
-
* handlers still fire after the swap. Omit to skip the outlet gate. */
|
|
3434
|
-
requiredEmits?: readonly string[];
|
|
3435
|
-
}
|
|
3436
|
-
/**
|
|
3437
|
-
* Pattern types a `currentType` node can be swapped to while keeping the circuit
|
|
3438
|
-
* closed: same entity-inlet cardinality, and — when `requiredEmits` is given —
|
|
3439
|
-
* able to emit every required event. Deterministic and unranked; the caller
|
|
3440
|
-
* ranks the result semantically (embeddings).
|
|
3441
|
-
*/
|
|
3442
|
-
declare function findCompatiblePatterns(currentType: string, gate?: PatternSwapGate): string[];
|
|
3443
|
-
|
|
3444
3338
|
declare const SERVICES_REGISTRY: {
|
|
3445
3339
|
version: string;
|
|
3446
3340
|
exportedAt: string;
|
|
@@ -5570,6 +5464,16 @@ declare const COMPONENT_MAPPING: {
|
|
|
5570
5464
|
importPath: string;
|
|
5571
5465
|
category: string;
|
|
5572
5466
|
};
|
|
5467
|
+
"machine-panel": {
|
|
5468
|
+
component: string;
|
|
5469
|
+
importPath: string;
|
|
5470
|
+
category: string;
|
|
5471
|
+
};
|
|
5472
|
+
"guest-view": {
|
|
5473
|
+
component: string;
|
|
5474
|
+
importPath: string;
|
|
5475
|
+
category: string;
|
|
5476
|
+
};
|
|
5573
5477
|
};
|
|
5574
5478
|
};
|
|
5575
5479
|
declare const EVENT_CONTRACTS: {
|
|
@@ -6228,5 +6132,5 @@ type PatternsRegistry = {
|
|
|
6228
6132
|
};
|
|
6229
6133
|
declare function getComponentForPattern(patternType: string): string | null;
|
|
6230
6134
|
|
|
6231
|
-
export { AnyPatternConfig, COMPONENT_MAPPING, EVENT_CONTRACTS, PATTERN_REGISTRY, PROP_KINDS, PatternType, SELF_OVERLAY_PATTERN_TYPES, SERVICES_REGISTRY,
|
|
6232
|
-
export type { EmojiPickPayload, FormSubmitPayload, ItemActionPayload, LoadMoreRequestPayload, PatternCallbackArg, PatternEntry, PatternPayloadField, PatternPropDef, PatternPropTypeSchema,
|
|
6135
|
+
export { AnyPatternConfig, COMPONENT_MAPPING, EVENT_CONTRACTS, PATTERN_REGISTRY, PROP_KINDS, PatternType, SELF_OVERLAY_PATTERN_TYPES, SERVICES_REGISTRY, collectRenderUiPatternTypes, export_default$1 as componentMapping, export_default as eventContracts, eventKeyPropsOf, eventListPropsOf, generatePatternDescription, getAllPatternTypes, getComponentForPattern, getOrbAllowedPatterns, getOrbAllowedPatternsCompact, getOrbAllowedPatternsFiltered, getOrbAllowedPatternsSlim, getPatternActionsRef, getPatternDefinition, getPatternFieldsContract, getPatternMetadata, getPatternMinUsableWidths, getPatternPropsCompact, getPatternRuntimeDefinition, getPatternsGroupedByCategory, isBrowserOnlyService, isContentBodyPattern, isContentBodyPatternType, isDrawHostPattern, isDrawablePattern, isEntityAwarePattern, isMainSlotRenderUi, isValueInputPattern, patternsRegistry, registry, renderUiEntriesOf, renderUiPatternTypesOf, export_default$2 as servicesRegistry };
|
|
6136
|
+
export type { EmojiPickPayload, FormSubmitPayload, ItemActionPayload, LoadMoreRequestPayload, PatternCallbackArg, PatternEntry, PatternPayloadField, PatternPropDef, PatternPropTypeSchema, PatternsRegistry, PropKind, RenderUiEntry, RenderUiPayload, SelectionChangePayload };
|