@pixelvibing/cli 0.37.0 → 0.38.1

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.
@@ -309,6 +309,7 @@ class DesktopSession {
309
309
  }
310
310
  const body = answer2.ok ? await json$1(answer2) : null;
311
311
  if (body === null || typeof body.access !== "string") throw new Error("the API could not renew the sign-in just now");
312
+ if (typeof body.session === "string" && body.session !== secret) await this.keep(body.session);
312
313
  this.access = { jwt: body.access, expiresAt: this.now() + body.expiresIn * 1e3 };
313
314
  return body.access;
314
315
  } finally {
@@ -317,15 +318,19 @@ class DesktopSession {
317
318
  })();
318
319
  return this.renewing;
319
320
  }
320
- /** Sign out: the API deletes the session, and this computer forgets it, even when the API cannot be reached. */
321
+ /**
322
+ * Sign out: the API deletes the session and revokes the JWT this run holds, and this
323
+ * computer forgets both, even when the API cannot be reached.
324
+ */
321
325
  async signOut() {
322
326
  await this.load();
323
327
  const secret = this.secret;
328
+ const access = this.access;
324
329
  await this.forget();
325
330
  if (secret === null) return;
326
331
  await this.fetch(`${this.options.apiUrl}/auth/desktop/sign-out`, {
327
332
  method: "POST",
328
- headers: { "content-type": "application/json" },
333
+ headers: { "content-type": "application/json", ...access === null ? {} : { authorization: `Bearer ${access.jwt}` } },
329
334
  body: JSON.stringify({ session: secret })
330
335
  }).catch(() => {
331
336
  });
@@ -3912,7 +3917,7 @@ function gridProblem(footprint, cellsPerTile = CELLS_PER_TILE) {
3912
3917
  if (gridCanvas(footprint, cellsPerTile) !== null) return null;
3913
3918
  const side = Math.floor(ROUTE_MAX_EDGE / (cellsPerTile * MIN_CELL));
3914
3919
  const area = Math.floor(ROUTE_MAX_PIXELS / (cellsPerTile * MIN_CELL) ** 2);
3915
- return `a ${footprint.cols}×${footprint.rows} tile object is too large to draw on the grid: at most ${side} tiles on a side and ${area} tiles in all`;
3920
+ return `a ${footprint.cols}×${footprint.rows} tile object is too large to draw on the grid: at most ${side} tile${side === 1 ? "" : "s"} on a side and ${area} tile${area === 1 ? "" : "s"} in all`;
3916
3921
  }
3917
3922
  function designCanvas(tiles) {
3918
3923
  if (!Number.isInteger(tiles.cols) || !Number.isInteger(tiles.rows) || tiles.cols < 1 || tiles.rows < 1) return null;
@@ -4590,7 +4595,7 @@ const move = {
4590
4595
  );
4591
4596
  }
4592
4597
  };
4593
- const version = "0.37.0";
4598
+ const version = "0.38.1";
4594
4599
  const manifest = {
4595
4600
  version
4596
4601
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelvibing/cli",
3
- "version": "0.37.0",
3
+ "version": "0.38.1",
4
4
  "description": "PixelVibing: pixel art game assets from the command line, and the Skills that teach coding assistants to make them.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://pixelvibing.com",