@vincentt-xr/cli 0.1.5 → 0.2.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/README.md +94 -0
- package/dist/cli/args.d.ts +13 -0
- package/dist/cli/args.js +41 -0
- package/dist/cli/index.js +362 -92
- package/dist/lib/backend.d.ts +45 -5
- package/dist/lib/backend.js +99 -18
- package/dist/lib/diagnostics.d.ts +27 -2
- package/dist/lib/diagnostics.js +73 -8
- package/dist/lib/initCommand.d.ts +14 -0
- package/dist/lib/initCommand.js +75 -0
- package/dist/lib/lifecycle.d.ts +73 -15
- package/dist/lib/lifecycle.js +111 -114
- package/dist/lib/org.d.ts +29 -0
- package/dist/lib/org.js +45 -0
- package/dist/lib/projects.d.ts +82 -0
- package/dist/lib/projects.js +217 -0
- package/dist/lib/relayInfo.d.ts +41 -3
- package/dist/lib/relayInfo.js +94 -0
- package/dist/lib/whoami.d.ts +11 -0
- package/dist/lib/whoami.js +38 -0
- package/dist/login/authBackend.d.ts +30 -0
- package/dist/login/authBackend.js +80 -0
- package/dist/login/guard.d.ts +13 -0
- package/dist/login/guard.js +17 -0
- package/dist/login/loginCommand.d.ts +39 -0
- package/dist/login/loginCommand.js +72 -0
- package/dist/login/pkce.d.ts +47 -0
- package/dist/login/pkce.js +106 -0
- package/dist/login/pkceLogin.d.ts +53 -0
- package/dist/login/pkceLogin.js +152 -0
- package/dist/mcp/server.js +47 -20
- package/dist/preview/api.d.ts +84 -0
- package/dist/preview/api.js +174 -0
- package/dist/preview/command.d.ts +96 -0
- package/dist/preview/command.js +276 -0
- package/dist/preview/copy.d.ts +209 -0
- package/dist/preview/copy.js +444 -0
- package/dist/preview/index.d.ts +2 -3
- package/dist/preview/index.js +5 -6
- package/dist/preview/proxy.d.ts +12 -1
- package/dist/preview/proxy.js +17 -7
- package/dist/preview/qr.d.ts +30 -0
- package/dist/preview/qr.js +89 -0
- package/dist/preview/runner.d.ts +155 -30
- package/dist/preview/runner.js +219 -68
- package/dist/preview/stream.d.ts +52 -0
- package/dist/preview/stream.js +171 -0
- package/dist/preview/viewers.d.ts +113 -0
- package/dist/preview/viewers.js +242 -0
- package/dist/relay/server.d.ts +32 -0
- package/dist/relay/server.js +80 -12
- package/dist/relay/store.d.ts +32 -3
- package/dist/relay/store.js +76 -22
- package/dist/relay/testers.d.ts +90 -0
- package/dist/relay/testers.js +144 -0
- package/dist/shared/authError.d.ts +1 -0
- package/dist/shared/authError.js +11 -0
- package/dist/shared/config.d.ts +73 -5
- package/dist/shared/config.js +133 -20
- package/package.json +2 -3
- package/dist/login/login.d.ts +0 -34
- package/dist/login/login.js +0 -148
- package/dist/preview/cloudflared.d.ts +0 -13
- package/dist/preview/cloudflared.js +0 -46
- package/dist/preview/tunnel.d.ts +0 -14
- 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,13 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* The bare arguments, with flag VALUES removed. Without this, `vincentt link --dir
|
|
10
|
+
* /tmp 66f1` reads `/tmp` as the project id — a wrong-but-plausible value, which is
|
|
11
|
+
* the worst kind for an identifier that decides which project a folder points at.
|
|
12
|
+
*/
|
|
13
|
+
export declare function positionalArgs(args: string[]): string[];
|
package/dist/cli/args.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
"--help",
|
|
22
|
+
"-h",
|
|
23
|
+
]);
|
|
24
|
+
/**
|
|
25
|
+
* The bare arguments, with flag VALUES removed. Without this, `vincentt link --dir
|
|
26
|
+
* /tmp 66f1` reads `/tmp` as the project id — a wrong-but-plausible value, which is
|
|
27
|
+
* the worst kind for an identifier that decides which project a folder points at.
|
|
28
|
+
*/
|
|
29
|
+
export function positionalArgs(args) {
|
|
30
|
+
const out = [];
|
|
31
|
+
for (let i = 0; i < args.length; i++) {
|
|
32
|
+
const a = args[i];
|
|
33
|
+
if (!a.startsWith("-")) {
|
|
34
|
+
out.push(a);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (!BOOLEAN_FLAGS.has(a) && !a.includes("="))
|
|
38
|
+
i++;
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|