castle-web-cli 0.4.157 → 0.4.159

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.
Files changed (243) hide show
  1. package/dist/agent-failures.d.ts +1 -0
  2. package/dist/agent-failures.js +6 -4
  3. package/dist/agent-prompts.js +4 -0
  4. package/dist/agent.d.ts +11 -0
  5. package/dist/agent.js +175 -15
  6. package/dist/bundle.js +8 -2
  7. package/dist/castle-host/host.js +4 -2
  8. package/dist/castleJson.js +6 -1
  9. package/dist/check.d.ts +1 -0
  10. package/dist/check.js +25 -0
  11. package/dist/devSessionServer.js +31 -7
  12. package/dist/imports.js +1 -19
  13. package/dist/index.js +15 -1
  14. package/dist/init.d.ts +2 -2
  15. package/dist/init.js +78 -42
  16. package/dist/mcpPlaytest.d.ts +1 -0
  17. package/dist/mcpPlaytest.js +182 -0
  18. package/dist/metering.d.ts +24 -0
  19. package/dist/metering.js +87 -0
  20. package/dist/sdkResolve.d.ts +3 -0
  21. package/dist/sdkResolve.js +55 -0
  22. package/dist/serve.js +50 -4
  23. package/dist/serverBundle.js +8 -3
  24. package/dist/shell/assets/{index-DsDkYFvP.js → index-DMSoTyXh.js} +64 -64
  25. package/dist/shell/assets/{index-DwezawBs.css → index-DfZmu3XC.css} +1 -1
  26. package/dist/shell/index.html +2 -2
  27. package/dist/vitePlugins.d.ts +1 -0
  28. package/dist/vitePlugins.js +20 -0
  29. package/kits/base/CLAUDE.md +196 -0
  30. package/kits/{blank → base}/castle.json +5 -2
  31. package/kits/base/editorHost.js +172 -0
  32. package/kits/{blank → base}/node_modules/.package-lock.json +3 -2
  33. package/kits/{blank → base}/package-lock.json +7 -4
  34. package/kits/{blank → base}/package.json +4 -2
  35. package/kits/base/sdk/README.md +569 -0
  36. package/kits/base/sdk/castle.d.ts +27 -0
  37. package/kits/base/sdk/castle.js +16 -0
  38. package/kits/base/sdk/commands.d.ts +181 -0
  39. package/kits/base/sdk/commands.js +16 -0
  40. package/kits/base/sdk/context.d.ts +17 -0
  41. package/kits/base/sdk/context.js +15 -0
  42. package/kits/base/sdk/errors.d.ts +22 -0
  43. package/kits/base/sdk/errors.js +16 -0
  44. package/kits/base/sdk/files.d.ts +15 -0
  45. package/kits/base/sdk/files.js +52 -0
  46. package/kits/base/sdk/haptics.d.ts +6 -0
  47. package/kits/base/sdk/haptics.js +36 -0
  48. package/kits/base/sdk/leaderboard.d.ts +26 -0
  49. package/kits/base/sdk/leaderboard.js +296 -0
  50. package/kits/base/sdk/lifecycle.d.ts +4 -0
  51. package/kits/base/sdk/lifecycle.js +13 -0
  52. package/kits/base/sdk/multiplayer.d.ts +43 -0
  53. package/kits/base/sdk/multiplayer.js +464 -0
  54. package/kits/base/sdk/multiplayerProtocol.d.ts +51 -0
  55. package/kits/base/sdk/multiplayerProtocol.js +5 -0
  56. package/kits/base/sdk/passes.d.ts +7 -0
  57. package/kits/base/sdk/passes.js +84 -0
  58. package/kits/base/sdk/portal.d.ts +7 -0
  59. package/kits/base/sdk/portal.js +35 -0
  60. package/kits/base/sdk/runtime.d.ts +62 -0
  61. package/kits/base/sdk/runtime.js +970 -0
  62. package/kits/base/sdk/saveQueue.d.ts +27 -0
  63. package/kits/base/sdk/saveQueue.js +205 -0
  64. package/kits/base/sdk/server/platformHandle.d.ts +25 -0
  65. package/kits/base/sdk/server/platformHandle.js +1 -0
  66. package/kits/base/sdk/server/wrapper.d.ts +28 -0
  67. package/kits/base/sdk/server/wrapper.js +109 -0
  68. package/kits/base/sdk/storage.d.ts +16 -0
  69. package/kits/base/sdk/storage.js +323 -0
  70. package/kits/base/sdk/time.d.ts +17 -0
  71. package/kits/base/sdk/time.js +120 -0
  72. package/kits/base/sdk/transport.d.ts +17 -0
  73. package/kits/base/sdk/transport.js +141 -0
  74. package/kits/base/sdk/types.d.ts +3 -0
  75. package/kits/base/sdk/types.js +1 -0
  76. package/kits/base/sdk/user.d.ts +10 -0
  77. package/kits/base/sdk/user.js +45 -0
  78. package/kits/multiplayer-2d/.prettierrc +5 -0
  79. package/kits/multiplayer-2d/CLAUDE.md +129 -0
  80. package/kits/multiplayer-2d/behaviors/Box.jsx +92 -0
  81. package/kits/multiplayer-2d/behaviors/Player.jsx +86 -0
  82. package/kits/multiplayer-2d/blueprints/crate.scene +13 -0
  83. package/kits/multiplayer-2d/blueprints/other-player.scene +13 -0
  84. package/kits/multiplayer-2d/blueprints/player.scene +15 -0
  85. package/kits/multiplayer-2d/blueprints/wall.scene +12 -0
  86. package/kits/multiplayer-2d/castle.json +39 -0
  87. package/kits/multiplayer-2d/code/client/avatars.js +93 -0
  88. package/kits/multiplayer-2d/code/client/poses.js +168 -0
  89. package/kits/multiplayer-2d/code/server/index.js +26 -0
  90. package/kits/multiplayer-2d/code/server/limits.js +99 -0
  91. package/kits/multiplayer-2d/code/server/ownership.js +177 -0
  92. package/kits/multiplayer-2d/code/server/players.js +127 -0
  93. package/kits/multiplayer-2d/code/server/sceneBodies.js +98 -0
  94. package/kits/multiplayer-2d/code/server/world.js +337 -0
  95. package/kits/multiplayer-2d/code/systems/multiplayer.js +424 -0
  96. package/kits/multiplayer-2d/eslint.config.js +21 -0
  97. package/kits/multiplayer-2d/fonts.generated.js +9 -0
  98. package/kits/multiplayer-2d/index.html +25 -0
  99. package/kits/multiplayer-2d/main.jsx +10 -0
  100. package/kits/multiplayer-2d/package-lock.json +351 -0
  101. package/kits/multiplayer-2d/package.json +30 -0
  102. package/kits/multiplayer-2d/scenes/main.scene +20 -0
  103. package/kits/multiplayer-2d/test/two-client-test.mjs +341 -0
  104. package/kits/multiplayer-2d/theme.style +4 -0
  105. package/kits/multiplayer-3d/.prettierrc +5 -0
  106. package/kits/multiplayer-3d/CLAUDE.md +215 -0
  107. package/kits/multiplayer-3d/blueprints/ball.scene +21 -0
  108. package/kits/multiplayer-3d/blueprints/other-player.scene +21 -0
  109. package/kits/multiplayer-3d/castle.json +43 -0
  110. package/kits/multiplayer-3d/code/client/avatars.js +136 -0
  111. package/kits/multiplayer-3d/code/client/nameTags.js +101 -0
  112. package/kits/multiplayer-3d/code/client/poses.js +220 -0
  113. package/kits/multiplayer-3d/code/server/index.js +23 -0
  114. package/kits/multiplayer-3d/code/server/limits.js +107 -0
  115. package/kits/multiplayer-3d/code/server/ownership.js +157 -0
  116. package/kits/multiplayer-3d/code/server/players.js +114 -0
  117. package/kits/multiplayer-3d/code/server/sceneBodies.js +88 -0
  118. package/kits/multiplayer-3d/code/server/world.js +306 -0
  119. package/kits/multiplayer-3d/code/systems/multiplayer.js +427 -0
  120. package/kits/multiplayer-3d/eslint.config.js +20 -0
  121. package/kits/multiplayer-3d/fonts.generated.js +9 -0
  122. package/kits/multiplayer-3d/index.html +22 -0
  123. package/kits/multiplayer-3d/main.jsx +9 -0
  124. package/kits/multiplayer-3d/package-lock.json +368 -0
  125. package/kits/multiplayer-3d/package.json +32 -0
  126. package/kits/multiplayer-3d/scenes/main.scene +409 -0
  127. package/kits/multiplayer-3d/theme.style +3 -0
  128. package/kits/physics-2d/CLAUDE.md +6 -0
  129. package/kits/physics-2d/castle.json +7 -1
  130. package/kits/physics-2d/editors/behaviorRegistry.js +5 -0
  131. package/kits/physics-2d/editors/editorRegistry.jsx +3 -1
  132. package/kits/physics-2d/engine/files.js +9 -5
  133. package/kits/physics-2d/engine/systemRegistry.js +2 -0
  134. package/kits/physics-2d/engine/ui.module.css +11 -0
  135. package/kits/physics-2d/package-lock.json +8 -2
  136. package/kits/physics-2d/package.json +2 -2
  137. package/kits/physics-3d/CLAUDE.md +4 -4
  138. package/kits/physics-3d/behaviors/Shape.jsx +1 -1
  139. package/kits/physics-3d/blueprints/crate.scene +1 -1
  140. package/kits/physics-3d/blueprints/door.scene +4 -4
  141. package/kits/physics-3d/blueprints/pillar.scene +1 -1
  142. package/kits/physics-3d/blueprints/platform.scene +1 -1
  143. package/kits/physics-3d/blueprints/statue.scene +1 -1
  144. package/kits/physics-3d/blueprints/wall.scene +1 -1
  145. package/kits/physics-3d/castle.json +8 -11
  146. package/kits/physics-3d/docs/pxmodel-format.md +1 -1
  147. package/kits/physics-3d/engine3d/materials.js +3 -3
  148. package/kits/physics-3d/engine3d/modelFiles.js +4 -2
  149. package/kits/physics-3d/engine3d/world3d.js +1 -1
  150. package/kits/physics-3d/fonts.generated.js +9 -0
  151. package/kits/physics-3d/main.jsx +1 -1
  152. package/kits/physics-3d/package-lock.json +85 -2
  153. package/kits/physics-3d/package.json +6 -2
  154. package/kits/physics-3d/scenes/main.scene +1 -1
  155. package/kits/physics-3d/scenes/model-lab.scene +1 -1
  156. package/kits/real-time/.prettierrc +5 -0
  157. package/kits/real-time/CLAUDE.md +60 -0
  158. package/kits/real-time/castle.json +19 -0
  159. package/kits/real-time/code/client/clock.js +68 -0
  160. package/kits/real-time/code/client/connection.js +134 -0
  161. package/kits/real-time/code/client/gameHooks.js +50 -0
  162. package/kits/real-time/code/client/interpolate.js +82 -0
  163. package/kits/real-time/code/client/messages.js +55 -0
  164. package/kits/real-time/code/client/ownership.js +94 -0
  165. package/kits/real-time/code/client/smooth.js +54 -0
  166. package/kits/real-time/code/server/blockDelta.js +48 -0
  167. package/kits/real-time/code/server/gameHooks.js +47 -0
  168. package/kits/real-time/code/server/limits.js +35 -0
  169. package/kits/real-time/code/server/session.js +251 -0
  170. package/kits/real-time/eslint.config.js +22 -0
  171. package/kits/real-time/index.html +45 -0
  172. package/kits/real-time/package.json +14 -0
  173. package/kits/{tabletop → turn-based}/CLAUDE.md +42 -49
  174. package/kits/turn-based/blueprints/board.scene +15 -0
  175. package/kits/turn-based/blueprints/square.scene +25 -0
  176. package/kits/turn-based/castle.json +37 -0
  177. package/kits/turn-based/code/behaviors/Board.jsx +169 -0
  178. package/kits/turn-based/code/behaviors/Square.jsx +26 -0
  179. package/kits/turn-based/code/server/index.js +152 -0
  180. package/kits/turn-based/drawings/square.sprite +25 -0
  181. package/kits/turn-based/eslint.config.js +12 -0
  182. package/kits/turn-based/fonts.generated.js +9 -0
  183. package/kits/{tabletop → turn-based}/index.html +5 -3
  184. package/kits/{tabletop → turn-based}/main.jsx +2 -2
  185. package/kits/{tabletop → turn-based}/package-lock.json +17 -4
  186. package/kits/{tabletop → turn-based}/package.json +5 -2
  187. package/kits/turn-based/room.js +289 -0
  188. package/kits/turn-based/scenes/main.scene +227 -0
  189. package/kits/{tabletop → turn-based}/testing.js +131 -99
  190. package/kits/turn-based/theme.style +3 -0
  191. package/package.json +1 -1
  192. package/kits/blank/CLAUDE.md +0 -198
  193. package/kits/tabletop/castle.json +0 -34
  194. package/kits/tabletop/room.js +0 -269
  195. /package/kits/{blank → base}/index.html +0 -0
  196. /package/kits/{blank → base}/node_modules/castle-web-fonts/README.md +0 -0
  197. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/catalog.d.ts +0 -0
  198. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/catalog.js +0 -0
  199. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/face.d.ts +0 -0
  200. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/face.js +0 -0
  201. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Bore.d.ts +0 -0
  202. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Bore.js +0 -0
  203. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/CourierPrime.d.ts +0 -0
  204. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/CourierPrime.js +0 -0
  205. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/DMSans.d.ts +0 -0
  206. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/DMSans.js +0 -0
  207. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Glacier.d.ts +0 -0
  208. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Glacier.js +0 -0
  209. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/HelicoCentrica.d.ts +0 -0
  210. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/HelicoCentrica.js +0 -0
  211. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Piazzolla.d.ts +0 -0
  212. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Piazzolla.js +0 -0
  213. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Synco.d.ts +0 -0
  214. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Synco.js +0 -0
  215. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Tektur.d.ts +0 -0
  216. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/Tektur.js +0 -0
  217. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/YatraOne.d.ts +0 -0
  218. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/faces/YatraOne.js +0 -0
  219. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/index.d.ts +0 -0
  220. /package/kits/{blank → base}/node_modules/castle-web-fonts/dist/index.js +0 -0
  221. /package/kits/{blank → base}/node_modules/castle-web-fonts/licenses/CC-BY-ND-4.0.txt +0 -0
  222. /package/kits/{blank → base}/node_modules/castle-web-fonts/licenses/FONTS.md +0 -0
  223. /package/kits/{blank → base}/node_modules/castle-web-fonts/licenses/OFL-1.1.txt +0 -0
  224. /package/kits/{blank → base}/node_modules/castle-web-fonts/package.json +0 -0
  225. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/Bore.woff2 +0 -0
  226. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/CourierPrime.woff2 +0 -0
  227. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/DMSans.woff2 +0 -0
  228. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/Glacier.woff2 +0 -0
  229. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/HelicoCentrica.woff2 +0 -0
  230. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/Piazzolla.woff2 +0 -0
  231. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/SOURCE.txt +0 -0
  232. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/Synco.woff2 +0 -0
  233. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/Tektur.woff2 +0 -0
  234. /package/kits/{blank → base}/node_modules/castle-web-fonts/woff2/YatraOne.woff2 +0 -0
  235. /package/kits/physics-3d/drawings/{crate.pxart → crate.sprite} +0 -0
  236. /package/kits/physics-3d/drawings/{door-edge.pxart → door-edge.sprite} +0 -0
  237. /package/kits/physics-3d/drawings/{door.pxart → door.sprite} +0 -0
  238. /package/kits/physics-3d/drawings/{face.pxart → face.sprite} +0 -0
  239. /package/kits/physics-3d/drawings/{floor.pxart → floor.sprite} +0 -0
  240. /package/kits/physics-3d/drawings/{platform.pxart → platform.sprite} +0 -0
  241. /package/kits/physics-3d/drawings/{statue.pxart → statue.sprite} +0 -0
  242. /package/kits/physics-3d/drawings/{wall.pxart → wall.sprite} +0 -0
  243. /package/kits/{tabletop → turn-based}/.prettierrc +0 -0
