@tokenoftrust/cli 1.2.3 → 1.2.4

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": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Token of Trust developer CLI — check out 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",
@@ -227,6 +227,17 @@ export function deriveUrl(cfg, port) {
227
227
  return { domain, url: `http://localhost:${port}/${domain ? `${domain}/` : ""}` };
228
228
  }
229
229
 
230
+ /**
231
+ * The URL the developer should LAND on: the guided /dev cockpit, not the bare
232
+ * store root. The cockpit embeds a live preview of the store (so they still see
233
+ * it) PLUS the stepper, live Monitor, in-browser file tree/editor/diff, and
234
+ * click-to-source — the whole first-run experience. `deriveUrl().url` (the store
235
+ * root) stays the liveness-poll target (waitForServer); this is what we open + show.
236
+ */
237
+ export function cockpitUrl(baseUrl) {
238
+ return `${baseUrl}dev`;
239
+ }
240
+
230
241
  async function runNative(workspace, args, ctx) {
231
242
  const cfg = readWorkspaceConfig(workspace);
232
243
  if (!cfg) {
@@ -262,7 +273,7 @@ function bootNative(runnerDir, workspace, port, url, args) {
262
273
  .then((up) => {
263
274
  if (up && !opened) {
264
275
  opened = true;
265
- openBrowser(url);
276
+ openBrowser(cockpitUrl(url));
266
277
  }
267
278
  })
268
279
  .catch(() => {});
@@ -654,7 +665,7 @@ async function runContainer(workspace, args, ctx) {
654
665
  .then((up) => {
655
666
  if (up && !opened) {
656
667
  opened = true;
657
- openBrowser(plan.url);
668
+ openBrowser(cockpitUrl(plan.url));
658
669
  }
659
670
  })
660
671
  .catch(() => {});
@@ -731,7 +742,7 @@ export function buildContainerPlan(workspace, args, _ctx) {
731
742
  /** The crafted "here's your running store" block (Vite/`vercel dev`-grade). */
732
743
  export function printDevBanner(plan) {
733
744
  console.error(`\n tot dev — ${plan.tenant || "(tenant)"}`);
734
- console.error(` ➜ Local: ${plan.url}`);
745
+ console.error(` ➜ Local: ${cockpitUrl(plan.url)}`);
735
746
  console.error(` ➜ Edit: content/home.html + save → the browser reloads`);
736
747
  console.error(` ➜ Private local preview — nothing is published. Ctrl-C to stop.\n`);
737
748
  }
@@ -59,7 +59,7 @@ import { normalizeStores, storeListError, checkoutTenant } from "./checkout.mjs"
59
59
  import {
60
60
  buildContainerPlan, spawnDevContainer, dockerAvailable, tryStartDocker,
61
61
  resolveDevImage, isPrivateRegistryImage, ensureRegistryLogin,
62
- ensureRendererArtifact, ensureSampleRenderer, spawnNativeDev, deriveUrl,
62
+ ensureRendererArtifact, ensureSampleRenderer, spawnNativeDev, deriveUrl, cockpitUrl,
63
63
  NativeArtifactUnavailableError,
64
64
  } from "./dev.mjs";
65
65
  import { scaffoldSample, isSampleCheckout, sampleConfig, SAMPLE_DIR_NAME } from "../sample.mjs";
@@ -244,13 +244,13 @@ export async function run(argv, ctx) {
244
244
  });
245
245
  }
246
246
  if (!args.noOpen) {
247
- openBrowser(url);
247
+ openBrowser(cockpitUrl(url));
248
248
  console.log(" ✓ opened your browser");
249
249
  }
250
250
 
251
251
  // 6. you're live (G) — end at the AI-wow, THEN offer the MCP (C). Print the
252
252
  // elapsed time (A3) so the "instant" claim is measured, not just felt.
253
- printLiveEnding(tenant, url, formatElapsed(Date.now() - startedAt));
253
+ printLiveEnding(tenant, cockpitUrl(url), formatElapsed(Date.now() - startedAt));
254
254
  if (!args.noConnect) {
255
255
  const yes = args.yes || (await promptYesNo(" Connect Claude for AI editing?", true));
256
256
  if (yes) connectClaude();
@@ -317,12 +317,12 @@ async function runSampleStart(args, ctx, env, startedAt) {
317
317
  });
318
318
  }
319
319
  if (!args.noOpen) {
320
- openBrowser(url);
320
+ openBrowser(cockpitUrl(url));
321
321
  console.log(" ✓ opened your browser");
322
322
  }
323
323
 
324
324
  // You're live — the FREE preview. End on the MCP upsell (the whole point).
325
- printSampleLiveEnding(url, formatElapsed(Date.now() - startedAt));
325
+ printSampleLiveEnding(cockpitUrl(url), formatElapsed(Date.now() - startedAt));
326
326
  if (!args.noConnect) {
327
327
  const yes = args.yes || (await promptYesNo(" Connect the ToT MCP for your real store + AI editing?", true));
328
328
  if (yes) connectClaude();