@holoscript/core 7.0.0 → 8.0.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/README.md +2 -2
- package/bin/holoscript.cjs +3 -0
- package/dist/GLTFPipeline-276GE64O.js +16 -0
- package/dist/GLTFPipeline-M7WSSJED.cjs +37 -0
- package/dist/HoloScriptPlusParser-7FBIFUFC.js +693 -0
- package/dist/HoloScriptPlusParser-A2W7OCN2.cjs +698 -0
- package/dist/HoloScriptPlusParser-F2Z56FJR.js +10 -0
- package/dist/HoloScriptPlusParser-WKHRIH6T.cjs +27 -0
- package/dist/HoloScriptRuntime-3URVTKPJ.js +10 -0
- package/dist/HoloScriptRuntime-SXEAEU2N.cjs +19 -0
- package/dist/USDZExporter-3FWJ25JI.cjs +1037 -0
- package/dist/USDZExporter-D2HQLQYK.js +1035 -0
- package/dist/agents/index.cjs +19 -0
- package/dist/agents/index.d.ts +100 -0
- package/dist/agents/index.js +17 -0
- package/dist/chunk-23J755AR.js +1046 -0
- package/dist/chunk-253GBQZY.cjs +627 -0
- package/dist/chunk-25IQCHTO.cjs +781 -0
- package/dist/chunk-2BSMSUCE.js +1941 -0
- package/dist/chunk-2M2DPHKB.js +762 -0
- package/dist/chunk-2YSNA2F2.cjs +1274 -0
- package/dist/chunk-3AO425MZ.cjs +886 -0
- package/dist/chunk-3FOKASKO.cjs +348 -0
- package/dist/chunk-3HYYMEXI.cjs +56578 -0
- package/dist/chunk-3NFFOWGG.js +4287 -0
- package/dist/chunk-3WZEJHUQ.cjs +116 -0
- package/dist/chunk-4C57PR42.js +468 -0
- package/dist/chunk-4N4SXXWF.js +769 -0
- package/dist/chunk-4PDEPEQW.cjs +41 -0
- package/dist/chunk-4R6SBXDB.js +45 -0
- package/dist/chunk-4V2E7U7Q.cjs +2015 -0
- package/dist/chunk-5FSKKMR7.cjs +2092 -0
- package/dist/chunk-5GLCTO44.js +161 -0
- package/dist/chunk-5JEU52DW.js +382 -0
- package/dist/chunk-5S7RKFGR.cjs +446 -0
- package/dist/chunk-5WUNN6ZN.cjs +428 -0
- package/dist/chunk-62FBK3B7.js +70 -0
- package/dist/chunk-6CTRH7HT.cjs +1985 -0
- package/dist/chunk-6DPSFNJB.cjs +847 -0
- package/dist/chunk-6EX3I5P4.cjs +130 -0
- package/dist/chunk-73FELZVJ.cjs +611 -0
- package/dist/chunk-7CUEMLDZ.cjs +6445 -0
- package/dist/chunk-7HIASF7S.cjs +814 -0
- package/dist/chunk-A6KINLZJ.js +236 -0
- package/dist/chunk-AIA52I7T.cjs +543 -0
- package/dist/chunk-ANXZFVY2.js +113 -0
- package/dist/chunk-AYBXB26F.js +2176 -0
- package/dist/chunk-B4TFTDG4.js +449 -0
- package/dist/chunk-BE4UJCQT.js +623 -0
- package/dist/chunk-BRQJKJGT.cjs +20 -0
- package/dist/chunk-C2A5DUMF.cjs +689 -0
- package/dist/chunk-C37BHB7N.cjs +636 -0
- package/dist/chunk-CBJY23VL.js +126 -0
- package/dist/chunk-CIWWXYHZ.cjs +50 -0
- package/dist/chunk-CXFDRBQU.cjs +672 -0
- package/dist/chunk-D54CNIAJ.cjs +413 -0
- package/dist/chunk-DAJXW4KX.js +725 -0
- package/dist/chunk-DTGBOSEM.cjs +319 -0
- package/dist/chunk-E7JP3BS3.cjs +61 -0
- package/dist/chunk-EKBKLK7P.js +1169 -0
- package/dist/chunk-EKYL4PE3.cjs +404 -0
- package/dist/chunk-EUDQTK7N.cjs +4310 -0
- package/dist/chunk-EXKSFGSX.cjs +274 -0
- package/dist/chunk-EXUP2BUM.cjs +1173 -0
- package/dist/chunk-F43YAA34.js +623 -0
- package/dist/chunk-FDSGHPAK.js +130 -0
- package/dist/chunk-FEWUHQNM.cjs +144 -0
- package/dist/chunk-FGGJQRLZ.js +270 -0
- package/dist/chunk-FHP6LXJS.js +415 -0
- package/dist/chunk-FJPADH77.cjs +666 -0
- package/dist/chunk-FYSPZT4V.cjs +169 -0
- package/dist/chunk-GIOYPNTH.js +5575 -0
- package/dist/chunk-GJNCFRJU.cjs +125 -0
- package/dist/chunk-GMP623FG.cjs +1508 -0
- package/dist/chunk-GQHQOPXZ.cjs +5580 -0
- package/dist/chunk-GQT4TYKY.cjs +4381 -0
- package/dist/chunk-GTU2Z2WW.cjs +262 -0
- package/dist/chunk-GYZE55MO.js +2007 -0
- package/dist/chunk-GZG4KA4E.js +529 -0
- package/dist/chunk-H652NHX5.js +600 -0
- package/dist/chunk-HCCQLAA4.cjs +74 -0
- package/dist/chunk-HINXWAOD.cjs +1049 -0
- package/dist/chunk-HYNTS5CP.js +422 -0
- package/dist/chunk-HZSPDCXV.cjs +457 -0
- package/dist/chunk-HZTDET3N.js +1399 -0
- package/dist/chunk-I6XZ5DZF.cjs +488 -0
- package/dist/chunk-ILRBGFVD.cjs +72 -0
- package/dist/chunk-IPWSXCCN.js +1183 -0
- package/dist/chunk-IUTY5WQ2.cjs +424 -0
- package/dist/chunk-IVSZDECV.js +882 -0
- package/dist/chunk-IVY74O6C.js +247 -0
- package/dist/chunk-IZM5VQZD.js +714 -0
- package/dist/chunk-J32ZJZJH.js +554 -0
- package/dist/chunk-J6M4FPK5.js +421 -0
- package/dist/chunk-JC5YBPSF.cjs +984 -0
- package/dist/chunk-JCLBKPMX.js +3813 -0
- package/dist/chunk-JD7CIZ33.js +1949 -0
- package/dist/chunk-JIYN45TV.cjs +2525 -0
- package/dist/chunk-JJBE3TIH.cjs +1189 -0
- package/dist/chunk-JX7YL6ZE.js +2252 -0
- package/dist/chunk-K4VVR7CN.cjs +2433 -0
- package/dist/chunk-KEFNV2WM.cjs +2257 -0
- package/dist/chunk-KH4CNH66.cjs +424 -0
- package/dist/chunk-KJLB4OPV.js +5731 -0
- package/dist/chunk-KKFZ3B6J.cjs +557 -0
- package/dist/chunk-KKP7JKN4.cjs +6002 -0
- package/dist/chunk-KPJL34Y7.cjs +186 -0
- package/dist/chunk-KQCN6AKJ.cjs +3042 -0
- package/dist/chunk-KVRSTFNH.cjs +72 -0
- package/dist/chunk-LICPB5HZ.cjs +1409 -0
- package/dist/chunk-LM2VU56C.cjs +37 -0
- package/dist/chunk-M56JSP4A.js +400 -0
- package/dist/chunk-MBOOR7X4.js +18 -0
- package/dist/chunk-MGE5Z4GS.js +608 -0
- package/dist/chunk-MXFUTKCO.js +56 -0
- package/dist/chunk-MYY4PMWX.cjs +264 -0
- package/dist/chunk-N75IH2HY.js +258 -0
- package/dist/chunk-NBMHU6SW.js +669 -0
- package/dist/chunk-NG77ATEW.cjs +778 -0
- package/dist/chunk-NGKREZ36.js +6384 -0
- package/dist/chunk-NHWSN2SD.cjs +718 -0
- package/dist/chunk-NV4VMVXU.js +421 -0
- package/dist/chunk-NW5G5FBQ.js +215 -0
- package/dist/chunk-NXZFOPVD.cjs +5737 -0
- package/dist/chunk-OBIYPYYS.cjs +1993 -0
- package/dist/chunk-OIQYIIO3.cjs +473 -0
- package/dist/chunk-OL46QLBJ.js +61 -0
- package/dist/chunk-OMXII44L.js +5386 -0
- package/dist/chunk-OR4Q2BGL.cjs +759 -0
- package/dist/chunk-OSYNRVOV.cjs +243 -0
- package/dist/chunk-PGANYCAG.cjs +220 -0
- package/dist/chunk-PHENW4MQ.js +65 -0
- package/dist/chunk-PHVRG4I2.js +844 -0
- package/dist/chunk-Q56TT7IL.js +483 -0
- package/dist/chunk-QPOQ7VPI.js +1491 -0
- package/dist/chunk-QPSKHBJP.js +5963 -0
- package/dist/chunk-QXH7QDSZ.js +1989 -0
- package/dist/chunk-R75BSDH7.cjs +50 -0
- package/dist/chunk-RARB3MBR.js +207 -0
- package/dist/chunk-RVBHAXFG.js +56160 -0
- package/dist/chunk-S3MDHNKB.cjs +490 -0
- package/dist/chunk-S4W6Z2MN.js +2426 -0
- package/dist/chunk-S6YWHCKV.cjs +410 -0
- package/dist/chunk-SIEXCILW.js +229 -0
- package/dist/chunk-SJBGLS25.cjs +2196 -0
- package/dist/chunk-SLU6UPJI.cjs +410 -0
- package/dist/chunk-SMIWS6DE.cjs +212 -0
- package/dist/chunk-T2QCTZMO.js +811 -0
- package/dist/chunk-T5J7ZKP3.cjs +4885 -0
- package/dist/chunk-TDCNJHWO.js +341 -0
- package/dist/chunk-TG7O4WBC.js +406 -0
- package/dist/chunk-THCK6ECW.js +2085 -0
- package/dist/chunk-TJHVSBP2.js +439 -0
- package/dist/chunk-TVHSPJ4N.cjs +606 -0
- package/dist/chunk-U44IKGG7.cjs +5390 -0
- package/dist/chunk-UJXISJBN.js +487 -0
- package/dist/chunk-UM6C3CGK.js +4375 -0
- package/dist/chunk-UMABK6SI.js +686 -0
- package/dist/chunk-UOIGFQXC.cjs +9750 -0
- package/dist/chunk-URG2SJLK.js +2521 -0
- package/dist/chunk-V6MKC2FZ.js +979 -0
- package/dist/chunk-VECQYRXL.js +474 -0
- package/dist/chunk-VJ3L7CHT.cjs +169 -0
- package/dist/chunk-VMLKSV26.js +1216 -0
- package/dist/chunk-VVKVQZI6.js +55 -0
- package/dist/chunk-W6RW64BB.cjs +1219 -0
- package/dist/chunk-W7VDOASB.cjs +639 -0
- package/dist/chunk-WDT3JTGM.cjs +483 -0
- package/dist/chunk-WJIHFLMJ.js +404 -0
- package/dist/chunk-WKX5AMOY.js +309 -0
- package/dist/chunk-WNNE3PO3.js +34 -0
- package/dist/chunk-WRKUDAZJ.js +3038 -0
- package/dist/chunk-WRLUBRKS.cjs +1943 -0
- package/dist/chunk-WRNEH5MO.js +3169 -0
- package/dist/chunk-WRWEX5ZF.js +658 -0
- package/dist/chunk-X3GJPRVK.cjs +3246 -0
- package/dist/chunk-XHIV6326.cjs +793 -0
- package/dist/chunk-XIVIE43A.cjs +729 -0
- package/dist/chunk-XJAN7CZG.cjs +432 -0
- package/dist/chunk-XKTPFXGA.js +164 -0
- package/dist/chunk-XL6INWKT.js +121 -0
- package/dist/chunk-XSFNHP2E.js +632 -0
- package/dist/chunk-XT6JY5W5.js +9684 -0
- package/dist/chunk-XUILI4KB.cjs +430 -0
- package/dist/chunk-XUUVDHIF.cjs +3962 -0
- package/dist/chunk-YF2I3MV3.js +46 -0
- package/dist/chunk-YIMN575O.js +4847 -0
- package/dist/chunk-YIVFJNYV.js +176 -0
- package/dist/chunk-YKGPCZEE.cjs +237 -0
- package/dist/chunk-YN6V7R3L.cjs +327 -0
- package/dist/chunk-YQELFNJV.js +39 -0
- package/dist/chunk-YYXH45E2.js +426 -0
- package/dist/chunk-ZBQXLH2L.js +756 -0
- package/dist/chunk-ZDSYWBIE.cjs +69 -0
- package/dist/chunk-ZU7NIRT6.js +325 -0
- package/dist/chunk-ZZ7RO2UQ.js +1243 -0
- package/dist/chunk-ZZEI7MV4.js +778 -0
- package/dist/cli/holoscript-runner.cjs +2255 -0
- package/dist/cli/holoscript-runner.js +2230 -0
- package/dist/codebase/index.cjs +336 -0
- package/dist/codebase/index.js +331 -0
- package/dist/compiler/agent-inference.cjs +31 -0
- package/dist/compiler/agent-inference.js +8 -0
- package/dist/compiler/android-xr.cjs +24 -0
- package/dist/compiler/android-xr.js +14 -0
- package/dist/compiler/android.cjs +24 -0
- package/dist/compiler/android.js +14 -0
- package/dist/compiler/ar.cjs +23 -0
- package/dist/compiler/ar.js +11 -0
- package/dist/compiler/babylon.cjs +21 -0
- package/dist/compiler/babylon.js +15 -0
- package/dist/compiler/business-quest.cjs +43 -0
- package/dist/compiler/business-quest.js +4 -0
- package/dist/compiler/coco.cjs +27 -0
- package/dist/compiler/coco.js +4 -0
- package/dist/compiler/context.cjs +25 -0
- package/dist/compiler/context.d.ts +28 -0
- package/dist/compiler/context.js +8 -0
- package/dist/compiler/domain-block-utils.cjs +605 -0
- package/dist/compiler/domain-block-utils.js +11 -0
- package/dist/compiler/dtdl.cjs +27 -0
- package/dist/compiler/dtdl.js +11 -0
- package/dist/compiler/gltf-pipeline.cjs +39 -0
- package/dist/compiler/gltf-pipeline.js +4 -0
- package/dist/compiler/godot.cjs +18 -0
- package/dist/compiler/godot.js +12 -0
- package/dist/compiler/incremental.cjs +34 -0
- package/dist/compiler/incremental.js +9 -0
- package/dist/compiler/index.cjs +5860 -0
- package/dist/compiler/index.d.ts +322 -21
- package/dist/compiler/index.js +5525 -0
- package/dist/compiler/ios.cjs +23 -0
- package/dist/compiler/ios.js +13 -0
- package/dist/compiler/llm-provider-capabilities.cjs +25 -0
- package/dist/compiler/llm-provider-capabilities.d.ts +43 -0
- package/dist/compiler/llm-provider-capabilities.js +8 -0
- package/dist/compiler/multi-layer.cjs +24 -0
- package/dist/compiler/multi-layer.js +15 -0
- package/dist/compiler/nodetoy.cjs +23 -0
- package/dist/compiler/nodetoy.js +4 -0
- package/dist/compiler/openxr.cjs +19 -0
- package/dist/compiler/openxr.js +13 -0
- package/dist/compiler/playcanvas.cjs +19 -0
- package/dist/compiler/playcanvas.js +13 -0
- package/dist/compiler/r3f.cjs +38 -0
- package/dist/compiler/r3f.d.ts +22 -0
- package/dist/compiler/r3f.js +16 -0
- package/dist/compiler/remotion.cjs +23 -0
- package/dist/compiler/remotion.js +4 -0
- package/dist/compiler/reproducibility.cjs +39 -0
- package/dist/compiler/reproducibility.js +4 -0
- package/dist/compiler/sdf.cjs +24 -0
- package/dist/compiler/sdf.js +12 -0
- package/dist/compiler/semantic-scene.cjs +31 -0
- package/dist/compiler/semantic-scene.js +4 -0
- package/dist/compiler/state.cjs +21 -0
- package/dist/compiler/state.js +11 -0
- package/dist/compiler/trait-composition.cjs +30 -0
- package/dist/compiler/trait-composition.js +9 -0
- package/dist/compiler/unity.cjs +19 -0
- package/dist/compiler/unity.js +13 -0
- package/dist/compiler/unreal.cjs +23 -0
- package/dist/compiler/unreal.js +13 -0
- package/dist/compiler/urdf.cjs +52 -0
- package/dist/compiler/urdf.js +12 -0
- package/dist/compiler/usd-physics.cjs +26 -0
- package/dist/compiler/usd-physics.js +9 -0
- package/dist/compiler/visionos.cjs +19 -0
- package/dist/compiler/visionos.js +13 -0
- package/dist/compiler/vrchat.cjs +22 -0
- package/dist/compiler/vrchat.js +12 -0
- package/dist/compiler/vrr.cjs +24 -0
- package/dist/compiler/vrr.js +12 -0
- package/dist/compiler/wasm.cjs +36 -0
- package/dist/compiler/wasm.js +12 -0
- package/dist/compiler/webgpu.cjs +18 -0
- package/dist/compiler/webgpu.js +12 -0
- package/dist/coordinators/index.cjs +1266 -0
- package/dist/coordinators/index.d.ts +72 -1
- package/dist/coordinators/index.js +1259 -0
- package/dist/debugger.cjs +24 -0
- package/dist/debugger.js +11 -0
- package/dist/entries/interop.cjs +64 -0
- package/dist/entries/interop.js +7 -0
- package/dist/entries/scripting.cjs +55 -0
- package/dist/entries/scripting.js +10 -0
- package/dist/hololand/index.cjs +146 -0
- package/dist/hololand/index.d.ts +70 -0
- package/dist/hololand/index.js +5 -0
- package/dist/index.cjs +43233 -0
- package/dist/index.d.ts +976 -21
- package/dist/index.js +39995 -0
- package/dist/math/tropical-spmv.cjs +45 -0
- package/dist/math/tropical-spmv.js +4 -0
- package/dist/math/vec3.cjs +57 -0
- package/dist/math/vec3.js +4 -0
- package/dist/ml-dsa-FSKBTE3W.cjs +1265 -0
- package/dist/ml-dsa-Z7JDKW4L.js +1265 -0
- package/dist/paper-0c-spike/index.cjs +150 -0
- package/dist/paper-0c-spike/index.js +141 -0
- package/dist/parser.cjs +61 -0
- package/dist/parser.d.ts +11 -0
- package/dist/parser.js +12 -0
- package/dist/playwright-3AT3AKTV.cjs +98673 -0
- package/dist/playwright-VZPDVUEQ.js +98660 -0
- package/dist/reconstruction/index.cjs +153 -0
- package/dist/reconstruction/index.d.ts +29 -2
- package/dist/reconstruction/index.js +8 -0
- package/dist/runtime.cjs +316 -0
- package/dist/runtime.d.ts +61 -0
- package/dist/runtime.js +31 -0
- package/dist/self-improvement/index.cjs +563 -0
- package/dist/self-improvement/index.js +545 -0
- package/dist/storage/index.cjs +38 -0
- package/dist/storage/index.js +5 -0
- package/dist/testing.cjs +25 -0
- package/dist/testing.d.ts +70 -0
- package/dist/testing.js +4 -0
- package/dist/traitDocs/traitDocs.cjs +33 -0
- package/dist/traitDocs/traitDocs.js +7 -0
- package/dist/traits/botanical-lotus.cjs +41 -0
- package/dist/traits/botanical-lotus.d.ts +172 -0
- package/dist/traits/botanical-lotus.js +4 -0
- package/dist/traits/engines/index.cjs +520 -0
- package/dist/traits/engines/index.js +380 -0
- package/dist/traits/index.cjs +24409 -0
- package/dist/traits/index.d.ts +171 -35
- package/dist/traits/index.js +21634 -0
- package/dist/traits/simulation-solver-factory.cjs +13 -0
- package/dist/traits/simulation-solver-factory.d.ts +23 -0
- package/dist/traits/simulation-solver-factory.js +4 -0
- package/dist/traits/webcam-gaze.cjs +35 -0
- package/dist/traits/webcam-gaze.d.ts +17 -0
- package/dist/traits/webcam-gaze.js +4 -0
- package/dist/type-checker.cjs +19 -0
- package/dist/type-checker.js +6 -0
- package/dist/world/index.cjs +947 -0
- package/dist/world/index.d.ts +147 -0
- package/dist/world/index.js +939 -0
- package/dist/world-model/index.cjs +1446 -0
- package/dist/world-model/index.d.ts +119 -0
- package/dist/world-model/index.js +1414 -0
- package/dist/wot/index.cjs +29 -0
- package/dist/wot/index.js +4 -0
- package/package.json +93 -49
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import { init_safeJsonParse, readJson } from './chunk-VVKVQZI6.js';
|
|
2
|
+
|
|
3
|
+
// src/traits/traitConstraints.ts
|
|
4
|
+
var BUILTIN_CONSTRAINTS = [
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// PHYSICS & INTERACTION REQUIREMENTS
|
|
7
|
+
// =============================================================================
|
|
8
|
+
{
|
|
9
|
+
type: "requires",
|
|
10
|
+
source: "physics",
|
|
11
|
+
targets: ["collidable"],
|
|
12
|
+
message: "Physics enabled objects must be collidable."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: "requires",
|
|
16
|
+
source: "grabbable",
|
|
17
|
+
targets: ["physics"],
|
|
18
|
+
message: "Grabbable objects require physics to handle movement and collisions."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: "requires",
|
|
22
|
+
source: "throwable",
|
|
23
|
+
targets: ["grabbable"],
|
|
24
|
+
message: "Throwable objects must be grabbable first."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: "requires",
|
|
28
|
+
source: "stackable",
|
|
29
|
+
targets: ["physics", "collidable"],
|
|
30
|
+
message: "Stackable objects require physics and collision detection."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "requires",
|
|
34
|
+
source: "breakable",
|
|
35
|
+
targets: ["physics", "collidable"],
|
|
36
|
+
message: "Breakable objects require physics and collision to detect impacts."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "requires",
|
|
40
|
+
source: "snappable",
|
|
41
|
+
targets: ["grabbable"],
|
|
42
|
+
message: "Snappable objects must be grabbable to snap to positions."
|
|
43
|
+
},
|
|
44
|
+
// =============================================================================
|
|
45
|
+
// CONFLICT RULES
|
|
46
|
+
// =============================================================================
|
|
47
|
+
{
|
|
48
|
+
type: "conflicts",
|
|
49
|
+
source: "static",
|
|
50
|
+
targets: ["physics", "grabbable", "throwable", "scalable", "rotatable"],
|
|
51
|
+
message: "Static objects cannot have physics or be interactive (grabbable/throwable/scalable/rotatable)."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "conflicts",
|
|
55
|
+
source: "kinematic",
|
|
56
|
+
targets: ["physics"],
|
|
57
|
+
message: "Kinematic objects handle their own motion and conflict with physics simulation."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: "conflicts",
|
|
61
|
+
source: "invisible",
|
|
62
|
+
targets: ["hoverable", "pointable"],
|
|
63
|
+
message: "Invisible objects cannot have hover or pointer visual feedback."
|
|
64
|
+
},
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// PLATFORM EXCLUSIVITY
|
|
67
|
+
// =============================================================================
|
|
68
|
+
{
|
|
69
|
+
type: "conflicts",
|
|
70
|
+
source: "vr_only",
|
|
71
|
+
targets: ["ar_only"],
|
|
72
|
+
message: "An object cannot be marked as both VR-only and AR-only."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: "conflicts",
|
|
76
|
+
source: "desktop_only",
|
|
77
|
+
targets: ["vr_only", "ar_only"],
|
|
78
|
+
message: "Desktop-only objects cannot also be VR-only or AR-only."
|
|
79
|
+
},
|
|
80
|
+
// =============================================================================
|
|
81
|
+
// MATERIAL & MESH DEPENDENCIES
|
|
82
|
+
// =============================================================================
|
|
83
|
+
{
|
|
84
|
+
type: "requires",
|
|
85
|
+
source: "cloth",
|
|
86
|
+
targets: ["mesh"],
|
|
87
|
+
message: "Cloth physics requires a mesh to deform."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "requires",
|
|
91
|
+
source: "soft_body",
|
|
92
|
+
targets: ["mesh"],
|
|
93
|
+
message: "Soft body physics requires a mesh."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: "requires",
|
|
97
|
+
source: "particle_emitter",
|
|
98
|
+
targets: ["visible"],
|
|
99
|
+
message: "Particle emitters must be visible to render particles."
|
|
100
|
+
},
|
|
101
|
+
// =============================================================================
|
|
102
|
+
// AUDIO REQUIREMENTS
|
|
103
|
+
// =============================================================================
|
|
104
|
+
{
|
|
105
|
+
type: "requires",
|
|
106
|
+
source: "spatial_audio",
|
|
107
|
+
targets: ["audio"],
|
|
108
|
+
message: "Spatial audio requires an audio source."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: "requires",
|
|
112
|
+
source: "audio_zone",
|
|
113
|
+
targets: ["collidable"],
|
|
114
|
+
message: "Audio zones require collision bounds to detect entry/exit."
|
|
115
|
+
},
|
|
116
|
+
// =============================================================================
|
|
117
|
+
// INTERACTION EXCLUSIVITY (one-of rules)
|
|
118
|
+
// =============================================================================
|
|
119
|
+
{
|
|
120
|
+
type: "oneof",
|
|
121
|
+
source: "interaction_mode",
|
|
122
|
+
targets: ["grabbable", "clickable", "draggable"],
|
|
123
|
+
message: "Objects should have one primary interaction mode to avoid conflicts."
|
|
124
|
+
},
|
|
125
|
+
// =============================================================================
|
|
126
|
+
// ANIMATION REQUIREMENTS
|
|
127
|
+
// =============================================================================
|
|
128
|
+
{
|
|
129
|
+
type: "requires",
|
|
130
|
+
source: "animated",
|
|
131
|
+
targets: ["mesh"],
|
|
132
|
+
message: "Animated trait requires a mesh with animation data."
|
|
133
|
+
},
|
|
134
|
+
// =============================================================================
|
|
135
|
+
// NETWORKING REQUIREMENTS
|
|
136
|
+
// =============================================================================
|
|
137
|
+
{
|
|
138
|
+
type: "requires",
|
|
139
|
+
source: "networked",
|
|
140
|
+
targets: ["physics"],
|
|
141
|
+
message: "Networked objects require physics for state synchronization."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: "conflicts",
|
|
145
|
+
source: "local_only",
|
|
146
|
+
targets: ["networked"],
|
|
147
|
+
message: "Local-only objects cannot be networked."
|
|
148
|
+
},
|
|
149
|
+
// =============================================================================
|
|
150
|
+
// UI TRAIT CONSTRAINTS
|
|
151
|
+
// =============================================================================
|
|
152
|
+
{
|
|
153
|
+
type: "conflicts",
|
|
154
|
+
source: "ui_floating",
|
|
155
|
+
targets: ["ui_anchored", "ui_docked"],
|
|
156
|
+
message: "UI panels cannot be both floating and anchored/docked."
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: "conflicts",
|
|
160
|
+
source: "ui_anchored",
|
|
161
|
+
targets: ["ui_floating", "ui_docked"],
|
|
162
|
+
message: "UI panels cannot be both anchored and floating/docked."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: "conflicts",
|
|
166
|
+
source: "ui_hand_menu",
|
|
167
|
+
targets: ["ui_anchored", "ui_docked"],
|
|
168
|
+
message: "Hand menus cannot be anchored to world or docked."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
type: "requires",
|
|
172
|
+
source: "ui_keyboard",
|
|
173
|
+
targets: ["ui_input"],
|
|
174
|
+
message: "Keyboard trait requires an input element to target."
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: "oneof",
|
|
178
|
+
source: "ui_position_mode",
|
|
179
|
+
targets: ["ui_floating", "ui_anchored", "ui_docked", "ui_hand_menu"],
|
|
180
|
+
message: "UI element can only have one positioning mode."
|
|
181
|
+
},
|
|
182
|
+
// =============================================================================
|
|
183
|
+
// SPATIAL CONSTRAINT TRAIT REQUIREMENTS
|
|
184
|
+
// =============================================================================
|
|
185
|
+
// spatial_adjacent requires collidable bounds for distance measurement
|
|
186
|
+
{
|
|
187
|
+
type: "requires",
|
|
188
|
+
source: "spatial_adjacent",
|
|
189
|
+
targets: ["collidable"],
|
|
190
|
+
message: "spatial_adjacent requires collidable bounds to measure distance between entities.",
|
|
191
|
+
suggestion: "Add @collidable to provide bounds for spatial adjacency checking."
|
|
192
|
+
},
|
|
193
|
+
// spatial_contains requires collidable bounds to define the container volume
|
|
194
|
+
{
|
|
195
|
+
type: "requires",
|
|
196
|
+
source: "spatial_contains",
|
|
197
|
+
targets: ["collidable"],
|
|
198
|
+
message: "spatial_contains requires collidable bounds to define the container volume.",
|
|
199
|
+
suggestion: "Add @collidable to define the bounding volume for containment checking."
|
|
200
|
+
},
|
|
201
|
+
// spatial_reachable requires spatial_awareness for runtime path validation
|
|
202
|
+
{
|
|
203
|
+
type: "requires",
|
|
204
|
+
source: "spatial_reachable",
|
|
205
|
+
targets: ["spatial_awareness"],
|
|
206
|
+
message: "spatial_reachable requires spatial_awareness for runtime path and obstacle detection.",
|
|
207
|
+
suggestion: "Add @spatial_awareness to enable spatial context for reachability checks."
|
|
208
|
+
},
|
|
209
|
+
// spatial_contains conflicts with static (containers may need dynamic bounds)
|
|
210
|
+
{
|
|
211
|
+
type: "conflicts",
|
|
212
|
+
source: "spatial_contains",
|
|
213
|
+
targets: ["invisible"],
|
|
214
|
+
message: "spatial_contains containers cannot be invisible; contained entities need visible boundary reference.",
|
|
215
|
+
suggestion: "Remove @invisible or use @spatial_adjacent instead for invisible reference points."
|
|
216
|
+
},
|
|
217
|
+
// Only one spatial constraint enforcement mode per entity
|
|
218
|
+
{
|
|
219
|
+
type: "oneof",
|
|
220
|
+
source: "spatial_constraint_mode",
|
|
221
|
+
targets: ["spatial_adjacent", "spatial_contains"],
|
|
222
|
+
message: "An entity should declare either spatial_adjacent or spatial_contains, not both. Use spatial_adjacent for proximity or spatial_contains for enclosure.",
|
|
223
|
+
suggestion: 'Choose the most appropriate spatial relationship: @spatial_adjacent for "near" or @spatial_contains for "inside".'
|
|
224
|
+
},
|
|
225
|
+
// =============================================================================
|
|
226
|
+
// SPATIOTEMPORAL CONSTRAINT TRAIT REQUIREMENTS
|
|
227
|
+
// =============================================================================
|
|
228
|
+
// spatial_temporal_adjacent requires collidable for distance measurement
|
|
229
|
+
{
|
|
230
|
+
type: "requires",
|
|
231
|
+
source: "spatial_temporal_adjacent",
|
|
232
|
+
targets: ["collidable"],
|
|
233
|
+
message: "spatial_temporal_adjacent requires collidable bounds to measure distance and track duration.",
|
|
234
|
+
suggestion: "Add @collidable to provide bounds for temporal adjacency checking."
|
|
235
|
+
},
|
|
236
|
+
// spatial_temporal_adjacent conflicts with plain spatial_adjacent on same entity
|
|
237
|
+
{
|
|
238
|
+
type: "conflicts",
|
|
239
|
+
source: "spatial_temporal_adjacent",
|
|
240
|
+
targets: ["spatial_adjacent"],
|
|
241
|
+
message: "spatial_temporal_adjacent supersedes spatial_adjacent. Use one or the other.",
|
|
242
|
+
suggestion: "Remove @spatial_adjacent if duration-based adjacency is desired, or remove @spatial_temporal_adjacent for simple distance checking."
|
|
243
|
+
},
|
|
244
|
+
// spatial_temporal_reachable requires spatial_awareness
|
|
245
|
+
{
|
|
246
|
+
type: "requires",
|
|
247
|
+
source: "spatial_temporal_reachable",
|
|
248
|
+
targets: ["spatial_awareness"],
|
|
249
|
+
message: "spatial_temporal_reachable requires spatial_awareness for velocity tracking and obstacle prediction.",
|
|
250
|
+
suggestion: "Add @spatial_awareness to enable spatial context for velocity-predicted reachability."
|
|
251
|
+
},
|
|
252
|
+
// spatial_temporal_reachable conflicts with plain spatial_reachable
|
|
253
|
+
{
|
|
254
|
+
type: "conflicts",
|
|
255
|
+
source: "spatial_temporal_reachable",
|
|
256
|
+
targets: ["spatial_reachable"],
|
|
257
|
+
message: "spatial_temporal_reachable supersedes spatial_reachable. Use one or the other.",
|
|
258
|
+
suggestion: "Remove @spatial_reachable if velocity-predicted reachability is desired, or remove @spatial_temporal_reachable for static reachability."
|
|
259
|
+
},
|
|
260
|
+
// spatial_trajectory requires physics for velocity/acceleration data
|
|
261
|
+
{
|
|
262
|
+
type: "requires",
|
|
263
|
+
source: "spatial_trajectory",
|
|
264
|
+
targets: ["physics"],
|
|
265
|
+
message: "spatial_trajectory requires physics for velocity and acceleration data to predict trajectories.",
|
|
266
|
+
suggestion: "Add @physics to enable trajectory prediction from velocity data."
|
|
267
|
+
},
|
|
268
|
+
// spatial_trajectory requires collidable for bounds checking
|
|
269
|
+
{
|
|
270
|
+
type: "requires",
|
|
271
|
+
source: "spatial_trajectory",
|
|
272
|
+
targets: ["collidable"],
|
|
273
|
+
message: "spatial_trajectory requires collidable bounds for keep_in/keep_out region checking.",
|
|
274
|
+
suggestion: "Add @collidable to provide bounds for trajectory constraint checking."
|
|
275
|
+
},
|
|
276
|
+
// =============================================================================
|
|
277
|
+
// ROBOTICS / URDF ROBOT MODEL CONSTRAINTS
|
|
278
|
+
// =============================================================================
|
|
279
|
+
{
|
|
280
|
+
type: "conflicts",
|
|
281
|
+
source: "urdf_robot",
|
|
282
|
+
targets: ["cloth", "soft_body", "fluid"],
|
|
283
|
+
message: "URDF robot models use rigid body joints and cannot have cloth, soft body, or fluid physics."
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
type: "conflicts",
|
|
287
|
+
source: "urdf_robot",
|
|
288
|
+
targets: ["particle_emitter"],
|
|
289
|
+
message: "URDF robot models define their own visual hierarchy and conflict with particle emitters."
|
|
290
|
+
},
|
|
291
|
+
// =============================================================================
|
|
292
|
+
// CULTURAL PROFILE TRAIT CONSTRAINTS
|
|
293
|
+
// =============================================================================
|
|
294
|
+
// norm_compliant requires cultural_profile — agents must declare cultural identity
|
|
295
|
+
// before they can be subject to norm compliance checking
|
|
296
|
+
{
|
|
297
|
+
type: "requires",
|
|
298
|
+
source: "norm_compliant",
|
|
299
|
+
targets: ["cultural_profile"],
|
|
300
|
+
message: "Norm compliance requires a cultural_profile to define the agent's cultural identity.",
|
|
301
|
+
suggestion: "Add @cultural_profile with cooperation_index, cultural_family, prompt_dialect, and norm_set."
|
|
302
|
+
},
|
|
303
|
+
// cultural_memory requires cultural_profile — cultural memory storage needs
|
|
304
|
+
// a cultural identity context to organize episodic and stigmergic memories
|
|
305
|
+
{
|
|
306
|
+
type: "requires",
|
|
307
|
+
source: "cultural_memory",
|
|
308
|
+
targets: ["cultural_profile"],
|
|
309
|
+
message: "Cultural memory requires a cultural_profile to contextualize memory storage.",
|
|
310
|
+
suggestion: "Add @cultural_profile before using @cultural_memory on an agent."
|
|
311
|
+
},
|
|
312
|
+
// cultural_profile conflicts with isolationist + networked combination
|
|
313
|
+
// (isolationist agents should not be networked — contradicts their nature)
|
|
314
|
+
{
|
|
315
|
+
type: "conflicts",
|
|
316
|
+
source: "cultural_trace",
|
|
317
|
+
targets: ["invisible"],
|
|
318
|
+
message: "Cultural traces (stigmergic markers) must be visible for other agents to perceive them.",
|
|
319
|
+
suggestion: "Remove @invisible from objects bearing @cultural_trace, or use a visible marker."
|
|
320
|
+
},
|
|
321
|
+
// =============================================================================
|
|
322
|
+
// v6 UNIVERSAL SERVICE DOMAIN CONSTRAINTS
|
|
323
|
+
// =============================================================================
|
|
324
|
+
// Endpoint requires service — endpoints belong to a service context
|
|
325
|
+
{
|
|
326
|
+
type: "requires",
|
|
327
|
+
source: "endpoint",
|
|
328
|
+
targets: ["service"],
|
|
329
|
+
message: "Endpoints must belong to a service context.",
|
|
330
|
+
suggestion: "Wrap this endpoint in a service block or add @service trait."
|
|
331
|
+
},
|
|
332
|
+
// Handler requires http or route — handlers need an HTTP binding
|
|
333
|
+
{
|
|
334
|
+
type: "requires",
|
|
335
|
+
source: "handler",
|
|
336
|
+
targets: ["http"],
|
|
337
|
+
message: "Handlers require an HTTP binding to receive requests.",
|
|
338
|
+
suggestion: "Add @http trait with method and path properties."
|
|
339
|
+
},
|
|
340
|
+
// CORS requires http — CORS is HTTP-specific
|
|
341
|
+
{
|
|
342
|
+
type: "requires",
|
|
343
|
+
source: "cors",
|
|
344
|
+
targets: ["http"],
|
|
345
|
+
message: "CORS is an HTTP-specific concern and requires an HTTP binding.",
|
|
346
|
+
suggestion: "Add @http to enable CORS headers on HTTP responses."
|
|
347
|
+
},
|
|
348
|
+
// Rate limit requires http — rate limiting is HTTP-specific
|
|
349
|
+
{
|
|
350
|
+
type: "requires",
|
|
351
|
+
source: "rate_limit",
|
|
352
|
+
targets: ["http"],
|
|
353
|
+
message: "Rate limiting requires HTTP request context.",
|
|
354
|
+
suggestion: "Add @http to enable request-based rate limiting."
|
|
355
|
+
},
|
|
356
|
+
// Auth requires service or http — auth middleware needs service context
|
|
357
|
+
{
|
|
358
|
+
type: "requires",
|
|
359
|
+
source: "auth",
|
|
360
|
+
targets: ["http"],
|
|
361
|
+
message: "Auth middleware requires an HTTP context for token validation.",
|
|
362
|
+
suggestion: "Add @http to enable authentication on HTTP endpoints."
|
|
363
|
+
},
|
|
364
|
+
// Gateway conflicts with proxy — different service patterns
|
|
365
|
+
{
|
|
366
|
+
type: "conflicts",
|
|
367
|
+
source: "gateway",
|
|
368
|
+
targets: ["proxy"],
|
|
369
|
+
message: "Gateway and proxy are mutually exclusive service patterns.",
|
|
370
|
+
suggestion: "Use @gateway for API aggregation or @proxy for transparent forwarding, not both."
|
|
371
|
+
},
|
|
372
|
+
// Load balancer conflicts with gateway — different infra layers
|
|
373
|
+
{
|
|
374
|
+
type: "conflicts",
|
|
375
|
+
source: "load_balancer",
|
|
376
|
+
targets: ["gateway"],
|
|
377
|
+
message: "Load balancer and gateway operate at different infrastructure layers.",
|
|
378
|
+
suggestion: "Use @load_balancer for L4/L7 traffic distribution or @gateway for API aggregation."
|
|
379
|
+
},
|
|
380
|
+
// Service position mode — only one service architecture pattern
|
|
381
|
+
{
|
|
382
|
+
type: "oneof",
|
|
383
|
+
source: "service_architecture_mode",
|
|
384
|
+
targets: ["gateway", "proxy", "load_balancer", "middleware"],
|
|
385
|
+
message: "Only one service architecture pattern per entity.",
|
|
386
|
+
suggestion: "Choose one: @gateway, @proxy, @load_balancer, or @middleware."
|
|
387
|
+
},
|
|
388
|
+
// =============================================================================
|
|
389
|
+
// v6 UNIVERSAL DATA DOMAIN CONSTRAINTS
|
|
390
|
+
// =============================================================================
|
|
391
|
+
// Data index requires data_model — index needs a model to index
|
|
392
|
+
{
|
|
393
|
+
type: "requires",
|
|
394
|
+
source: "data_index",
|
|
395
|
+
targets: ["data_model"],
|
|
396
|
+
message: "Data indexes require a data model to define the indexed columns.",
|
|
397
|
+
suggestion: "Define a data_model block before creating indexes on it."
|
|
398
|
+
},
|
|
399
|
+
// Data trigger requires data_model — trigger needs a model
|
|
400
|
+
{
|
|
401
|
+
type: "requires",
|
|
402
|
+
source: "data_trigger",
|
|
403
|
+
targets: ["data_model"],
|
|
404
|
+
message: "Data triggers must reference a data model table.",
|
|
405
|
+
suggestion: "Define a data_model block to provide the table for this trigger."
|
|
406
|
+
},
|
|
407
|
+
// Stored procedure requires data_model — SP needs model context
|
|
408
|
+
{
|
|
409
|
+
type: "requires",
|
|
410
|
+
source: "stored_procedure",
|
|
411
|
+
targets: ["data_model"],
|
|
412
|
+
message: "Stored procedures operate on data models.",
|
|
413
|
+
suggestion: "Define a data_model block that this stored procedure targets."
|
|
414
|
+
},
|
|
415
|
+
// Data view requires data_model — views derive from models
|
|
416
|
+
{
|
|
417
|
+
type: "requires",
|
|
418
|
+
source: "data_view",
|
|
419
|
+
targets: ["data_model"],
|
|
420
|
+
message: "Data views are derived from data models.",
|
|
421
|
+
suggestion: "Define a data_model block as the source for this view."
|
|
422
|
+
},
|
|
423
|
+
// Migration conflicts with seed — different lifecycle phases
|
|
424
|
+
{
|
|
425
|
+
type: "conflicts",
|
|
426
|
+
source: "migration",
|
|
427
|
+
targets: ["seed"],
|
|
428
|
+
message: "Migrations and seeds are different lifecycle phases and should be separate blocks.",
|
|
429
|
+
suggestion: "Define migrations and seeds in separate blocks for clear ordering."
|
|
430
|
+
},
|
|
431
|
+
// =============================================================================
|
|
432
|
+
// v6 UNIVERSAL PIPELINE DOMAIN CONSTRAINTS
|
|
433
|
+
// =============================================================================
|
|
434
|
+
// Consumer requires queue or topic — consumers need a message source
|
|
435
|
+
{
|
|
436
|
+
type: "requires",
|
|
437
|
+
source: "consumer",
|
|
438
|
+
targets: ["queue"],
|
|
439
|
+
message: "Consumers require a queue or topic to consume messages from.",
|
|
440
|
+
suggestion: "Define a queue block and reference it from this consumer."
|
|
441
|
+
},
|
|
442
|
+
// Producer requires queue or topic — producers need a message target
|
|
443
|
+
{
|
|
444
|
+
type: "requires",
|
|
445
|
+
source: "producer",
|
|
446
|
+
targets: ["queue"],
|
|
447
|
+
message: "Producers require a queue or topic to publish messages to.",
|
|
448
|
+
suggestion: "Define a queue block and reference it from this producer."
|
|
449
|
+
},
|
|
450
|
+
// Dead letter requires queue — DLQ needs a primary queue
|
|
451
|
+
{
|
|
452
|
+
type: "requires",
|
|
453
|
+
source: "dead_letter",
|
|
454
|
+
targets: ["queue"],
|
|
455
|
+
message: "Dead letter queues require a primary queue to catch failed messages from.",
|
|
456
|
+
suggestion: "Define a queue block as the source for this dead letter queue."
|
|
457
|
+
},
|
|
458
|
+
// Stage requires pipeline — stages belong to pipelines
|
|
459
|
+
{
|
|
460
|
+
type: "requires",
|
|
461
|
+
source: "stage",
|
|
462
|
+
targets: ["pipeline"],
|
|
463
|
+
message: "Stages must belong to a pipeline.",
|
|
464
|
+
suggestion: "Wrap this stage in a pipeline block."
|
|
465
|
+
},
|
|
466
|
+
// Worker conflicts with scheduler — different execution models
|
|
467
|
+
{
|
|
468
|
+
type: "conflicts",
|
|
469
|
+
source: "worker",
|
|
470
|
+
targets: ["scheduler"],
|
|
471
|
+
message: "Workers process jobs continuously while schedulers trigger at intervals.",
|
|
472
|
+
suggestion: "Use @worker for continuous processing or @scheduler for cron-based execution."
|
|
473
|
+
},
|
|
474
|
+
// Consumer conflicts with producer on same entity — pick one direction
|
|
475
|
+
{
|
|
476
|
+
type: "conflicts",
|
|
477
|
+
source: "consumer",
|
|
478
|
+
targets: ["producer"],
|
|
479
|
+
message: "An entity should be either a consumer or a producer, not both.",
|
|
480
|
+
suggestion: "Split into separate consumer and producer blocks for clear message flow direction."
|
|
481
|
+
},
|
|
482
|
+
// =============================================================================
|
|
483
|
+
// v6 UNIVERSAL CONTAINER/INFRA DOMAIN CONSTRAINTS
|
|
484
|
+
// =============================================================================
|
|
485
|
+
// Serverless conflicts with container — different deployment models
|
|
486
|
+
{
|
|
487
|
+
type: "conflicts",
|
|
488
|
+
source: "serverless",
|
|
489
|
+
targets: ["container"],
|
|
490
|
+
message: "Serverless and container are mutually exclusive deployment models.",
|
|
491
|
+
suggestion: "Choose @serverless for FaaS or @container for long-running services."
|
|
492
|
+
},
|
|
493
|
+
// Horizontal scaling requires service — scaling needs a service to scale
|
|
494
|
+
{
|
|
495
|
+
type: "requires",
|
|
496
|
+
source: "horizontal_scaling",
|
|
497
|
+
targets: ["service"],
|
|
498
|
+
message: "Horizontal scaling requires a service to replicate.",
|
|
499
|
+
suggestion: "Add @service to define the scalable unit."
|
|
500
|
+
},
|
|
501
|
+
// =============================================================================
|
|
502
|
+
// v6 UNIVERSAL OBSERVABILITY DOMAIN CONSTRAINTS
|
|
503
|
+
// =============================================================================
|
|
504
|
+
// Tracing requires service or handler — tracing needs a service context
|
|
505
|
+
{
|
|
506
|
+
type: "requires",
|
|
507
|
+
source: "tracing",
|
|
508
|
+
targets: ["service"],
|
|
509
|
+
message: "Distributed tracing requires a service context for span propagation.",
|
|
510
|
+
suggestion: "Add @service to enable trace context propagation."
|
|
511
|
+
},
|
|
512
|
+
// Alerting requires metric — alerts need metrics to alert on
|
|
513
|
+
{
|
|
514
|
+
type: "requires",
|
|
515
|
+
source: "alerting",
|
|
516
|
+
targets: ["metric"],
|
|
517
|
+
message: "Alerting rules require metrics to evaluate thresholds against.",
|
|
518
|
+
suggestion: "Add @metric to define the values that trigger alerts."
|
|
519
|
+
},
|
|
520
|
+
// Health check requires service — health checks monitor services
|
|
521
|
+
{
|
|
522
|
+
type: "requires",
|
|
523
|
+
source: "health_check",
|
|
524
|
+
targets: ["service"],
|
|
525
|
+
message: "Health checks require a service to monitor.",
|
|
526
|
+
suggestion: "Add @service to define the monitored service endpoint."
|
|
527
|
+
},
|
|
528
|
+
// =============================================================================
|
|
529
|
+
// v6 UNIVERSAL RESILIENCE DOMAIN CONSTRAINTS (v5.4)
|
|
530
|
+
// =============================================================================
|
|
531
|
+
// Circuit breaker requires service — wraps service calls
|
|
532
|
+
{
|
|
533
|
+
type: "requires",
|
|
534
|
+
source: "circuit_breaker",
|
|
535
|
+
targets: ["service"],
|
|
536
|
+
message: "Circuit breakers wrap service calls to prevent cascade failures.",
|
|
537
|
+
suggestion: "Add @service to define the protected service endpoint."
|
|
538
|
+
},
|
|
539
|
+
// Retry requires service or pipeline — retries need a callable context
|
|
540
|
+
{
|
|
541
|
+
type: "requires",
|
|
542
|
+
source: "retry",
|
|
543
|
+
targets: ["service"],
|
|
544
|
+
message: "Retry policies require a service or pipeline context.",
|
|
545
|
+
suggestion: "Add @service to define the endpoint with retry behavior."
|
|
546
|
+
},
|
|
547
|
+
// Timeout requires service — timeouts bound service call duration
|
|
548
|
+
{
|
|
549
|
+
type: "requires",
|
|
550
|
+
source: "timeout",
|
|
551
|
+
targets: ["service"],
|
|
552
|
+
message: "Timeout policies require a service context to bound request duration.",
|
|
553
|
+
suggestion: "Add @service to define the endpoint with timeout behavior."
|
|
554
|
+
},
|
|
555
|
+
// Bulkhead requires service — isolates concurrent requests
|
|
556
|
+
{
|
|
557
|
+
type: "requires",
|
|
558
|
+
source: "bulkhead",
|
|
559
|
+
targets: ["service"],
|
|
560
|
+
message: "Bulkhead isolation requires a service context for concurrency partitioning.",
|
|
561
|
+
suggestion: "Add @service to define the endpoint with bulkhead isolation."
|
|
562
|
+
},
|
|
563
|
+
// Middleware requires service — middleware wraps service endpoints
|
|
564
|
+
{
|
|
565
|
+
type: "requires",
|
|
566
|
+
source: "middleware",
|
|
567
|
+
targets: ["service"],
|
|
568
|
+
message: "Middleware requires a service context to wrap endpoints.",
|
|
569
|
+
suggestion: "Add @service to define the service where middleware is applied."
|
|
570
|
+
},
|
|
571
|
+
// Migration requires db — database migrations need a connection
|
|
572
|
+
{
|
|
573
|
+
type: "requires",
|
|
574
|
+
source: "migration",
|
|
575
|
+
targets: ["db"],
|
|
576
|
+
message: "Database migrations require a database connection (@db).",
|
|
577
|
+
suggestion: "Add @db to define the database connection for migrations."
|
|
578
|
+
},
|
|
579
|
+
// Saga requires db — distributed transactions need persistence
|
|
580
|
+
{
|
|
581
|
+
type: "requires",
|
|
582
|
+
source: "saga",
|
|
583
|
+
targets: ["db"],
|
|
584
|
+
message: "Sagas require database access for transaction state management.",
|
|
585
|
+
suggestion: "Add @db for the saga coordinator state store."
|
|
586
|
+
},
|
|
587
|
+
// Circuit breaker conflicts with fallback at same level
|
|
588
|
+
{
|
|
589
|
+
type: "conflicts",
|
|
590
|
+
source: "circuit_breaker",
|
|
591
|
+
targets: ["bulkhead"],
|
|
592
|
+
message: "Circuit breaker and bulkhead should be applied at different granularity levels.",
|
|
593
|
+
suggestion: "Apply @circuit_breaker at the service level and @bulkhead at the endpoint level, or vice versa."
|
|
594
|
+
}
|
|
595
|
+
];
|
|
596
|
+
|
|
597
|
+
// src/traits/constraintConfig.ts
|
|
598
|
+
init_safeJsonParse();
|
|
599
|
+
function loadConstraintsFromConfig(config) {
|
|
600
|
+
if (!config || typeof config !== "object") return [];
|
|
601
|
+
const raw = config;
|
|
602
|
+
if (!Array.isArray(raw.traitConstraints)) return [];
|
|
603
|
+
const valid = [];
|
|
604
|
+
for (const entry of raw.traitConstraints) {
|
|
605
|
+
if (!entry || typeof entry !== "object") continue;
|
|
606
|
+
const { type, source, targets, message, suggestion } = entry;
|
|
607
|
+
if ((type === "requires" || type === "conflicts" || type === "oneof") && typeof source === "string" && source.length > 0 && Array.isArray(targets) && targets.length > 0 && targets.every((t) => typeof t === "string")) {
|
|
608
|
+
valid.push({
|
|
609
|
+
type,
|
|
610
|
+
source,
|
|
611
|
+
targets,
|
|
612
|
+
message: typeof message === "string" ? message : void 0,
|
|
613
|
+
suggestion: typeof suggestion === "string" ? suggestion : void 0
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return valid;
|
|
618
|
+
}
|
|
619
|
+
async function loadConstraintsFromFile(configPath = "holoscript.config.json") {
|
|
620
|
+
try {
|
|
621
|
+
const { readFileSync } = await import('fs');
|
|
622
|
+
const raw = readFileSync(configPath, "utf-8");
|
|
623
|
+
const parsed = readJson(raw);
|
|
624
|
+
return loadConstraintsFromConfig(parsed);
|
|
625
|
+
} catch {
|
|
626
|
+
return [];
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
export { BUILTIN_CONSTRAINTS, loadConstraintsFromConfig, loadConstraintsFromFile };
|
|
631
|
+
//# sourceMappingURL=chunk-XSFNHP2E.js.map
|
|
632
|
+
//# sourceMappingURL=chunk-XSFNHP2E.js.map
|