castle-web-cli 0.4.228 → 0.4.230

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 (236) hide show
  1. package/dist/agent-prompts.d.ts +11 -3
  2. package/dist/agent-prompts.js +153 -53
  3. package/dist/agent.d.ts +2 -0
  4. package/dist/agent.js +43 -33
  5. package/dist/api.d.ts +47 -2
  6. package/dist/api.js +85 -16
  7. package/dist/castle-host/host.d.ts +91 -0
  8. package/dist/castle-host/host.js +779 -3
  9. package/dist/castleJson.d.ts +59 -0
  10. package/dist/castleJson.js +267 -3
  11. package/dist/check.js +27 -1
  12. package/dist/cloudGit.d.ts +20 -1
  13. package/dist/cloudGit.js +267 -10
  14. package/dist/contentPack.d.ts +49 -0
  15. package/dist/contentPack.js +273 -0
  16. package/dist/devExperiments.d.ts +21 -0
  17. package/dist/devExperiments.js +139 -0
  18. package/dist/devHub.d.ts +55 -0
  19. package/dist/devHub.js +187 -0
  20. package/dist/devSessionChild.js +3 -1
  21. package/dist/devSessionServer.d.ts +14 -1
  22. package/dist/devSessionServer.js +229 -44
  23. package/dist/experimentAssignment.d.ts +15 -0
  24. package/dist/experimentAssignment.js +41 -0
  25. package/dist/importCheckHook.d.ts +40 -0
  26. package/dist/importCheckHook.js +171 -0
  27. package/dist/importRegression.d.ts +15 -0
  28. package/dist/importRegression.js +100 -0
  29. package/dist/importTrust.d.ts +2 -0
  30. package/dist/importTrust.js +27 -0
  31. package/dist/importUpdateHook.d.ts +18 -0
  32. package/dist/importUpdateHook.js +31 -8
  33. package/dist/importUpdateHookRunner.js +19 -7
  34. package/dist/imports.d.ts +16 -0
  35. package/dist/imports.js +145 -33
  36. package/dist/index.js +8 -1
  37. package/dist/init.d.ts +3 -0
  38. package/dist/init.js +125 -8
  39. package/dist/install.js +4 -1
  40. package/dist/localPaths.js +4 -0
  41. package/dist/login.js +2 -2
  42. package/dist/platformDoc.js +3 -8
  43. package/dist/playPagePolicy.js +3 -1
  44. package/dist/remix.js +5 -0
  45. package/dist/routerTaskReport.d.ts +28 -0
  46. package/dist/routerTaskReport.js +56 -0
  47. package/dist/save-deck.d.ts +18 -0
  48. package/dist/save-deck.js +145 -6
  49. package/dist/serve.d.ts +8 -0
  50. package/dist/serve.js +94 -13
  51. package/dist/serverBundle.d.ts +1 -1
  52. package/dist/serverBundle.js +5 -1
  53. package/dist/sourceLineage.d.ts +42 -0
  54. package/dist/sourceLineage.js +380 -0
  55. package/dist/webSourceSync.d.ts +11 -0
  56. package/dist/webSourceSync.js +26 -9
  57. package/kits/base/CLAUDE.md +2 -3
  58. package/kits/base/castle.json +1 -1
  59. package/kits/base/sdk/README.md +301 -52
  60. package/kits/base/sdk/agent.js +4 -4
  61. package/kits/base/sdk/avatar.d.ts +12 -0
  62. package/kits/base/sdk/avatar.js +23 -0
  63. package/kits/base/sdk/castle.d.ts +6 -1
  64. package/kits/base/sdk/castle.js +3 -0
  65. package/kits/base/sdk/commands.d.ts +208 -0
  66. package/kits/base/sdk/commands.js +16 -0
  67. package/kits/base/sdk/context.d.ts +6 -0
  68. package/kits/base/sdk/experiments.d.ts +15 -0
  69. package/kits/base/sdk/experiments.js +83 -0
  70. package/kits/base/sdk/hub.d.ts +85 -0
  71. package/kits/base/sdk/hub.js +107 -0
  72. package/kits/base/sdk/multiplayer.d.ts +86 -6
  73. package/kits/base/sdk/multiplayer.js +157 -4
  74. package/kits/base/sdk/server/hub.d.ts +169 -0
  75. package/kits/base/sdk/server/hub.js +125 -0
  76. package/kits/base/sdk/server/platformHandle.d.ts +49 -2
  77. package/kits/base/sdk/server/storage.d.ts +55 -2
  78. package/kits/base/sdk/server/wrapper.d.ts +85 -6
  79. package/kits/base/sdk/server/wrapper.js +393 -30
  80. package/kits/base/sdk/transport.d.ts +2 -1
  81. package/kits/base/sdk/transport.js +13 -1
  82. package/kits/hub-game/.prettierrc +5 -0
  83. package/kits/hub-game/CLAUDE.md +146 -0
  84. package/kits/hub-game/blueprints/avatar-0.scene +28 -0
  85. package/kits/hub-game/blueprints/avatar-1.scene +28 -0
  86. package/kits/hub-game/blueprints/avatar-2.scene +28 -0
  87. package/kits/hub-game/blueprints/avatar-3.scene +28 -0
  88. package/kits/hub-game/blueprints/bean/avatar-0.scene +28 -0
  89. package/kits/hub-game/blueprints/bean/avatar-1.scene +28 -0
  90. package/kits/hub-game/blueprints/bean/avatar-2.scene +28 -0
  91. package/kits/hub-game/blueprints/bean/avatar-3.scene +28 -0
  92. package/kits/hub-game/blueprints/blocky/avatar-0.scene +28 -0
  93. package/kits/hub-game/blueprints/blocky/avatar-1.scene +28 -0
  94. package/kits/hub-game/blueprints/blocky/avatar-2.scene +28 -0
  95. package/kits/hub-game/blueprints/blocky/avatar-3.scene +28 -0
  96. package/kits/hub-game/blueprints/pixel/avatar-0.scene +28 -0
  97. package/kits/hub-game/blueprints/pixel/avatar-1.scene +28 -0
  98. package/kits/hub-game/blueprints/pixel/avatar-2.scene +28 -0
  99. package/kits/hub-game/blueprints/pixel/avatar-3.scene +28 -0
  100. package/kits/hub-game/castle.json +96 -0
  101. package/kits/hub-game/code/client/attention.js +133 -0
  102. package/kits/hub-game/code/client/avatar.js +288 -0
  103. package/kits/hub-game/code/client/cabinets.js +90 -0
  104. package/kits/hub-game/code/client/chat.js +135 -0
  105. package/kits/hub-game/code/client/chrome.js +1001 -0
  106. package/kits/hub-game/code/client/doorFrame.js +15 -0
  107. package/kits/hub-game/code/client/firstJoin.js +14 -0
  108. package/kits/hub-game/code/client/grab.js +241 -0
  109. package/kits/hub-game/code/client/hookLayer.js +230 -0
  110. package/kits/hub-game/code/client/idle.js +326 -0
  111. package/kits/hub-game/code/client/keys.js +48 -0
  112. package/kits/hub-game/code/client/pack.js +232 -0
  113. package/kits/hub-game/code/client/packFormat.js +397 -0
  114. package/kits/hub-game/code/client/say.js +127 -0
  115. package/kits/hub-game/code/client/sha256.js +80 -0
  116. package/kits/hub-game/code/client/sound.js +147 -0
  117. package/kits/hub-game/code/client/state.js +131 -0
  118. package/kits/hub-game/code/client/talk.js +259 -0
  119. package/kits/hub-game/code/client/together.js +365 -0
  120. package/kits/hub-game/code/client/wear.js +149 -0
  121. package/kits/hub-game/code/server/actors.js +627 -0
  122. package/kits/hub-game/code/server/blocks.js +103 -0
  123. package/kits/hub-game/code/server/cabinets.js +309 -0
  124. package/kits/hub-game/code/server/game.js +137 -0
  125. package/kits/hub-game/code/server/grab.js +247 -0
  126. package/kits/hub-game/code/server/history.js +96 -0
  127. package/kits/hub-game/code/server/hub.js +1904 -0
  128. package/kits/hub-game/code/server/idle.js +412 -0
  129. package/kits/hub-game/code/server/index.js +64 -0
  130. package/kits/hub-game/code/server/labels.js +59 -0
  131. package/kits/hub-game/code/server/manifest.js +527 -0
  132. package/kits/hub-game/code/server/npcs.js +745 -0
  133. package/kits/hub-game/code/server/party.js +381 -0
  134. package/kits/hub-game/code/server/place.js +43 -0
  135. package/kits/hub-game/code/server/say.js +83 -0
  136. package/kits/hub-game/code/server/wear.js +142 -0
  137. package/kits/hub-game/code/systems/hub.js +2230 -0
  138. package/kits/hub-game/docs/content-pack.md +151 -0
  139. package/kits/hub-game/docs/contract.md +1139 -0
  140. package/kits/hub-game/docs/style.md +137 -0
  141. package/kits/hub-game/drawings/blocky/castle-eye.sprite +58 -0
  142. package/kits/hub-game/drawings/blocky/dash.sprite +59 -0
  143. package/kits/hub-game/drawings/blocky/pom.sprite +59 -0
  144. package/kits/hub-game/drawings/blocky/tabby.sprite +59 -0
  145. package/kits/hub-game/drawings/pixel/castle-arm.sprite +13 -0
  146. package/kits/hub-game/drawings/pixel/castle-body.sprite +23 -0
  147. package/kits/hub-game/drawings/pixel/castle-leg.sprite +12 -0
  148. package/kits/hub-game/drawings/pixel/kai-arm.sprite +14 -0
  149. package/kits/hub-game/drawings/pixel/kai-head.sprite +24 -0
  150. package/kits/hub-game/drawings/pixel/kai-leg.sprite +15 -0
  151. package/kits/hub-game/drawings/pixel/kai-torso.sprite +18 -0
  152. package/kits/hub-game/drawings/pixel/mimi-arm.sprite +13 -0
  153. package/kits/hub-game/drawings/pixel/mimi-head.sprite +23 -0
  154. package/kits/hub-game/drawings/pixel/mimi-leg.sprite +15 -0
  155. package/kits/hub-game/drawings/pixel/mimi-torso.sprite +18 -0
  156. package/kits/hub-game/drawings/pixel/nox-arm.sprite +13 -0
  157. package/kits/hub-game/drawings/pixel/nox-head.sprite +21 -0
  158. package/kits/hub-game/drawings/pixel/nox-leg.sprite +14 -0
  159. package/kits/hub-game/drawings/pixel/nox-torso.sprite +18 -0
  160. package/kits/hub-game/eslint.config.js +20 -0
  161. package/kits/hub-game/fonts.generated.js +9 -0
  162. package/kits/hub-game/index.html +22 -0
  163. package/kits/hub-game/main.jsx +6 -0
  164. package/kits/hub-game/models/avatar-0.pxmodel +21 -0
  165. package/kits/hub-game/models/avatar-1.pxmodel +24 -0
  166. package/kits/hub-game/models/avatar-2.pxmodel +27 -0
  167. package/kits/hub-game/models/avatar-3.pxmodel +22 -0
  168. package/kits/hub-game/models/bean/avatar-0.pxmodel +19 -0
  169. package/kits/hub-game/models/bean/avatar-1.pxmodel +24 -0
  170. package/kits/hub-game/models/bean/avatar-2.pxmodel +22 -0
  171. package/kits/hub-game/models/bean/avatar-3.pxmodel +24 -0
  172. package/kits/hub-game/models/blocky/avatar-0.pxmodel +21 -0
  173. package/kits/hub-game/models/blocky/avatar-1.pxmodel +30 -0
  174. package/kits/hub-game/models/blocky/avatar-2.pxmodel +28 -0
  175. package/kits/hub-game/models/blocky/avatar-3.pxmodel +27 -0
  176. package/kits/hub-game/models/pixel/avatar-0.pxmodel +24 -0
  177. package/kits/hub-game/models/pixel/avatar-1.pxmodel +16 -0
  178. package/kits/hub-game/models/pixel/avatar-2.pxmodel +19 -0
  179. package/kits/hub-game/models/pixel/avatar-3.pxmodel +23 -0
  180. package/kits/hub-game/package-lock.json +365 -0
  181. package/kits/hub-game/package.json +32 -0
  182. package/kits/hub-game/scenes/main.scene +318 -0
  183. package/kits/hub-game/scripts/check.mjs +339 -0
  184. package/kits/hub-game/scripts/fixtures/sdk-stub.mjs +3 -0
  185. package/kits/hub-game/scripts/gen-avatars-bean.mjs +748 -0
  186. package/kits/hub-game/scripts/gen-avatars-blocky.mjs +607 -0
  187. package/kits/hub-game/scripts/gen-avatars-pixel.mjs +771 -0
  188. package/kits/hub-game/scripts/gen-avatars.mjs +621 -0
  189. package/kits/hub-game/scripts/pack.mjs +192 -0
  190. package/kits/hub-game/scripts/test-actors.mjs +666 -0
  191. package/kits/hub-game/scripts/test-attention.mjs +103 -0
  192. package/kits/hub-game/scripts/test-avatar.mjs +472 -0
  193. package/kits/hub-game/scripts/test-ban-join.mjs +194 -0
  194. package/kits/hub-game/scripts/test-blocks.mjs +351 -0
  195. package/kits/hub-game/scripts/test-chat.mjs +98 -0
  196. package/kits/hub-game/scripts/test-classic.mjs +590 -0
  197. package/kits/hub-game/scripts/test-door-jump.mjs +131 -0
  198. package/kits/hub-game/scripts/test-door.mjs +56 -0
  199. package/kits/hub-game/scripts/test-grab.mjs +331 -0
  200. package/kits/hub-game/scripts/test-hub-ops.mjs +835 -0
  201. package/kits/hub-game/scripts/test-hub-trip.mjs +1310 -0
  202. package/kits/hub-game/scripts/test-idle.mjs +518 -0
  203. package/kits/hub-game/scripts/test-interest.mjs +413 -0
  204. package/kits/hub-game/scripts/test-keys.mjs +50 -0
  205. package/kits/hub-game/scripts/test-manifest.mjs +224 -0
  206. package/kits/hub-game/scripts/test-no-forms.mjs +16 -0
  207. package/kits/hub-game/scripts/test-npcs.mjs +714 -0
  208. package/kits/hub-game/scripts/test-pack.mjs +424 -0
  209. package/kits/hub-game/scripts/test-party.mjs +286 -0
  210. package/kits/hub-game/scripts/test-say.mjs +149 -0
  211. package/kits/hub-game/scripts/test-together.mjs +183 -0
  212. package/kits/hub-game/theme.style +3 -0
  213. package/kits/multiplayer-3d/castle.json +5 -5
  214. package/kits/multiplayer-3d/code/client/avatars.js +101 -1
  215. package/kits/multiplayer-3d/code/server/players.js +4 -1
  216. package/kits/multiplayer-3d/code/server/sceneBodies.js +27 -6
  217. package/kits/multiplayer-3d/code/server/world.js +20 -7
  218. package/kits/multiplayer-3d/code/systems/multiplayer.js +222 -11
  219. package/kits/physics-2d/castle.json +2 -2
  220. package/kits/physics-2d/engine/art.js +13 -0
  221. package/kits/physics-2d/engine/assets.js +4 -2
  222. package/kits/physics-2d/engine/scene.js +25 -5
  223. package/kits/physics-3d/CLAUDE.md +6 -1
  224. package/kits/physics-3d/castle.json +3 -3
  225. package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +32 -4
  226. package/kits/physics-3d/engine3d/artobjects.js +2 -2
  227. package/kits/physics-3d/engine3d/materials.js +29 -1
  228. package/kits/physics-3d/engine3d/world3d.js +65 -1
  229. package/kits/physics-3d/systems/physics3d.js +5 -2
  230. package/kits/real-time/castle.json +2 -2
  231. package/kits/real-time/code/client/connection.js +77 -7
  232. package/kits/real-time/code/client/gameHooks.js +63 -3
  233. package/kits/real-time/code/client/messages.js +7 -0
  234. package/kits/real-time/code/server/gameHooks.js +24 -0
  235. package/kits/real-time/code/server/session.js +390 -22
  236. package/package.json +2 -2
