@m-kopa/launchpad-cli 0.43.0 → 0.44.0

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
@@ -6,6 +6,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
  This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
7
7
  pre-1.0 minor bumps may carry breaking changes per ADR 0005.
8
8
 
9
+ ## 0.44.0 — 2026-07-05
10
+
11
+ **Identity guide crystal-clarity — fixes the "gateway signs me in but the app
12
+ says not signed in" class.** The `/launchpad-identity` skill told authors to read
13
+ `GATEWAY_ISSUER / GATEWAY_AUD / GATEWAY_JWKS_URL` and (wrongly) that those are
14
+ "what is live on Cloudflare" — but the platform engine actually provisions the
15
+ gateway verifier values under the legacy names `CF_ACCESS_TEAM_DOMAIN /
16
+ CF_ACCESS_AUD / JWKS_URL` for a `react+api` app. An app that followed the guide
17
+ read only `GATEWAY_*`, found them undefined, and silently fail-closed every user
18
+ to anonymous.
19
+
20
+ - **Skill verifier snippet now reads BOTH name sets via `||`** (`GATEWAY_ISSUER
21
+ || CF_ACCESS_TEAM_DOMAIN`, etc.) — copy it and you are immune to the mismatch
22
+ whichever set your project carries.
23
+ - **Corrected the false "GATEWAY_* are live on Cloudflare" claim**; added an
24
+ explicit two-convention name table, a gateway-vs-Cloudflare-Access note (the
25
+ issuer is `auth.launchpad.m-kopa.us`, **not** `*.cloudflareaccess.com`), the
26
+ bare-host `aud` rule, and the `secret_text` + same-deploy/redeploy requirement.
27
+ - **`docs/guide/auth.md`**: banner correcting the gateway `/api/me` shape — it
28
+ carries `sub`/`email`/`name` only (**no `groups`** — never authorise from it),
29
+ and fail-closed is `200 {authenticated:false}`, not `401`.
30
+ - **`@m-kopa/platform-auth` `types.ts`**: fixed the docstring that claimed
31
+ `preferredUsername` comes from a `preferred_username` claim — the runtime reads
32
+ the `email` claim (the IdP maps the Entra UPN into it).
33
+
9
34
  ## 0.43.0 — 2026-07-05
10
35
 
11
36
  **`launchpad deploy` now shows a pre-deploy config diff (PS-1920).** Before a
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
20
 
21
21
  // src/version.ts
22
- var CLI_VERSION = "0.43.0";
22
+ var CLI_VERSION = "0.44.0";
23
23
 
24
24
  // src/config.ts
25
25
  import * as os from "node:os";
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const CLI_VERSION = "0.43.0";
1
+ export declare const CLI_VERSION = "0.44.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m-kopa/launchpad-cli",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "Launchpad CLI — clone / deploy / review / merge against Launchpad-managed apps. Talks to the portal-bot endpoints (SCOPE-M-760 / T4).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-content-pr
3
3
  description: Push a content change to a Launchpad app via `launchpad deploy` and verify it shipped via `launchpad status`. Covers the post-first-deploy iteration loop (edit → deploy → verify) — subsequent deploys commit directly to the app repo's main and the Pages build runs asynchronously, so verification is its own step. Use when someone says "push a content change", "ship an update", "/launchpad-content-pr", "verify my deploy", or after `/launchpad-deploy` reports `done` and they want to follow up with an edit.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-deploy
3
3
  description: Walk a Launchpad user through deploying an app from their local working directory (Model A — `launchpad init` + `launchpad deploy`). Wraps the CLI verbs end-to-end: detects the app shape, scaffolds `launchpad.yaml`, resolves the allowed Entra group via `launchpad groups`, bundles the CWD via `launchpad deploy`, and watches the rollout via `launchpad status`. Use when someone says "deploy a new app", "ship my app to Launchpad", "/launchpad-deploy", "I have an app locally — get it on Launchpad", or any variant. Resume/abandon for legacy in-flight provisioning is at the bottom.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-deploy-status
