@tokenoftrust/cli 5.0.0 → 6.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/cli",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Token of Trust",
@@ -113,6 +113,10 @@ export function normalizeReadiness(r) {
113
113
  return {
114
114
  ownerCapable: o.ownerCapable === true,
115
115
  ready: rd.ready === true,
116
+ // Absent is a worker that does not send the field yet: the store stays on
117
+ // the declared path. Only an explicit false is undeclared.
118
+ domainConnect: rd.domainConnect !== false,
119
+ nextStep: typeof rd.nextStep === "string" ? rd.nextStep : "",
116
120
  checks,
117
121
  blockedReasons: Array.isArray(rd.blockedReasons)
118
122
  ? rd.blockedReasons.filter((s) => typeof s === "string")
@@ -201,7 +205,11 @@ export function goLiveReadinessGate(readiness, action) {
201
205
 
202
206
  /** Render the readiness itemization — one ✓/✗ line per check + a headline. Pure. */
203
207
  export function renderReadiness({ appDomain, readiness, action }) {
204
- const lines = ["", ` Apex ${action === "rollback" ? "rollback" : "cutover"} readiness for ${appDomain ?? "this store"}:`];
208
+ const domainConnect = readiness.domainConnect === true;
209
+ const headline = !domainConnect && action === "connect"
210
+ ? `Publish readiness for ${appDomain ?? "this store"}:`
211
+ : `Apex ${action === "rollback" ? "rollback" : "cutover"} readiness for ${appDomain ?? "this store"}:`;
212
+ const lines = ["", ` ${headline}`];
205
213
  for (const c of readiness.checks) {
206
214
  lines.push(` ${c.ok ? "✓" : "✗"} ${c.label}${c.detail ? ` — ${c.detail}` : ""}`);
207
215
  // Blocked checks carry a "how to clear this" remedy from the server gate —
@@ -213,12 +221,18 @@ export function renderReadiness({ appDomain, readiness, action }) {
213
221
  "",
214
222
  ` Uncaptured images by type: ${readiness.imageTypes ? formatImageTypes(readiness.imageTypes) : "not recorded for the live bundle"}`,
215
223
  );
216
- lines.push(
217
- "",
218
- readiness.ready
219
- ? " All preconditions green — this cutover is permitted."
220
- : " Not ready — the failing preconditions above block the cutover.",
221
- );
224
+ lines.push("");
225
+ if (domainConnect) {
226
+ lines.push(
227
+ readiness.ready
228
+ ? " All preconditions green. Next: tot go-live --rehearsal."
229
+ : " Not ready — the failing preconditions above block the cutover.",
230
+ );
231
+ } else {
232
+ lines.push(
233
+ ` ${readiness.nextStep || "Apex connect is not available for this store. DNS stays with whoever holds the zone."}`,
234
+ );
235
+ }
222
236
  }
223
237
  return lines;
224
238
  }
@@ -279,6 +293,12 @@ export async function runGoLive(http, { appDomain, action, rehearsal, noOpen, dn
279
293
  const domain = appDomain || readiness.appDomain;
280
294
  for (const line of renderReadiness({ appDomain: domain, readiness, action })) console.log(line);
281
295
 
296
+ // A store that does not declare Connect apex has nothing to rehearse, confirm,
297
+ // or dispatch. Image rows above are the whole checklist. DNS stays with the zone holder.
298
+ if (readiness.domainConnect !== true) {
299
+ return readiness.ready ? 0 : 1;
300
+ }
301
+
282
302
  // 2. Gate — owner-only + (for connect) fail-closed on the readiness verdict.
283
303
  const gate = goLiveReadinessGate(readiness, action);
284
304
  if (gate.kind === "not-owner") {