@@ -0,0 +1,146 @@
1
+ # hub-game
2
+
3
+ A game behind a door in the Cauldron hub town. A hub game is a
4
+ `castle.multiplayer-3d` deck that meets the **hub contract**
5
+ (`docs/contract.md`, version 1): the kit draws every player as their platform
6
+ avatar, brings them in at the arrival together and sends them back out
7
+ through the door they came in by, and draws the HUD, labels and Back control
8
+ the game declares. The game itself is scene data plus server hooks -- **no
9
+ client code** (Tier 0).
10
+
11
+ Read `docs/contract.md` before changing the `hub` block or the server hooks;
12
+ it is what every published hub game depends on.
13
+
14
+ ## Quick reference
15
+
16
+ <!-- Injected into Castle's create assistant every turn; keep this compact and factual. -->
17
+
18
+ - Scenes, blueprints, models and behaviors are `castle.physics-3d`'s, the
19
+ network is `castle.multiplayer-3d`'s; this kit adds the hub. Everything those
20
+ kits' guides say about scenes and the server holds, except where it says
21
+ otherwise below.
22
+ - **No client code.** A hub game ships nothing under `code/client/`,
23
+ `code/systems/`, `behaviors/`, and no `.js` outside `code/server/`. The
24
+ check refuses it: a hub game's content runs inside the town's iframe.
25
+ - **The game is `code/server/game.js`**, a default export of hooks that each
26
+ get `hub`, the place's context: `ready(hub)`, `arrive(hub, group)`,
27
+ `step(hub, dt)`, `leave(hub, playerId, { userId, username })` (a result may be
28
+ reported there), `shutdown(hub)` (finish writing), `message(hub, player, data)`,
29
+ `fall(hub, playerId)` (below the place's `fallY`; a scene with
30
+ `"ground": { "none": true }` has no ground and catches at -20 by default).
31
+ `server.main` stays `imports/castle.hub-game/code/server/index.js`.
32
+ - **A player's progress between visits** goes in `hub.session.storage.deck`
33
+ under `'<name>:<userId>'`, never user scope, which their own client can
34
+ write (contract §14).
35
+ - What `hub` does: `players()`, `actorsWith(component)` (each with its `t`,
36
+ `props`, `shape` and `body`), `now`, `placeAt`,
37
+ `hold` / `release` (keep a player still), `setHud(spec, playerId?)`,
38
+ `hide` / `show` (an actor, for everyone), `move(actorId, { x, y, z,
39
+ rotationY }, { overMs })` (a `Body` `"kinematic"` actor: platforms, sweepers,
40
+ gates), `tint(actorId, '#rrggbb' | null)` (a Shape actor's colour),
41
+ `mark(playerId, { text, color } | null)` (a coloured tag over a player's
42
+ avatar: a team, who is it), `wear(playerId, { kind, color, rarity } | null)`
43
+ (v1.4: `halo`, `aura` or `orbit` in `#rrggbb`, rarity 0-9, worn on the
44
+ player's avatar in every hub place once ghost keeps it), `spawn(fromActorId, at)` / `despawn(id)` (a
45
+ copy of a scene actor, often a hidden prototype), `pose(actorId)` /
46
+ `reset(actorId, at?)` (read a body; put a loose object back, at rest),
47
+ `tune(playerId, { speed,
48
+ jump } | null)` (one player's own walk, as multipliers of the preset),
49
+ `label(actorId, text)`, `drop(playerId?)` / `holding(playerId)` (grab, below),
50
+ `result(playerId, { outcome, score, stats })`, `results(playerId)` (ghost's
51
+ recent results and records of a player), `end(playerIds?)`,
52
+ `go(door, playerIds)`, `send`, `broadcast`, `session`, `sim`, `place`.
53
+ - **The HUD** is `{ title, big, text, timer: { since | until } }` in simulation
54
+ ms (`hub.now`), drawn by the hub. It is the only way the game puts words on
55
+ screen.
56
+ - **Results** are server-only, once per player per visit, checked against
57
+ `hub.result` in `castle.json`. No free text: the town writes the words. The
58
+ `outcome` may be left out when a `score` says it all (a time trial).
59
+ - **Players arrive at `hub.arrival.actor`**, in a row, facing
60
+ `hub.arrival.face`, already placed when `arrive` runs. Never move the Player
61
+ actor in the scene to change that -- change the arrival.
62
+ - **Exit is always the hub's**: the Back control, `hub.end`, or
63
+ `hub.maxDurationSec`. A game has no lobby and no leave button.
64
+ - Never ship `blueprints/other-player.scene` or restyle the Player: every
65
+ player is drawn as their avatar (`blueprints/avatar-<n>.scene` here).
66
+ - Controller: `"walk"` (the engine's `Player`) is the only preset; `hub.tune`
67
+ scales one player's speed and jump within it. No
68
+ player shove: other players are kinematic.
69
+ - **Grab and throw** (contract v1.3): `"grab": true` in the `hub` block (or
70
+ `{ throwSpeed, holdDistance, holdHeight }`) gives players a Grab / Throw
71
+ button for the place's `Body` `"dynamic"` actors (crates, barrels). The
72
+ optional hook `grab(hub, playerId, actorId, op)` hears each `'grab'` and
73
+ `'throw'` and refuses a grab by returning `false`; `hub.drop(playerId?)`
74
+ makes holders let go (a goal, a whistle), `hub.holding(playerId)` says what
75
+ someone holds. Never a player, one object at a time.
76
+ - **Idle play** (contract v1.6): `"idle": true` in the `hub` block (or
77
+ `{ emotes, seats, sounds: ["sounds/x.mp3"] }`) gives players an emote picker
78
+ (wave, dance, cheer, bow, spin, drawn on their avatar) and Sit on scene
79
+ actors carrying `HubSeat` (`{ face, height }`); a seat is a hold, so the
80
+ place's `hub.release` stands a sitter. Hooks `emote(hub, playerId, id)` and
81
+ `sit(hub, playerId, seatId)` may refuse with `false`; `hub.emote(playerId,
82
+ id)`, `hub.seat(playerId)`, and `hub.sound(actorId, file, { loop, volume,
83
+ radius })` / `hub.sound(actorId, null)` for a listed sound file of the deck
84
+ (carried in its content pack's `audio`, so a game behind a door sounds too;
85
+ silent only on a town whose engine predates that).
86
+ - **Cabinets** (contract v1.7): a `HubDoor` with `"kind": "cabinet"` whose
87
+ board from ghost carries `classic` is a door to a classic Castle deck the
88
+ host plays itself. `hub.doors()` says `classic: true` once the board is
89
+ read; `hub.go(doorId, [playerId])` sends that player through alone (away
90
+ under the hub's cover until Back). The kit sends and draws the cabinet's
91
+ card: by the cabinet a small chip (the best score and whose it is), and on a
92
+ tap the board (cover, title, top scores with photos and frames). Inert on the dev
93
+ serve, where there is no board.
94
+ - Run it like any multiplayer deck: `castle-web serve`, two tabs on the play
95
+ URL. Played on its own, Back and the game's end start a fresh instance.
96
+ - `npm run check` bundles the deck and runs this kit's contract check; it must
97
+ pass before `save-deck`, which runs the same check and refuses to publish.
98
+
99
+ ## What is where
100
+
101
+ | file | what it is |
102
+ | --- | --- |
103
+ | `docs/contract.md` | the contract, versioned |
104
+ | `code/server/index.js` | the session entry: multiplayer-3d's, with the hub layer around the deck's hooks |
105
+ | `code/server/hub.js` | the hub layer: place, avatars, arrival, holds, HUD, visibility, labels, results, exit, doors |
106
+ | `code/server/actors.js` | `hub.move` and `hub.tint`: kinematic actors driven by the server, painted actors under a budget |
107
+ | `code/server/grab.js`, `code/client/grab.js` | grabbing and throwing (v1.3): the server's checks, hook and `hub.drop`; the client's button, hold and throw |
108
+ | `code/server/idle.js`, `code/client/idle.js`, `code/client/sound.js` | idle play (v1.6): emotes, seats and sounds; the server's checks, hooks and `hub.emote` / `hub.seat` / `hub.sound`; the client's picker, Sit / Stand, avatar motion and audio |
109
+ | `code/server/cabinets.js`, `code/client/cabinets.js` | cabinets (v1.7): the server's cards (bounded, sent per player in range inside a send budget) and the dev fixture; the client's kept cards and which one to draw |
110
+ | `code/server/say.js`, `code/client/say.js` | quick reactions and canned phrases (v1.11): ids only, never text; the server's checks and fan-out, the client's words, bubbles and feed |
111
+ | `code/client/chat.js` | free-text chat (v1.12): polls the host for what this player may read and whom they reach, sends through it; who may chat is ghost's rule, never the kit's |
112
+ | `code/server/party.js` | parties in a town (v1.10): invitations, a door proposed to the party, members put on its pad, `hub.coming`; a member away through a door is kept |
113
+ | `code/client/together.js` | finding a friend in a town (v1.9): who here is one, the People list's rows, the pointers; the server's half (`hub-where`, `hub-goto`, the `where` hook) is in `code/server/hub.js` |
114
+ | `code/server/manifest.js` | reads and checks the `hub` block and results (plain JS, shared with the check) |
115
+ | `code/server/place.js` | which place a session runs, from the session alone |
116
+ | `code/server/game.js` | the starter game (Flag Dash), copied into a new deck |
117
+ | `code/client/hookLayer.js` | the client hooks, layered under the deck's by `castle.real-time` |
118
+ | `code/systems/hub.js` | the door trip, Back, joining a friend's layer, the HUD, labels, hidden actors, holds, the ribbon |
119
+ | `code/client/chrome.js`, `state.js`, `avatar.js`, `firstJoin.js` | the DOM chrome, what the place declared, the avatar seam, the main place's first join (§13) |
120
+ | `blueprints/avatar-<n>.scene`, `models/avatar-<n>.pxmodel`, `scripts/gen-avatars.mjs` | the four avatars (the Castle mascot, Petal, Beat, Star) and the script that writes their models; each avatar's height is in `avatar.js`, for what is worn over it |
121
+ | `scripts/gen-avatars-blocky.mjs`, `gen-avatars-bean.mjs`, `gen-avatars-pixel.mjs` | the scripts that write the other three sets' models (and blocky's and pixel's drawings); each set is the Castle mascot and three characters of its own |
122
+ | `blueprints/<style>/avatar-<n>.scene`, `models/<style>/`, `drawings/<style>/` | the other avatar sets (`blocky`, `bean`, `pixel`): the same four avatar ids drawn another way, picked per viewer by `Avatar.style()` (the `hub_avatar_style` experiment, or `?hubStyle=` on localhost); toon unless one is assigned (contract §11) |
123
+ | `scripts/check.mjs` | the publish check (`onCheck`) |
124
+ | `scripts/pack.mjs` | the content pack exporter (`onPack`): the deck's client half as data, for another deck's engine (`docs/content-pack.md`) |
125
+ | `code/client/pack.js`, `packFormat.js`, `sha256.js` | mounting a pack: fetch, verify, validate, build content |
126
+ | `scripts/test-manifest.mjs`, `test-pack.mjs`, `test-actors.mjs`, `test-idle.mjs`, `test-classic.mjs` | tests over the manifest, results, place resolution, the pack, moved and painted actors, idle play, and cabinets |
127
+
128
+ ## Rules for editing this kit
129
+
130
+ - A change to anything `docs/contract.md` describes is a contract change: an
131
+ optional new field is fine within v1; anything that changes what a field
132
+ means, or removes one, is v2 and must keep v1 decks working.
133
+ - The place a session runs comes from the session (`place.js`), never from a
134
+ client message.
135
+ - Hub chrome is drawn by this kit, never by game content.
136
+ - Root-anchor anything that reaches the deck (`/castle.json`,
137
+ `/code/server/game.js`), as the multiplayer kits do.
138
+
139
+ ## Not offered yet
140
+
141
+ This kit's `castle.json` carries no `description` on purpose: the CLI's kit
142
+ catalog (`cli/src/kitCatalog.ts`) offers the create assistant only kits that
143
+ describe themselves, and hub games are Castle-authored only until the door
144
+ table and curation exist (HUB.md decision 10). `castle-web init --kit
145
+ hub-game` works regardless. Adding the description is the switch that offers
146
+ it.
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 1",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/avatar-0.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 2",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/avatar-1.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 3",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/avatar-2.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 4",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/avatar-3.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 1",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/bean/avatar-0.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 2",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/bean/avatar-1.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 3",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/bean/avatar-2.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 4",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/bean/avatar-3.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 1",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/blocky/avatar-0.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 2",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/blocky/avatar-1.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 3",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/blocky/avatar-2.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 4",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/blocky/avatar-3.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 1",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/pixel/avatar-0.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 2",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/pixel/avatar-1.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 3",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/pixel/avatar-2.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "Avatar 4",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#7fc9b8",
14
+ "roughness": 0.4
15
+ },
16
+ "Body": {
17
+ "type": "kinematic",
18
+ "lockRotations": true
19
+ },
20
+ "Solid": {},
21
+ "Model": {
22
+ "file": "models/pixel/avatar-3.pxmodel",
23
+ "yOffset": -0.7
24
+ }
25
+ }
26
+ }
27
+ ]
28
+ }