@genex-ai/cli-demo 0.49.0-dev.93 → 0.50.0-dev.95

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 (2) hide show
  1. package/dist/index.js +18 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1551,6 +1551,12 @@ function contentCommit(files) {
1551
1551
  }
1552
1552
  return h.digest("hex");
1553
1553
  }
1554
+ function retryAfterHint(res) {
1555
+ const raw = Number(res.headers.get("retry-after"));
1556
+ if (!Number.isFinite(raw) || raw <= 0) return "";
1557
+ const secs = Math.ceil(raw);
1558
+ return ` Try again in ${secs < 90 ? `${secs}s` : `~${Math.ceil(secs / 60)} min`}.`;
1559
+ }
1554
1560
  async function getUploadToken(ctx, commit, log) {
1555
1561
  let res;
1556
1562
  try {
@@ -1573,6 +1579,10 @@ async function getUploadToken(ctx, commit, log) {
1573
1579
  log.plain(" Fix: run `genex link <your-game>` and sign in as the OWNER account, then re-run this command.");
1574
1580
  return null;
1575
1581
  }
1582
+ if (res.status === 429) {
1583
+ log.error(`Rate limited requesting an upload token (HTTP 429).${retryAfterHint(res)}`);
1584
+ return null;
1585
+ }
1576
1586
  if (!res.ok) {
1577
1587
  log.error(`Couldn't get an upload token (HTTP ${res.status}).`);
1578
1588
  return null;
@@ -1628,6 +1638,10 @@ async function callPublish(ctx, commit, opts, log) {
1628
1638
  log.error(`Couldn't reach the API at ${ctx.apiUrl}: ${String(err)}`);
1629
1639
  return false;
1630
1640
  }
1641
+ if (res.status === 429) {
1642
+ log.error(`Rate limited publishing (HTTP 429).${retryAfterHint(res)}`);
1643
+ return false;
1644
+ }
1631
1645
  if (!res.ok) {
1632
1646
  const detail = await res.text().catch(() => "");
1633
1647
  log.error(`Publish failed (HTTP ${res.status})${detail ? `: ${detail}` : ""}.`);
@@ -1731,6 +1745,10 @@ async function fetchPushUrl(ctx, log) {
1731
1745
  log.error("Not authorized \u2014 your token may have expired. Re-run `genex init`.");
1732
1746
  return null;
1733
1747
  }
1748
+ if (res.status === 429) {
1749
+ log.error(`Rate limited authorizing the source push (HTTP 429).${retryAfterHint(res)}`);
1750
+ return null;
1751
+ }
1734
1752
  if (!res.ok) {
1735
1753
  log.error(`Couldn't authorize the source push (HTTP ${res.status}).`);
1736
1754
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/cli-demo",
3
- "version": "0.49.0-dev.93",
3
+ "version": "0.50.0-dev.95",
4
4
  "description": "Set up your ~/.claude workspace, authorize, create a game project, generate AI assets, and publish (genex CLI).",
5
5
  "type": "module",
6
6
  "bin": {