@vincentt-xr/cli 0.1.5 → 0.3.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.
Files changed (92) hide show
  1. package/README.md +94 -0
  2. package/dist/cli/args.d.ts +14 -0
  3. package/dist/cli/args.js +51 -0
  4. package/dist/cli/index.js +416 -100
  5. package/dist/lib/backend.d.ts +44 -20
  6. package/dist/lib/backend.js +98 -51
  7. package/dist/lib/diagnostics.d.ts +27 -2
  8. package/dist/lib/diagnostics.js +73 -8
  9. package/dist/lib/initCommand.d.ts +14 -0
  10. package/dist/lib/initCommand.js +75 -0
  11. package/dist/lib/lifecycle.d.ts +85 -19
  12. package/dist/lib/lifecycle.js +133 -130
  13. package/dist/lib/org.d.ts +29 -0
  14. package/dist/lib/org.js +45 -0
  15. package/dist/lib/projects.d.ts +82 -0
  16. package/dist/lib/projects.js +217 -0
  17. package/dist/lib/relayInfo.d.ts +41 -3
  18. package/dist/lib/relayInfo.js +94 -0
  19. package/dist/lib/whoami.d.ts +11 -0
  20. package/dist/lib/whoami.js +38 -0
  21. package/dist/login/authBackend.d.ts +30 -0
  22. package/dist/login/authBackend.js +80 -0
  23. package/dist/login/guard.d.ts +13 -0
  24. package/dist/login/guard.js +17 -0
  25. package/dist/login/loginCommand.d.ts +39 -0
  26. package/dist/login/loginCommand.js +72 -0
  27. package/dist/login/pkce.d.ts +47 -0
  28. package/dist/login/pkce.js +106 -0
  29. package/dist/login/pkceLogin.d.ts +53 -0
  30. package/dist/login/pkceLogin.js +152 -0
  31. package/dist/mcp/server.js +52 -25
  32. package/dist/preview/api.d.ts +84 -0
  33. package/dist/preview/api.js +174 -0
  34. package/dist/preview/command.d.ts +96 -0
  35. package/dist/preview/command.js +276 -0
  36. package/dist/preview/copy.d.ts +209 -0
  37. package/dist/preview/copy.js +444 -0
  38. package/dist/preview/index.d.ts +2 -3
  39. package/dist/preview/index.js +5 -6
  40. package/dist/preview/proxy.d.ts +12 -1
  41. package/dist/preview/proxy.js +17 -7
  42. package/dist/preview/qr.d.ts +30 -0
  43. package/dist/preview/qr.js +89 -0
  44. package/dist/preview/runner.d.ts +155 -30
  45. package/dist/preview/runner.js +219 -68
  46. package/dist/preview/stream.d.ts +52 -0
  47. package/dist/preview/stream.js +171 -0
  48. package/dist/preview/viewers.d.ts +113 -0
  49. package/dist/preview/viewers.js +242 -0
  50. package/dist/publish/api.d.ts +67 -0
  51. package/dist/publish/api.js +96 -0
  52. package/dist/publish/bounds.d.ts +25 -0
  53. package/dist/publish/bounds.js +53 -0
  54. package/dist/publish/classify.d.ts +51 -0
  55. package/dist/publish/classify.js +138 -0
  56. package/dist/publish/command.d.ts +27 -0
  57. package/dist/publish/command.js +328 -0
  58. package/dist/publish/consoleVerbs.d.ts +17 -0
  59. package/dist/publish/consoleVerbs.js +26 -0
  60. package/dist/publish/copy.d.ts +180 -0
  61. package/dist/publish/copy.js +606 -0
  62. package/dist/publish/defaults.d.ts +16 -0
  63. package/dist/publish/defaults.js +52 -0
  64. package/dist/publish/manifest.d.ts +27 -0
  65. package/dist/publish/manifest.js +81 -0
  66. package/dist/publish/paths.d.ts +25 -0
  67. package/dist/publish/paths.js +78 -0
  68. package/dist/publish/progress.d.ts +17 -0
  69. package/dist/publish/progress.js +45 -0
  70. package/dist/publish/prompt.d.ts +4 -0
  71. package/dist/publish/prompt.js +31 -0
  72. package/dist/publish/qa.f4.fixtures.d.ts +25 -0
  73. package/dist/publish/qa.f4.fixtures.js +140 -0
  74. package/dist/publish/upload.d.ts +30 -0
  75. package/dist/publish/upload.js +93 -0
  76. package/dist/relay/server.d.ts +32 -0
  77. package/dist/relay/server.js +80 -12
  78. package/dist/relay/store.d.ts +32 -3
  79. package/dist/relay/store.js +76 -22
  80. package/dist/relay/testers.d.ts +90 -0
  81. package/dist/relay/testers.js +144 -0
  82. package/dist/shared/authError.d.ts +1 -0
  83. package/dist/shared/authError.js +11 -0
  84. package/dist/shared/config.d.ts +73 -5
  85. package/dist/shared/config.js +133 -20
  86. package/package.json +2 -3
  87. package/dist/login/login.d.ts +0 -34
  88. package/dist/login/login.js +0 -148
  89. package/dist/preview/cloudflared.d.ts +0 -13
  90. package/dist/preview/cloudflared.js +0 -46
  91. package/dist/preview/tunnel.d.ts +0 -14
  92. package/dist/preview/tunnel.js +0 -28
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # @vincentt-xr/cli — `vincentt`
2
+
3
+ The command-line dev loop for building AR/XR apps on Vincentt. You build a real
4
+ React + react-three-fiber app locally with your own coding agent (Claude Code,
5
+ Cursor, Codex) and this CLI drives the platform side: scaffold a project, preview
6
+ it on a phone over a secure tunnel, read what the device reports back, and publish
7
+ to `<slug>.vincentt.app`.
8
+
9
+ Only prerequisite: Node.js (which provides `npx`). Nothing is installed globally.
10
+
11
+ ## Getting started (read this before running anything)
12
+
13
+ If you are a coding agent that was asked to build a Vincentt AR app, follow this
14
+ order. It matters:
15
+
16
+ 1. **Confirm a project name with the developer first.** Do not guess one, and do
17
+ not run `create` until you have it. The name becomes the live subdomain
18
+ (`<slug>.vincentt.app`), so it is worth one question.
19
+
20
+ 2. **Scaffold the project:**
21
+
22
+ ```
23
+ npx -y @vincentt-xr/cli@latest create --name "<name>"
24
+ ```
25
+
26
+ Run it in an empty directory. This binds a backend project and writes a
27
+ complete, runnable starter (an AR app that previews as-is). If you are not
28
+ signed in yet, the command opens a browser for the developer to approve once,
29
+ then continues. That is the only human step.
30
+
31
+ 3. **Read `AGENTS.md` in the new project, then stop.** The scaffold is already a
32
+ working starter. **Do not invent an app or start building a scene.** Tell the
33
+ developer the project is ready and ask what they want to make. Build only once
34
+ they have described it.
35
+
36
+ 4. **When you start building,** `AGENTS.md` and `GROUNDING.md` (both in the
37
+ project root) are the authoritative guides for the dev loop and the SDK API.
38
+ Read the SDK reference at the point you write a scene, not before.
39
+
40
+ The short version: **ask for a name, scaffold, confirm it is ready, wait for the
41
+ idea.** Everything after first contact is driven from the project's own
42
+ `AGENTS.md`.
43
+
44
+ ## Commands
45
+
46
+ ```
47
+ Auth
48
+ login Sign in; save an access token to ~/.vincentt/config.json
49
+ logout Remove the saved access token
50
+ whoami Show the signed-in account
51
+
52
+ Dev loop
53
+ create Scaffold + bind a project (empty dir -> full starter)
54
+ [--name <s>] [--slug <s>] [--preview] [--force]
55
+ publish Upload the built dist; go live at <slug>.vincentt.app
56
+ preview Serve + tunnel the app for on-device preview
57
+ (prints a desktop QR page to scan) [--stop]
58
+ unbind Detach this directory from its project
59
+
60
+ Diagnostics (need a running preview)
61
+ logs [--errors] Console logs from the device [--json]
62
+ network fetch/XHR requests [--json]
63
+ trace Performance samples [--json]
64
+
65
+ Reverse channel
66
+ feedback --wait Block for the next phone annotation, print it, exit
67
+ feedback --watch Stream annotations as they arrive
68
+
69
+ Servers
70
+ relay Run the diagnostics/annotation relay
71
+ mcp Run the MCP adapter (for hosts without a shell)
72
+
73
+ Common options: --dir <path> (project dir, default cwd)
74
+ ```
75
+
76
+ Auth-needing verbs (`create`, `preview`, `publish`) fold sign-in into the first
77
+ run: with no saved token they open the browser to authorize this device, then the
78
+ token lives in `~/.vincentt/config.json` and later verbs run without prompting.
79
+
80
+ ## The loop, once a project exists
81
+
82
+ - `pnpm dev` — local dev server at `http://localhost:5173`.
83
+ - `npx vincentt preview` — build, serve, and tunnel the app so you get one `https`
84
+ URL (and a desktop QR page) to open on a phone. AR needs a secure context for
85
+ camera access, so this is how you test tracking and gestures on a device.
86
+ - `npx vincentt logs | network | trace` — read what the phone reported to the
87
+ preview relay. Debug on-device misbehavior instead of guessing.
88
+ - `npx vincentt feedback --wait` — block for the next annotation the developer
89
+ draws on the phone preview, print it as JSON, and exit.
90
+ - `npx vincentt publish` — build (`pnpm build`), then upload the built `dist/` and
91
+ return the live `<slug>.vincentt.app` URL. Nothing builds server-side.
92
+
93
+ `vincentt` is a project devDependency in the scaffold, so invoke it as
94
+ `npx vincentt <verb>` and it resolves to the local copy — no global install.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * True when the invocation is a request for help rather than an action — no
3
+ * command, or `--help`/`-h` anywhere in the args. The dispatcher checks this
4
+ * BEFORE routing to a verb so that `login --help`, `create --help`, etc. print
5
+ * usage instead of running the (side-effectful) verb.
6
+ */
7
+ export declare function isHelpInvocation(args: string[]): boolean;
8
+ export declare function refusedFlag(args: string[]): string | undefined;
9
+ /**
10
+ * The bare arguments, with flag VALUES removed. Without this, `vincentt link --dir
11
+ * /tmp 66f1` reads `/tmp` as the project id — a wrong-but-plausible value, which is
12
+ * the worst kind for an identifier that decides which project a folder points at.
13
+ */
14
+ export declare function positionalArgs(args: string[]): string[];
@@ -0,0 +1,51 @@
1
+ /**
2
+ * True when the invocation is a request for help rather than an action — no
3
+ * command, or `--help`/`-h` anywhere in the args. The dispatcher checks this
4
+ * BEFORE routing to a verb so that `login --help`, `create --help`, etc. print
5
+ * usage instead of running the (side-effectful) verb.
6
+ */
7
+ export function isHelpInvocation(args) {
8
+ return args[0] === undefined || args.includes("--help") || args.includes("-h");
9
+ }
10
+ /** Flags that stand alone; every other `--flag` consumes the next argument. */
11
+ const BOOLEAN_FLAGS = new Set([
12
+ "--force",
13
+ "--preview",
14
+ "--json",
15
+ "--errors",
16
+ "--wait",
17
+ "--watch",
18
+ "--stop",
19
+ "--no-install",
20
+ "--allow-custom-api",
21
+ "--yes",
22
+ "--help",
23
+ "-h",
24
+ ]);
25
+ /**
26
+ * Flags the CLI deliberately does NOT have. The checklist reports and never
27
+ * writes: a suggested value is one keystroke from a tool that writes it, and
28
+ * writing to the creator's source is a named boundary.
29
+ */
30
+ const REFUSED_FLAGS = new Set(["--fix", "--write-meta"]);
31
+ export function refusedFlag(args) {
32
+ return args.find((a) => REFUSED_FLAGS.has(a.split("=")[0]));
33
+ }
34
+ /**
35
+ * The bare arguments, with flag VALUES removed. Without this, `vincentt link --dir
36
+ * /tmp 66f1` reads `/tmp` as the project id — a wrong-but-plausible value, which is
37
+ * the worst kind for an identifier that decides which project a folder points at.
38
+ */
39
+ export function positionalArgs(args) {
40
+ const out = [];
41
+ for (let i = 0; i < args.length; i++) {
42
+ const a = args[i];
43
+ if (!a.startsWith("-")) {
44
+ out.push(a);
45
+ continue;
46
+ }
47
+ if (!BOOLEAN_FLAGS.has(a) && !a.includes("="))
48
+ i++;
49
+ }
50
+ return out;
51
+ }