castle-web-cli 0.4.154 → 0.4.156

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.
@@ -289,16 +289,19 @@ function unavailableOutcome() {
289
289
  }
290
290
  async function deckStorageLoad(ctx, gql) {
291
291
  const deckId = requireDeckId(ctx, "deckStorage.load");
292
- const data = await graphql(gql, DECK_STORAGE_QUERY, { deckId, sessionId: ctx.sessionId }, "deckStorage.load");
292
+ const data = await graphql(gql, DECK_STORAGE_QUERY,
293
+ // Same reason as shared storage: a play session is not a save slot. With one
294
+ // the key becomes per-play, so a deck's own save data is gone next time.
295
+ { deckId, sessionId: null }, "deckStorage.load");
293
296
  return { blob: data.deckStorage ?? {} };
294
297
  }
295
298
  async function deckStorageUpdate(ctx, params, gql) {
296
299
  const deckId = requireDeckId(ctx, "deckStorage.update");
297
300
  const data = await graphql(gql, UPDATE_DECK_STORAGE_MUTATION, {
298
301
  deckId,
299
- sessionId: ctx.sessionId,
302
+ sessionId: null,
300
303
  updates: asUpdates(params.updates),
301
- }, "deckStorage.update");
304
+ }, "deckStorage.update", { unload: params.unload === true });
302
305
  return { blob: data.updateDeckStorage ?? {} };
303
306
  }
304
307
  async function sharedDeckStorageLoad(ctx, params, gql) {
@@ -320,7 +323,7 @@ async function sharedDeckStorageUpdate(ctx, params, gql) {
320
323
  // 'user'-scope writes are forced to the current player — the deck cannot
321
324
  // write another player's bucket.
322
325
  const userId = scope === "user" ? requireUserId(ctx, "sharedDeckStorage.update") : null;
323
- await graphql(gql, UPDATE_SHARED_DECK_STORAGE_MUTATION, { deckId, sessionId: null, userId, updates: asUpdates(params.updates) }, "sharedDeckStorage.update");
326
+ await graphql(gql, UPDATE_SHARED_DECK_STORAGE_MUTATION, { deckId, sessionId: null, userId, updates: asUpdates(params.updates) }, "sharedDeckStorage.update", { unload: params.unload === true });
324
327
  return { ok: true };
325
328
  }
326
329
  async function leaderboardFetch(ctx, params, caps) {
@@ -494,8 +497,8 @@ async function timeGetServerTime(gql) {
494
497
  castleEpochData: data.serverTime.castleEpochData,
495
498
  };
496
499
  }
497
- async function graphql(gql, query, variables, command) {
498
- const result = await gql(query, variables);
500
+ async function graphql(gql, query, variables, command, options) {
501
+ const result = await gql(query, variables, options);
499
502
  if (result.errors && result.errors.length > 0) {
500
503
  const first = result.errors[0];
501
504
  const code = first?.extensions?.code;
package/dist/init.js CHANGED
@@ -46,7 +46,7 @@ export const BARE_DOCS_KIT = 'blank';
46
46
  // Registry version of castle-web-sdk to inject when scaffolding from a
47
47
  // globally-installed castle-web (not from inside the workspace). Bumped
48
48
  // alongside cli/sdk version bumps.
49
- const PUBLISHED_SDK_VERSION = '0.4.19';
49
+ const PUBLISHED_SDK_VERSION = '0.4.21';
50
50
  // Range, not a pin: `castle-web-fonts` is its own package precisely so a tenth
51
51
  // face can ship without a cli release, and a caret range means an existing
52
52
  // deck's next install picks it up. Nothing here has to move when it does.
@@ -7,5 +7,5 @@
7
7
  "title": "blank",
8
8
  "deckId": "yRcmH4_aYllE",
9
9
  "cardId": "zkFdingmIm3m",
10
- "publishedVersion": "2026-08-30T21:21:38.191Z"
10
+ "publishedVersion": "2026-08-30T22:05:14.995Z"
11
11
  }
@@ -132,5 +132,5 @@
132
132
  "main": "main.jsx",
133
133
  "autoUpdateWhenImported": true,
134
134
  "title": "physics-2d",
135
- "publishedVersion": "2026-08-30T21:21:40.235Z"
135
+ "publishedVersion": "2026-08-30T22:05:17.419Z"
136
136
  }
@@ -72,5 +72,5 @@
72
72
  "autoUpdateWhenImported": true,
73
73
  "deckId": "JH0SclbPVP0y",
74
74
  "cardId": "eXfAaUdbSU5A",
75
- "publishedVersion": "2026-08-30T21:21:42.774Z"
75
+ "publishedVersion": "2026-08-30T22:05:20.169Z"
76
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-cli",
3
- "version": "0.4.154",
3
+ "version": "0.4.156",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "castle-web": "./dist/index.js"