@looop-games/cli 0.1.22 → 0.1.23

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.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,16 @@ Versions: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [0.1.23] - 2026-08-01
18
+
19
+ ### Changed
20
+
21
+ - When the platform refuses an engine download because the Engine License has
22
+ been updated, `looop dev` and `looop update` now explain why and open the
23
+ sign-in flow for you — review and accept in the browser, and the download
24
+ continues by itself. No more bare HTTP status codes, no manual
25
+ `looop login`.
26
+
17
27
  ## [0.1.22] - 2026-08-01
18
28
 
19
29
  ### Added
package/lib/engine.mjs CHANGED
@@ -112,7 +112,26 @@ export async function ensureEngine(
112
112
  const cached = join(cache, `engine-${pin}.tgz`);
113
113
  if (!existsSync(cached)) {
114
114
  log(`Downloading engine ${pin} from ${apiBase}…`);
115
- const res = await fetchImpl(`${apiBase}/api/creator/engine/${pin}`, { headers: auth });
115
+ const dlUrl = `${apiBase}/api/creator/engine/${pin}`;
116
+ let res = await fetchImpl(dlUrl, { headers: auth });
117
+ // 403 = the token is fine but the platform refuses with a reason the
118
+ // human must act on — today, an updated Engine License that needs
119
+ // re-accepting. The acceptance IS the browser approval step of the device
120
+ // flow, so run the flow right here instead of asking the human to type
121
+ // `looop login` themselves (the click in the browser is still theirs to
122
+ // make), then retry once with the fresh token. If the platform still says
123
+ // no, surface its words — never loop.
124
+ if (res.status === 403) {
125
+ const reason = (await res.json().catch(() => null))?.error;
126
+ log(reason || 'The platform refused the engine download — your sign-in needs a refresh.');
127
+ log('Opening the sign-in flow to sort that out…');
128
+ await loginFn({ apiBase, log });
129
+ res = await fetchImpl(dlUrl, { headers: { Authorization: `Bearer ${getToken()}` } });
130
+ if (res.status === 403) {
131
+ const still = (await res.json().catch(() => null))?.error;
132
+ throw new Error(still || reason || 'the platform refused the engine download (HTTP 403).');
133
+ }
134
+ }
116
135
  if (res.status === 401) throw new Error('the platform rejected this machine’s token — run `looop login` again.');
117
136
  if (res.status === 404) throw new Error(`engine ${pin} is not downloadable — check the \`looop.engine\` pin in package.json.`);
118
137
  if (!res.ok) throw new Error(`engine download failed (HTTP ${res.status})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@looop-games/cli",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "Looop game development CLI — dev server, login, and publishing for standalone Looop games.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",