@vincentt-xr/cli 0.10.0 → 0.11.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/dist/cli/index.js CHANGED
@@ -540,7 +540,7 @@ async function preview() {
540
540
  orgName: await activeOrgName(),
541
541
  targetUrl: `http://localhost:${running.appPort}`,
542
542
  url: running.url,
543
- consoleUrl: await projectConsoleUrl(cwd),
543
+ consoleUrl: await projectConsoleUrl(cwd, running.sessionId),
544
544
  qr,
545
545
  expiresInHours: 12,
546
546
  })) {
@@ -657,14 +657,26 @@ async function projectDisplayName(cwd) {
657
657
  * `consoleVerbCommand` deep-links to. The console redirects it to the org-scoped
658
658
  * address, so the CLI does not need the org slug and cannot print a stale one — a
659
659
  * folder can outlive the org binding the machine config happens to hold.
660
+ *
661
+ * `sessionId` deep-links PAST the project's default tab to the running preview
662
+ * itself (`?tab=preview&session=<id>`), which is the surface the creator is being
663
+ * handed this link to watch. Omitted when there is no session — the bare project
664
+ * page is right for `link`/`create`, and a session parameter naming nothing would
665
+ * land on an empty workspace.
660
666
  */
661
- async function projectConsoleUrl(cwd) {
667
+ async function projectConsoleUrl(cwd, sessionId) {
662
668
  const located = await locateProjectBinding(cwd);
663
669
  if (!located)
664
670
  return undefined;
665
671
  const cfg = await loadMachineConfig();
666
672
  const base = (cfg.consoleUrl ?? DEFAULT_CONSOLE_URL).replace(/\/$/, "");
667
- return `${base}/projects/${located.binding.projectId}`;
673
+ const url = `${base}/projects/${located.binding.projectId}`;
674
+ if (!sessionId)
675
+ return url;
676
+ // encodeURIComponent on BOTH: the ids are server-minted and hex today, and a
677
+ // future id shape carrying a reserved character must not become a second
678
+ // parameter.
679
+ return `${url}?tab=preview&session=${encodeURIComponent(sessionId)}`;
668
680
  }
669
681
  /**
670
682
  * Map a mint failure to its screen. Each cause has a DISTINCT first line so the
@@ -99,9 +99,18 @@ export declare function stopped(ranMs: number, totalConnections: number): string
99
99
  *
100
100
  * The claim is exactly what the wire supports: `stopped` is produced by one
101
101
  * route, authorized by the compound key {_id, userId}, so the actor is ALWAYS
102
- * the same account as the reader. Never a teammate, never an admin. It does not
103
- * say WHICH window, because another terminal, another machine and a future
104
- * console control are all the same 410.
102
+ * the same account as the reader. Never a teammate, never an admin.
103
+ *
104
+ * IT NAMES NO SURFACE, and that is the whole design of this screen. `endReason`
105
+ * carries ONE value for every actor on that route — this CLI's own stop, another
106
+ * terminal, another machine, the console's Stop control, and any surface added
107
+ * later. The API does not learn which one called and must not: deriving it would
108
+ * mean guessing a surface from a credential kind (a PAT-driven script is not "a
109
+ * terminal") and reporting the guess to the creator as fact. That is the
110
+ * over-claim class that produced the abandoned→hard_max defect.
111
+ *
112
+ * So the headline states only the event, and the second line describes the actor
113
+ * exactly as far as the compound key supports: the same account, not this window.
105
114
  *
106
115
  * `✓`, not `✗`: someone with the authority to stop it stopped it.
107
116
  */
@@ -205,16 +205,25 @@ export function stopped(ranMs, totalConnections) {
205
205
  *
206
206
  * The claim is exactly what the wire supports: `stopped` is produced by one
207
207
  * route, authorized by the compound key {_id, userId}, so the actor is ALWAYS
208
- * the same account as the reader. Never a teammate, never an admin. It does not
209
- * say WHICH window, because another terminal, another machine and a future
210
- * console control are all the same 410.
208
+ * the same account as the reader. Never a teammate, never an admin.
209
+ *
210
+ * IT NAMES NO SURFACE, and that is the whole design of this screen. `endReason`
211
+ * carries ONE value for every actor on that route — this CLI's own stop, another
212
+ * terminal, another machine, the console's Stop control, and any surface added
213
+ * later. The API does not learn which one called and must not: deriving it would
214
+ * mean guessing a surface from a credential kind (a PAT-driven script is not "a
215
+ * terminal") and reporting the guess to the creator as fact. That is the
216
+ * over-claim class that produced the abandoned→hard_max defect.
217
+ *
218
+ * So the headline states only the event, and the second line describes the actor
219
+ * exactly as far as the compound key supports: the same account, not this window.
211
220
  *
212
221
  * `✓`, not `✗`: someone with the authority to stop it stopped it.
213
222
  */
214
223
  export function stoppedElsewhere() {
215
224
  return [
216
225
  "",
217
- "✓ Preview stopped from another terminal. The link no longer works.",
226
+ "✓ Preview stopped. The link no longer works.",
218
227
  "",
219
228
  " It was stopped on your account, not by this window. Nothing is wrong here.",
220
229
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincentt-xr/cli",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Vincentt CLI — the vincentt command-line dev loop (login, create, publish, preview, diagnostics, feedback, relay)",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",