@@ -0,0 +1,409 @@
1
+ {
2
+ "name": "Main",
3
+ "ground": {
4
+ "art": "imports/castle.physics-3d/drawings/floor.sprite",
5
+ "tile": 2
6
+ },
7
+ "actors": [
8
+ {
9
+ "id": "player",
10
+ "blueprint": "imports/castle.physics-3d/blueprints/player.scene",
11
+ "components": {
12
+ "Transform": {
13
+ "x": -2.2,
14
+ "z": 2,
15
+ "y": 1
16
+ }
17
+ }
18
+ },
19
+ {
20
+ "id": "pedestal",
21
+ "blueprint": "imports/castle.physics-3d/blueprints/platform.scene",
22
+ "components": {
23
+ "Transform": {
24
+ "x": 4,
25
+ "z": 3
26
+ },
27
+ "Shape": {
28
+ "width": 1.6,
29
+ "depth": 1.6
30
+ }
31
+ }
32
+ },
33
+ {
34
+ "id": "statue",
35
+ "blueprint": "imports/castle.physics-3d/blueprints/statue.scene",
36
+ "components": {
37
+ "Transform": {
38
+ "x": 4,
39
+ "y": 1.2,
40
+ "z": 3
41
+ }
42
+ }
43
+ },
44
+ {
45
+ "id": "crate-1",
46
+ "blueprint": "imports/castle.physics-3d/blueprints/crate.scene",
47
+ "components": {
48
+ "Transform": {
49
+ "x": -3,
50
+ "z": 3
51
+ }
52
+ }
53
+ },
54
+ {
55
+ "id": "crate-2",
56
+ "blueprint": "imports/castle.physics-3d/blueprints/crate.scene",
57
+ "components": {
58
+ "Transform": {
59
+ "x": -3.9,
60
+ "z": 4.1
61
+ }
62
+ }
63
+ },
64
+ {
65
+ "id": "crate-3",
66
+ "blueprint": "imports/castle.physics-3d/blueprints/crate.scene",
67
+ "components": {
68
+ "Transform": {
69
+ "x": -3.2,
70
+ "y": 1.6,
71
+ "z": 3.6
72
+ }
73
+ }
74
+ },
75
+ {
76
+ "id": "crate-4",
77
+ "blueprint": "imports/castle.physics-3d/blueprints/crate.scene",
78
+ "components": {
79
+ "Transform": {
80
+ "x": 6.8,
81
+ "z": 6.6
82
+ }
83
+ }
84
+ },
85
+ {
86
+ "id": "crate-5",
87
+ "blueprint": "imports/castle.physics-3d/blueprints/crate.scene",
88
+ "components": {
89
+ "Transform": {
90
+ "x": 6.1,
91
+ "y": 1.6,
92
+ "z": 7.2
93
+ }
94
+ }
95
+ },
96
+ {
97
+ "id": "gem-1",
98
+ "blueprint": "imports/castle.physics-3d/blueprints/gem.scene",
99
+ "components": {
100
+ "Transform": {
101
+ "x": 2,
102
+ "z": 6
103
+ }
104
+ }
105
+ },
106
+ {
107
+ "id": "gem-2",
108
+ "blueprint": "imports/castle.physics-3d/blueprints/gem.scene",
109
+ "components": {
110
+ "Transform": {
111
+ "x": -5,
112
+ "z": 0
113
+ }
114
+ }
115
+ },
116
+ {
117
+ "id": "gem-3",
118
+ "blueprint": "imports/castle.physics-3d/blueprints/gem.scene",
119
+ "components": {
120
+ "Transform": {
121
+ "x": 6,
122
+ "z": -2
123
+ }
124
+ }
125
+ },
126
+ {
127
+ "id": "gem-4",
128
+ "blueprint": "imports/castle.physics-3d/blueprints/gem.scene",
129
+ "components": {
130
+ "Transform": {
131
+ "x": 0,
132
+ "z": -8
133
+ }
134
+ }
135
+ },
136
+ {
137
+ "id": "gem-5",
138
+ "blueprint": "imports/castle.physics-3d/blueprints/gem.scene",
139
+ "components": {
140
+ "Transform": {
141
+ "x": 8,
142
+ "y": 2.9,
143
+ "z": 1.2
144
+ }
145
+ }
146
+ },
147
+ {
148
+ "id": "gem-6",
149
+ "blueprint": "imports/castle.physics-3d/blueprints/gem.scene",
150
+ "components": {
151
+ "Transform": {
152
+ "x": -7,
153
+ "z": -6
154
+ }
155
+ }
156
+ },
157
+ {
158
+ "id": "gem-7",
159
+ "blueprint": "imports/castle.physics-3d/blueprints/gem.scene",
160
+ "components": {
161
+ "Transform": {
162
+ "x": 9,
163
+ "z": 7
164
+ }
165
+ }
166
+ },
167
+ {
168
+ "id": "step-1",
169
+ "blueprint": "imports/castle.physics-3d/blueprints/platform.scene",
170
+ "components": {
171
+ "Transform": {
172
+ "x": 8,
173
+ "z": 4
174
+ }
175
+ }
176
+ },
177
+ {
178
+ "id": "step-2",
179
+ "blueprint": "imports/castle.physics-3d/blueprints/platform.scene",
180
+ "components": {
181
+ "Transform": {
182
+ "x": 9.4,
183
+ "y": 1.1,
184
+ "z": 2.6
185
+ }
186
+ }
187
+ },
188
+ {
189
+ "id": "step-3",
190
+ "blueprint": "imports/castle.physics-3d/blueprints/platform.scene",
191
+ "components": {
192
+ "Transform": {
193
+ "x": 8,
194
+ "y": 2,
195
+ "z": 1.2
196
+ }
197
+ }
198
+ },
199
+ {
200
+ "id": "wall-n",
201
+ "blueprint": "imports/castle.physics-3d/blueprints/wall.scene",
202
+ "components": {
203
+ "Transform": {
204
+ "x": 0,
205
+ "z": -12
206
+ },
207
+ "Shape": {
208
+ "width": 8.4,
209
+ "artRepeat": [
210
+ 4,
211
+ 1
212
+ ]
213
+ }
214
+ }
215
+ },
216
+ {
217
+ "id": "wall-w",
218
+ "blueprint": "imports/castle.physics-3d/blueprints/wall.scene",
219
+ "components": {
220
+ "Transform": {
221
+ "x": -4,
222
+ "z": -8,
223
+ "rotationY": 90
224
+ },
225
+ "Shape": {
226
+ "width": 8.4,
227
+ "artRepeat": [
228
+ 4,
229
+ 1
230
+ ]
231
+ }
232
+ }
233
+ },
234
+ {
235
+ "id": "wall-e",
236
+ "blueprint": "imports/castle.physics-3d/blueprints/wall.scene",
237
+ "components": {
238
+ "Transform": {
239
+ "x": 4,
240
+ "z": -8,
241
+ "rotationY": 90
242
+ },
243
+ "Shape": {
244
+ "width": 8.4,
245
+ "artRepeat": [
246
+ 4,
247
+ 1
248
+ ]
249
+ }
250
+ }
251
+ },
252
+ {
253
+ "id": "wall-s1",
254
+ "blueprint": "imports/castle.physics-3d/blueprints/wall.scene",
255
+ "components": {
256
+ "Transform": {
257
+ "x": -2.55,
258
+ "z": -4
259
+ },
260
+ "Shape": {
261
+ "width": 2.9,
262
+ "artRepeat": [
263
+ 1.5,
264
+ 1
265
+ ]
266
+ }
267
+ }
268
+ },
269
+ {
270
+ "id": "wall-s2",
271
+ "blueprint": "imports/castle.physics-3d/blueprints/wall.scene",
272
+ "components": {
273
+ "Transform": {
274
+ "x": 2.55,
275
+ "z": -4
276
+ },
277
+ "Shape": {
278
+ "width": 2.9,
279
+ "artRepeat": [
280
+ 1.5,
281
+ 1
282
+ ]
283
+ }
284
+ }
285
+ },
286
+ {
287
+ "id": "door",
288
+ "blueprint": "imports/castle.physics-3d/blueprints/door.scene",
289
+ "components": {
290
+ "Transform": {
291
+ "x": 0,
292
+ "z": -4
293
+ }
294
+ }
295
+ },
296
+ {
297
+ "id": "pillar-w",
298
+ "blueprint": "imports/castle.physics-3d/blueprints/pillar.scene",
299
+ "components": {
300
+ "Transform": {
301
+ "x": -1.5,
302
+ "z": -3.4
303
+ }
304
+ }
305
+ },
306
+ {
307
+ "id": "pillar-e",
308
+ "blueprint": "imports/castle.physics-3d/blueprints/pillar.scene",
309
+ "components": {
310
+ "Transform": {
311
+ "x": 1.5,
312
+ "z": -3.4
313
+ }
314
+ }
315
+ },
316
+ {
317
+ "id": "low-wall-n",
318
+ "blueprint": "imports/castle.physics-3d/blueprints/wall.scene",
319
+ "components": {
320
+ "Transform": {
321
+ "x": 2,
322
+ "y": 0.4,
323
+ "z": 9.5
324
+ },
325
+ "Shape": {
326
+ "width": 5,
327
+ "height": 0.8,
328
+ "artRepeat": [
329
+ 2.5,
330
+ 0.4
331
+ ]
332
+ }
333
+ }
334
+ },
335
+ {
336
+ "id": "low-wall-w",
337
+ "blueprint": "imports/castle.physics-3d/blueprints/wall.scene",
338
+ "components": {
339
+ "Transform": {
340
+ "x": -6.5,
341
+ "y": 0.4,
342
+ "z": 6,
343
+ "rotationY": 90
344
+ },
345
+ "Shape": {
346
+ "width": 4,
347
+ "height": 0.8,
348
+ "artRepeat": [
349
+ 2,
350
+ 0.4
351
+ ]
352
+ }
353
+ }
354
+ },
355
+ {
356
+ "id": "tree-1",
357
+ "blueprint": "imports/castle.physics-3d/blueprints/tree.scene",
358
+ "components": {
359
+ "Transform": {
360
+ "x": -2.7,
361
+ "z": -13.5
362
+ }
363
+ }
364
+ },
365
+ {
366
+ "id": "tree-2",
367
+ "blueprint": "imports/castle.physics-3d/blueprints/tree.scene",
368
+ "components": {
369
+ "Transform": {
370
+ "x": -1.3,
371
+ "z": -14.2
372
+ }
373
+ }
374
+ },
375
+ {
376
+ "id": "crate",
377
+ "blueprint": "imports/castle.physics-3d/blueprints/crate.scene",
378
+ "components": {
379
+ "Transform": {
380
+ "x": -2.2,
381
+ "y": 1.6,
382
+ "z": 5.5
383
+ }
384
+ }
385
+ },
386
+ {
387
+ "id": "crate-6",
388
+ "blueprint": "imports/castle.physics-3d/blueprints/crate.scene",
389
+ "components": {
390
+ "Transform": {
391
+ "x": -1.2,
392
+ "y": 1.6,
393
+ "z": 2.6
394
+ }
395
+ }
396
+ },
397
+ {
398
+ "id": "ball",
399
+ "blueprint": "blueprints/ball.scene",
400
+ "components": {
401
+ "Transform": {
402
+ "x": 1.5,
403
+ "y": 1.2,
404
+ "z": 4.5
405
+ }
406
+ }
407
+ }
408
+ ]
409
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "palette": "endesga-64"
3
+ }
@@ -290,6 +290,12 @@ export class MyThing {
290
290
 
291
291
  A fresh `Behavior` instance is constructed per actor per frame from the actor's component props — DO NOT store per-actor state on `this`. Persist transient state on `actor.runtime` (a free-form object the framework will not serialize) or on the component props themselves.
292
292
 
293
+ Interactive HUD from `ui` works by default for real controls (`button`, `a`,
294
+ `input`, `select`, `textarea`, `[role="button"]`). A tap handler on anything
295
+ else — a plain `div` — is click-through, so the HUD doesn't eat taps meant for
296
+ the game: set `pointerEvents: 'auto'` on that element, never on a wrapper
297
+ covering the card (every behavior's `ui` shares one layer).
298
+
293
299
  ## Scene file (`scenes/main.scene`, plain JSON)
294
300
 
295
301
  A scene is a background plus a list of actors. Every actor is an **instance of a blueprint** (see `## Blueprints`): a `blueprint` path plus sparse `components` overrides — usually just its `Layout` position:
@@ -132,5 +132,11 @@
132
132
  "main": "main.jsx",
133
133
  "autoUpdateWhenImported": true,
134
134
  "title": "physics-2d",
135
- "publishedVersion": "2026-08-30T22:21:20.938Z"
135
+ "publishedVersion": "2026-09-02T03:33:48.968Z",
136
+ "imports": {
137
+ "castle.base": {
138
+ "deckId": "yRcmH4_aYllE",
139
+ "version": "2026-09-01T01:02:34.326Z"
140
+ }
141
+ }
136
142
  }
@@ -15,7 +15,12 @@ import { onFilesChanged } from 'castle-web-sdk';
15
15
  // its position, so a hot swap can't quietly change which definition wins.
16
16
  const modules = {
17
17
  ...import.meta.glob('/imports/*/behaviors/**/*.jsx', { eager: true }),
18
+ ...import.meta.glob('/imports/*/code/behaviors/**/*.jsx', { eager: true }),
18
19
  ...import.meta.glob('/behaviors/**/*.jsx', { eager: true }),
20
+ // A deck may keep everything that isn't content under `code/`. Both layouts
21
+ // are read; the folder name still says what a file is, so an editor never
22
+ // registers as a behavior.
23
+ ...import.meta.glob('/code/behaviors/**/*.jsx', { eager: true }),
19
24
  };
20
25
  function isBehaviorClass(value) {
21
26
  return typeof value === 'function' && typeof value.behaviorName === 'string';
@@ -11,7 +11,9 @@
11
11
  // party's editor reachable from here without this kit knowing it exists.
12
12
  const modules = {
13
13
  ...import.meta.glob('/imports/*/editors/**/*.{jsx,js}'),
14
+ ...import.meta.glob('/imports/*/code/editors/**/*.{jsx,js}'),
14
15
  ...import.meta.glob('/editors/**/*.{jsx,js}'),
16
+ ...import.meta.glob('/code/editors/**/*.{jsx,js}'),
15
17
  };
16
18
 
17
19
  export function hasEditorModule(path) {
@@ -24,7 +26,7 @@ export async function loadEditorModule(path) {
24
26
  const load = modules[`/${path}`];
25
27
  if (!load) {
26
28
  throw new Error(
27
- `No editor module at "${path}". Editors must live under editors/ so the registry glob can reach them.`,
29
+ `No editor module at "${path}". Editors must live under editors/ so the registry glob can reach them.`
28
30
  );
29
31
  }
30
32
  const mod = await load();
@@ -34,11 +34,15 @@ const rawModules = {
34
34
  // Behaviors stay folder-scoped: they are code, and the registry decides what
35
35
  // counts as one. Globbing every .jsx would make an editor or a helper a
36
36
  // behavior.
37
- ...import.meta.glob(['/imports/*/behaviors/**/*.jsx', '/behaviors/**/*.jsx'], {
38
- query: '?raw',
39
- import: 'default',
40
- eager: true,
41
- }),
37
+ ...import.meta.glob(
38
+ [
39
+ '/imports/*/behaviors/**/*.jsx',
40
+ '/imports/*/code/behaviors/**/*.jsx',
41
+ '/behaviors/**/*.jsx',
42
+ '/code/behaviors/**/*.jsx',
43
+ ],
44
+ { query: '?raw', import: 'default', eager: true }
45
+ ),
42
46
  };
43
47
  export const initialFiles = Object.fromEntries(
44
48
  Object.entries(rawModules)
@@ -9,7 +9,9 @@
9
9
  // Root-anchored, deck + imports (see engine/files.js).
10
10
  const modules = {
11
11
  ...import.meta.glob('/imports/*/systems/**/*.js', { eager: true }),
12
+ ...import.meta.glob('/imports/*/code/systems/**/*.js', { eager: true }),
12
13
  ...import.meta.glob('/systems/**/*.js', { eager: true }),
14
+ ...import.meta.glob('/code/systems/**/*.js', { eager: true }),
13
15
  };
14
16
  export const systemInstallers = Object.values(modules)
15
17
  .map((mod) => mod.installSystem)
@@ -1173,6 +1173,17 @@
1173
1173
  transform-origin: 0 0;
1174
1174
  }
1175
1175
 
1176
+ /* The layer is click-through (`.sceneUiRoot`'s `pointer-events: none`) so a HUD
1177
+ drawn over the game doesn't eat taps meant for the canvas -- but an element
1178
+ authored as a control is meant to be tapped, so opt those back in. `:where()`
1179
+ keeps specificity at zero, so a deck can override in either direction. Plain
1180
+ containers stay `none` deliberately: every behavior's `ui` shares this one
1181
+ layer, and a full-card wrapper set to `auto` would swallow every sibling
1182
+ behavior's taps. */
1183
+ .sceneUiLayer :where(button, a, input, select, textarea, [role='button']) {
1184
+ pointer-events: auto;
1185
+ }
1186
+
1176
1187
  /* On-canvas selection toolbar ("selection handles"). Two stacked layers cover
1177
1188
  the canvas box (sized by a ResizeObserver, like .sceneUiRoot):
1178
1189
  - .selChromeLayer is the card-unit (500x700) layer, scaled onto the canvas
@@ -18,13 +18,13 @@
18
18
  "@fortawesome/free-solid-svg-icons": "^5.15.4",
19
19
  "@lezer/highlight": "^1.2.3",
20
20
  "castle-web-fonts": "^1.0.0",
21
- "castle-web-sdk": "file:../../sdk",
22
21
  "codemirror": "^6.0.2",
23
22
  "matter-js": "^0.20.0",
24
23
  "react": "^19.2.4",
25
24
  "react-dom": "^19.2.4"
26
25
  },
27
26
  "devDependencies": {
27
+ "castle-web-sdk": "file:../../sdk",
28
28
  "eslint": "^9.0.0",
29
29
  "eslint-plugin-react-hooks": "^5.0.0",
30
30
  "jscpd": "^4.0.5",
@@ -33,7 +33,8 @@
33
33
  },
34
34
  "../../sdk": {
35
35
  "name": "castle-web-sdk",
36
- "version": "0.4.19",
36
+ "version": "0.4.23",
37
+ "dev": true,
37
38
  "devDependencies": {
38
39
  "eslint": "^9.0.0",
39
40
  "jscpd": "^4.0.5",
@@ -215,6 +216,7 @@
215
216
  "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
216
217
  "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
217
218
  "license": "MIT",
219
+ "peer": true,
218
220
  "dependencies": {
219
221
  "@dnd-kit/accessibility": "^3.1.1",
220
222
  "@dnd-kit/utilities": "^3.2.2",
@@ -668,6 +670,7 @@
668
670
  "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
669
671
  "dev": true,
670
672
  "license": "MIT",
673
+ "peer": true,
671
674
  "bin": {
672
675
  "acorn": "bin/acorn"
673
676
  },
@@ -1128,6 +1131,7 @@
1128
1131
  "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==",
1129
1132
  "dev": true,
1130
1133
  "license": "MIT",
1134
+ "peer": true,
1131
1135
  "dependencies": {
1132
1136
  "@eslint-community/eslint-utils": "^4.8.0",
1133
1137
  "@eslint-community/regexpp": "^4.12.1",
@@ -2437,6 +2441,7 @@
2437
2441
  "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz",
2438
2442
  "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==",
2439
2443
  "license": "MIT",
2444
+ "peer": true,
2440
2445
  "engines": {
2441
2446
  "node": ">=0.10.0"
2442
2447
  }
@@ -2446,6 +2451,7 @@
2446
2451
  "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz",
2447
2452
  "integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==",
2448
2453
  "license": "MIT",
2454
+ "peer": true,
2449
2455
  "dependencies": {
2450
2456
  "scheduler": "^0.27.0"
2451
2457
  },
@@ -33,7 +33,6 @@
33
33
  "@fortawesome/free-solid-svg-icons": "^5.15.4",
34
34
  "@lezer/highlight": "^1.2.3",
35
35
  "castle-web-fonts": "^1.0.0",
36
- "castle-web-sdk": "file:../../sdk",
37
36
  "codemirror": "^6.0.2",
38
37
  "matter-js": "^0.20.0",
39
38
  "react": "^19.2.4",
@@ -43,6 +42,7 @@
43
42
  "eslint": "^9.0.0",
44
43
  "eslint-plugin-react-hooks": "^5.0.0",
45
44
  "jscpd": "^4.0.5",
46
- "prettier": "^3.8.3"
45
+ "prettier": "^3.8.3",
46
+ "castle-web-sdk": "file:../../sdk"
47
47
  }
48
48
  }
@@ -3,7 +3,7 @@
3
3
  A 3D actor/behavior kit: three.js rendering with PBR lighting and rapier
4
4
  physics, built ON TOP of the `physics-2d` kit as an import. The actor /
5
5
  behavior / scene / blueprint model, deck file map, live reload, and the
6
- `.pxart` pixel-art pipeline (including its editor) all come from
6
+ `.sprite` pixel-art pipeline (including its editor) all come from
7
7
  `imports/castle.physics-2d/` and work exactly as that kit's CLAUDE.md
8
8
  describes. This file covers what is different in 3D.
9
9
 
@@ -26,9 +26,9 @@ other)` / `onCollisionExit` for both contacts and sensor overlaps.
26
26
  - `Shape`: `kind` `'box' | 'sphere' | 'capsule' | 'cylinder'` with
27
27
  `width/height/depth` or `radius`, PBR knobs (`color`, `roughness`,
28
28
  `metalness`, `clearcoat`, `emissive`, `emissiveIntensity`), and `art` -- a
29
- `.pxart`/image path baked as a nearest-filtered albedo map. On boxes `art`
29
+ `.sprite`/image path baked as a nearest-filtered albedo map. On boxes `art`
30
30
  may be a per-face object `{ all, sides, front, back, left, right, top,
31
- bottom }`; any ref can pick a frame of a multi-frame pxart with
31
+ bottom }`; any ref can pick a frame of a multi-frame sprite with
32
32
  `path#<frame>`. A flat `color` with no art is a fine look.
33
33
  - Motion goes through `scene.physics3d`, never by writing a dynamic actor's
34
34
  Transform: `setVelocity(actor, {x,y,z})`, `applyImpulse`, `getVelocity`,
@@ -49,7 +49,7 @@ bottom }`; any ref can pick a frame of a multi-frame pxart with
49
49
  load rebuilds the physics world and resets the scene to its authored state;
50
50
  `scene.persistent` survives loads -- the player's score, collected-pickup
51
51
  memory, and camera angle live there, so they cross scenes.
52
- - A scene can dress the ground: `"ground": { "art": "drawings/floor.pxart",
52
+ - A scene can dress the ground: `"ground": { "art": "drawings/floor.sprite",
53
53
  "tile": 2, "color": "#..." }` at the scene file's top level (`tile` = meters
54
54
  per texture repeat). `Shape.artRepeat: [u, v]` tiles a texture across a
55
55
  face so long walls don't stretch.
@@ -1,5 +1,5 @@
1
1
  // The actor's visual: a primitive mesh with a PBR material, and the source of
2
- // its collider dimensions. `art` names a `.pxart` (or image) file used as the
2
+ // its collider dimensions. `art` names a `.sprite` (or image) file used as the
3
3
  // albedo map, nearest-filtered so pixels stay crisp; `color` tints (or is the
4
4
  // whole surface when there is no art -- a flat colour is a fine look here).
5
5
  // `solid: true` is one of the two ways to make the collider solid (the other is
@@ -11,7 +11,7 @@
11
11
  "width": 1,
12
12
  "height": 1,
13
13
  "depth": 1,
14
- "art": "drawings/crate.pxart",
14
+ "art": "drawings/crate.sprite",
15
15
  "roughness": 0.85
16
16
  },
17
17
  "Body": {
@@ -12,10 +12,10 @@
12
12
  "height": 2.2,
13
13
  "depth": 0.3,
14
14
  "art": {
15
- "front": "drawings/door.pxart",
16
- "back": "drawings/door.pxart",
17
- "sides": "drawings/door-edge.pxart",
18
- "top": "drawings/door-edge.pxart"
15
+ "front": "drawings/door.sprite",
16
+ "back": "drawings/door.sprite",
17
+ "sides": "drawings/door-edge.sprite",
18
+ "top": "drawings/door-edge.sprite"
19
19
  },
20
20
  "color": "#c9a17a",
21
21
  "roughness": 0.8
@@ -10,7 +10,7 @@
10
10
  "kind": "cylinder",
11
11
  "radius": 0.3,
12
12
  "height": 3,
13
- "art": "drawings/wall.pxart",
13
+ "art": "drawings/wall.sprite",
14
14
  "artRepeat": [
15
15
  1,
16
16
  1.5