3
3
  description: Show the current provisioning stage + failure reason for a Launchpad app via `launchpad status` (Model A drift + deployment_verified) and `launchpad apps` (lifecycle bucket), or watch provisioning live with `launchpad watch`. Renders the M-892 stage trace for in-flight provisioning, and is the canonical home for `launchpad recover` (repair a terminal-failed app record that is actually live). Use when someone says "what's the status of demo-X", "/launchpad-deploy-status", "is my deploy stuck", "watch my deploy go live", "watch provisioning", "my app says failed but it's serving", or after `/launchpad-deploy` reports a non-`done` terminal stage.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-destroy
3
3
  description: Tear down a Launchpad app end-to-end via `launchpad destroy` — Cloudflare Pages project, edge-auth wiring (gateway KV/audience entries, or the Access app for `auth: access` apps), custom hostname, platform-repo TF, and the app repo (archive-renamed). Owner-only verb with a two-step destructive confirmation. Use when someone says "destroy this app", "/launchpad-destroy", "tear down `<slug>`", "delete the app", or asks to clean up a smoke-test / orphan / retired app.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-identity
3
3
  description: Teach an app author how to use the signed-in user's identity inside a Launchpad app — read the gateway-forwarded X-Launchpad-User-Assertion in a Pages Function, VERIFY it with @m-kopa/platform-auth (fail-closed), and show who's logged in (sub/email/name). Use when someone says "who is logged in", "show the current user", "get the user's email in my app", "auth in my launchpad app", "read the user identity", "/launchpad-identity", or is wiring up an /api/me for a gateway-fronted app.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
