castle-web-cli 0.4.223 → 0.4.224

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.
@@ -224,6 +224,7 @@ const COMMON_SECTIONS = `## Imports are read-only
224
224
  - **The deck plays inside a fixed 5:7 portrait card, not the full window.** The card is sized to fit the screen (at most about 450x630px), clips overflow, and does not scroll. Design the whole layout to fit inside that portrait box: size UI relative to the card with percentages, flex/grid, \`min()\`, \`clamp()\`, or viewport-relative units instead of fixed tall panels. Let playfields scale down on smaller cards rather than overflowing; anything outside the card edges is cut off. The SDK exports \`CARD_RATIO\` (= 5 / 7) if you need the exact ratio.
225
225
  - **Hand-rolled \`<canvas>\` elements must account for devicePixelRatio, or the game looks blurry on phones.** Size the backing store to the CSS layout size times \`devicePixelRatio\` (e.g. \`canvas.width = rect.width * dpr\`), keep the CSS width/height as the layout size, and scale the 2D context (\`ctx.scale(dpr, dpr)\`) so drawing code stays in CSS units — re-apply on resize. Kit decks don't need to do this by hand; the kit's engine already configures its canvas for DPR.
226
226
  - Exception: deliberate pixel art wants a fixed low-resolution backing store with \`image-rendering: pixelated\` CSS instead — don't DPR-scale that; the crisp chunky look is the point.
227
+ - **A WebGL canvas must be created with \`preserveDrawingBuffer: true\`, or every in-page capture of the deck comes back blank** — the Play panel's Snap and \`npm run screenshot\` both read the canvas after the frame has been shown, and by then the browser has cleared it, so the image is just the card's background. Pass it through whatever library makes the canvas: \`new THREE.WebGLRenderer({ preserveDrawingBuffer: true })\`, PixiJS \`app.init({ preserveDrawingBuffer: true })\`, or \`canvas.getContext('webgl2', { preserveDrawingBuffer: true })\`. A 2D canvas needs nothing, and kit decks already set it.
227
228
 
228
229
  ## Multiplayer
229
230
 
@@ -82,7 +82,7 @@
82
82
  "title": "base",
83
83
  "deckId": "yRcmH4_aYllE",
84
84
  "cardId": "zkFdingmIm3m",
85
- "publishedVersion": "2026-09-27T21:28:52.060Z",
85
+ "publishedVersion": "2026-09-28T17:58:49.300Z",
86
86
  "provides": [
87
87
  "castle-web-sdk"
88
88
  ]
@@ -253,17 +253,18 @@ guide.
253
253
  ### Limits
254
254
 
255
255
  The platform caps key length, value size, how many keys one read may
256
- name, and how much a deck may store in total, and it limits how fast a
256
+ name, and how much each player may store, and it limits how fast a
257
257
  player may read and write. Going over one of these rejects with a
258
258
  `CastleError` whose `code` says which, so a deck can tell a player it is
259
- saving too fast apart from a deck that is out of space:
259
+ saving too fast apart from a player who is out of space:
260
260
 
261
261
  | limit | value |
262
262
  |---|---|
263
263
  | key | 128 bytes |
264
264
  | value | 256 KB |
265
265
  | keys in one `get` | 32 |
266
- | whole deck | 50 MB, 500,000 keys |
266
+ | one player's data in a deck | 10 MB, 50,000 keys |
267
+ | the deck's shared data (`Store.deck`) | 500 MB, 1,000,000 keys |
267
268
  | one player's calls | 20 a second, 512 KB a second |
268
269
  | every player of a deck together | 500 calls a second, 8 MB a second |
269
270
 
@@ -273,6 +274,13 @@ A `list` page holds at most 1,000 entries (a larger `limit` is lowered to
273
274
  it) and ends early once it reaches 1 MB; take the next page with its
274
275
  `cursor`.
275
276
 
277
+ A player's data is everything stored for them: their `Store.private`
278
+ keys, their `Store.user(id)` keys, and their scores on every board.
279
+ Each player has their own allowance, so a deck with more
280
+ players can hold more, and one player filling theirs does not stop
281
+ anyone else. A write that shrinks what a player stores always succeeds,
282
+ so a player who is full can always free space.
283
+
276
284
  A value is JSON, so binary data such as a picture or a video clip costs
277
285
  about a third more once encoded, and a clip of more than a few seconds
278
286
  does not fit in one. Ship media with the deck instead.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-cli",
3
- "version": "0.4.223",
3
+ "version": "0.4.224",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/castle-xyz/castle-experimental-web.git"