@@ -130,10 +130,17 @@ export async function onRequestGet(context) {
130
130
  const token = request.headers.get(IDENTITY_HEADER);
131
131
  if (!token) return anonymous(); // no token → anonymous / public path
132
132
 
133
- const issuer = env.GATEWAY_ISSUER; // gateway iss
134
- const audience = env.GATEWAY_AUD; // this app's aud (pin to YOUR host)
133
+ // Read BOTH the canonical GATEWAY_* names AND the legacy CF_ACCESS_* / JWKS_URL
134
+ // names the platform engine currently provisions for react+api apps (identical
135
+ // gateway values, older key names). Tolerating both via `||` is what keeps this
136
+ // verifier working no matter which set your app was scaffolded with — skipping
137
+ // the fallback is the #1 cause of "gateway signs me in but the app says not
138
+ // signed in". See "Required env vars" below.
139
+ const issuer = env.GATEWAY_ISSUER || env.CF_ACCESS_TEAM_DOMAIN; // gateway iss
140
+ const audience = env.GATEWAY_AUD || env.CF_ACCESS_AUD; // this app's aud (your host)
135
141
  const jwksUrl =
136
142
  env.GATEWAY_JWKS_URL ||
143
+ env.JWKS_URL ||
137
144
  (issuer ? `${issuer.replace(/\/$/, '')}/.well-known/jwks.json` : null);
138
145
 
139
146
  // Misconfigured verify env → fail CLOSED. Never trust an unverifiable token.
@@ -227,30 +234,56 @@ vars — is identical to the example above.
227
234
 
228
235
  ## Required env vars — `secret_text`, MANDATORY
229
236
 
230
- Verification needs three env vars on your app. **Set them as `secret_text`,
231
- not plain text:**
237
+ Verification needs three values on your app: the gateway **issuer**, **your
238
+ app's audience**, and the **JWKS URL**. Two things trip people up — a value
239
+ gotcha and a name gotcha. Read both.
232
240
 
233
- | Var | Value | Notes |
241
+ **The value contract (identical whichever key names you use):**
242
+
243
+ | Value | Set it to | Notes |
244
+ |---|---|---|
245
+ | issuer (`iss`) | `https://auth.launchpad.m-kopa.us` | the gateway token issuer — the **same for every app** |
246
+ | audience (`aud`) | `<your-slug>.launchpad.m-kopa.us` | **your app's bare public host** — no `https://`, no port, no trailing slash. Exact-match replay guard: a wrong value fails closed. |
247
+ | jwks | `https://auth.launchpad.m-kopa.us/.well-known/jwks.json` | optional — derived from the issuer if unset |
248
+
249
+ **The name gotcha — read BOTH name sets.** There are currently **two** key-name
250
+ conventions for these same three values, and which one your app has depends on
251
+ how it was created:
252
+
253
+ | Convention | Keys | Where it comes from |
234
254
  |---|---|---|
235
- | `GATEWAY_ISSUER` | `https://auth.launchpad.m-kopa.us` | the gateway token issuer (`iss`) |
236
- | `GATEWAY_AUD` | `<your-slug>.launchpad.m-kopa.us` | **your app's** audience (`aud`)the replay guard |
237
- | `GATEWAY_JWKS_URL` | `https://auth.launchpad.m-kopa.us/.well-known/jwks.json` | optional — derived from `GATEWAY_ISSUER` if unset |
238
-
239
- > ⚠️ **Why `secret_text` is mandatory the wipe fail-closed chain.** If you
240
- > set these as **plain-text** env, the next `launchpad deploy` **wipes them**
241
- > (only `secret_text` vars survive a deploy the CF-Access-env-vars-must-ship
242
- > runbook). With the env gone, `issuer`/`audience` are `undefined`, the
243
- > `if (!jwksUrl || !issuer || !audience) return anonymous()` guard fires, and
244
- > **every** user silently goes anonymous in production. The code is correct
245
- > it fails *closed*, never open but identity is dark until you re-add the
246
- > vars. Set them `secret_text` from the start and this never happens. Ship the
247
- > env in the **same** deploy as the consumer, or verification is dark.
248
-
249
- The canonical names are **`GATEWAY_ISSUER` / `GATEWAY_AUD` / `GATEWAY_JWKS_URL`**
250
- what the deployed app reads and what is live on Cloudflare. (You may see the
251
- illustrative names `AUTH_ISS` / `APP_AUD` / `JWKS_URL` in older contract-doc
252
- snippets the deployed convention is the `GATEWAY_*` set; use it. Note: it is
253
- `GATEWAY_AUD`, **not** `GATEWAY_AUDIENCE`.)
255
+ | **Canonical** (this guide) | `GATEWAY_ISSUER` / `GATEWAY_AUD` / `GATEWAY_JWKS_URL` | the name set we are standardising on |
256
+ | **Legacy** (auto-provisioned) | `CF_ACCESS_TEAM_DOMAIN` / `CF_ACCESS_AUD` / `JWKS_URL` | **what the platform engine actually sets on a `react+api` app today** correct gateway values, older names (`per-app-workspace.ts`) |
257
+
258
+ > ⚠️ **Do NOT assume `GATEWAY_*` are "already live."** A `react+api` app
259
+ > scaffolded by the platform is born with the **`CF_ACCESS_*` / `JWKS_URL`**
260
+ > keys the engine reuses the pre-gateway Cloudflare-Access names for the
261
+ > gateway values. If your verifier reads **only** `GATEWAY_*`, those keys are
262
+ > `undefined`, the `if (!jwksUrl || !issuer || !audience) return anonymous()`
263
+ > guard fires, and **every** user silently goes anonymous: the gateway signs
264
+ > you in, but your app renders its own "not signed in" screen. **This is the #1
265
+ > cause of that symptom.** The verifier snippet above already reads both name
266
+ > sets via `||` keep the fallback and you are immune to the mismatch,
267
+ > whichever set your project carries.
268
+
269
+ > **This is the gateway, not Cloudflare Access.** Despite the name,
270
+ > `CF_ACCESS_TEAM_DOMAIN` here holds the **gateway** issuer
271
+ > `https://auth.launchpad.m-kopa.us` **not** a `*.cloudflareaccess.com`
272
+ > domain. Any doc that tells you to point the issuer at `cloudflareaccess.com`
273
+ > is describing the legacy Cloudflare-Access channel, not the
274
+ > `X-Launchpad-User-Assertion` gateway channel these apps use. (Also: it is
275
+ > `GATEWAY_AUD`, **not** `GATEWAY_AUDIENCE`; and ignore the illustrative
276
+ > `AUTH_ISS` / `APP_AUD` names in older contract-doc snippets.)
277
+
278
+ **Set them as `secret_text`, in the SAME deploy as the code that reads them.**
279
+
280
+ > ⚠️ **`secret_text` + same-deploy, or identity goes dark.** Plain-text env is
281
+ > silently dropped by Cloudflare Pages under partial-PATCH, and env only binds
282
+ > on a **new** deployment. So if you set the vars as plain-text, **or** push
283
+ > them *after* your last deploy, they are not live on the running deployment —
284
+ > `issuer`/`audience` are `undefined`, the fail-closed guard fires, and identity
285
+ > is dark until you re-add them `secret_text` and **redeploy**. Set them
286
+ > `secret_text` and ship them in the same `launchpad deploy` as the consumer.
254
287
 
255
288
  ## Anti-pattern — do NOT do this
256
289
 
@@ -276,8 +309,13 @@ An unverified payload can be forged by anyone who can reach your origin
276
309
  - [ ] **Fails closed** to anonymous on missing token, missing env, or any
277
310
  verify error — never returns the unverified user.
278
311
  - [ ] No unsigned `decodeJwtPayload` on the auth path.
279
- - [ ] `GATEWAY_ISSUER` / `GATEWAY_AUD` / `GATEWAY_JWKS_URL` set as
280
- **`secret_text`**, shipped in the **same** deploy.
312
+ - [ ] Verifier reads **both** name sets via `||` (`GATEWAY_ISSUER ||
313
+ CF_ACCESS_TEAM_DOMAIN`, etc.) so it works whichever set your app carries.
314
+ - [ ] Confirmed which env var **names** are actually live on your deployed
315
+ project (`CF_ACCESS_*` on an engine-scaffolded react+api app, `GATEWAY_*`
316
+ if you hand-set them), set as **`secret_text`**, shipped in the **same**
317
+ deploy — then `launchpad deploy` again if you added them after the last one.
318
+ - [ ] `aud` is your **bare host** (`<slug>.launchpad.m-kopa.us`), no scheme/port.
281
319
  - [ ] No authorization decision is made from `/api/me` — attribution only.
282
320
 
283
321
  ## Don'ts
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-onboard
3
3
  description: One-time setup for the Launchpad CLI + Claude Code skill bundle. Verifies the `launchpad` CLI is installed and current, runs `launchpad whoami` to confirm the session is fresh, and checks the bundled skills are installed and in lock-step with the CLI. Idempotent — safe to re-run any time. Use when someone says "set me up for Launchpad", "I just got a new machine and want to use Launchpad", "/launchpad-onboard", or any of the other launchpad-* skills fails on a prereq check.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-report
3
3
  description: File a bug report or feature request to the Launchpad team's tracker from the CLI. Use when someone reports something broken, hits an error in a launchpad command, or wishes a feature existed — e.g. "this is broken", "report a bug", "can you file that", "I wish launchpad could…", "/launchpad-bug", "/launchpad-feature". Always confirm and show exactly what you'll send before filing; never file silently.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: launchpad-status
3
3
  description: Show whether a Launchpad app's local launchpad.yaml matches what's deployed, and read the deployed manifest. Wraps `launchpad pull` (fetch deployed YAML) and `launchpad status` (drift report). Use when someone says "is my app in sync", "what's deployed", "show drift", "/launchpad-status", "/launchpad-pull", or after `launchpad deploy` to verify the change landed.
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  ---
6
6
 
7
7
  <!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->