@vincentt-xr/cli 0.9.0 → 0.10.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 (52) hide show
  1. package/README.md +40 -13
  2. package/dist/cli/args.d.ts +12 -0
  3. package/dist/cli/args.js +40 -0
  4. package/dist/cli/index.d.ts +1 -1
  5. package/dist/cli/index.js +296 -95
  6. package/dist/cli/usage-text.d.ts +1 -0
  7. package/dist/cli/usage-text.js +97 -0
  8. package/dist/cli/verb-surface.d.ts +24 -0
  9. package/dist/cli/verb-surface.js +49 -0
  10. package/dist/dx/clusters.d.ts +0 -17
  11. package/dist/dx/clusters.js +50 -1
  12. package/dist/lib/backend.d.ts +11 -0
  13. package/dist/lib/backend.js +23 -0
  14. package/dist/lib/classifyTarget.d.ts +42 -0
  15. package/dist/lib/classifyTarget.js +83 -0
  16. package/dist/lib/feedback.d.ts +46 -5
  17. package/dist/lib/feedback.js +76 -19
  18. package/dist/lib/feedbackCopy.d.ts +70 -0
  19. package/dist/lib/feedbackCopy.js +163 -0
  20. package/dist/lib/initFrom.d.ts +26 -4
  21. package/dist/lib/initFrom.js +65 -41
  22. package/dist/lib/lifecycle.d.ts +28 -3
  23. package/dist/lib/lifecycle.js +99 -7
  24. package/dist/lib/listProjects.d.ts +41 -0
  25. package/dist/lib/listProjects.js +77 -0
  26. package/dist/lib/projects.d.ts +64 -8
  27. package/dist/lib/projects.js +316 -24
  28. package/dist/lib/sourceRefCopy.d.ts +19 -0
  29. package/dist/lib/sourceRefCopy.js +36 -0
  30. package/dist/preview/command.d.ts +11 -0
  31. package/dist/preview/command.js +19 -1
  32. package/dist/preview/copy.d.ts +7 -0
  33. package/dist/preview/copy.js +8 -1
  34. package/dist/preview/runner.d.ts +6 -0
  35. package/dist/preview/runner.js +1 -0
  36. package/dist/preview/stream.d.ts +11 -0
  37. package/dist/preview/stream.js +13 -0
  38. package/dist/relay/annotations.d.ts +28 -4
  39. package/dist/relay/annotations.js +23 -7
  40. package/dist/relay/qa.f12.fixtures.d.ts +154 -0
  41. package/dist/relay/qa.f12.fixtures.js +358 -0
  42. package/dist/relay/server.d.ts +41 -3
  43. package/dist/relay/server.js +90 -32
  44. package/package.json +2 -2
  45. package/dist/library/qa.f5-b32.spec.d.ts +0 -1
  46. package/dist/library/qa.f5-b32.spec.js +0 -202
  47. package/dist/library/qa.f5-cli.spec.d.ts +0 -1
  48. package/dist/library/qa.f5-cli.spec.js +0 -433
  49. package/dist/library/qa.f5-contract.spec.d.ts +0 -1
  50. package/dist/library/qa.f5-contract.spec.js +0 -206
  51. package/dist/relay/injectors.d.ts +0 -29
  52. package/dist/relay/injectors.js +0 -72
package/README.md CHANGED
@@ -17,16 +17,20 @@ order. It matters:
17
17
  not run `create` until you have it. The name becomes the live subdomain
18
18
  (`<slug>.vincentt.app`), so it is worth one question.
19
19
 
20
- 2. **Scaffold the project:**
20
+ 2. **Create the project:**
21
21
 
22
22
  ```
23
- npx -y @vincentt-xr/cli@latest create --name "<name>"
23
+ npx -y @vincentt-xr/cli@latest create <name> --name "<name>"
24
24
  ```
25
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.
26
+ In an **empty** folder this writes a complete, runnable starter (an AR app that
27
+ previews as-is), installs its dependencies, and then registers the project and
28
+ reserves its address. In a folder that is already a Vincentt app it only
29
+ registers. In any other non-empty folder it refuses and says what to run.
30
+
31
+ The scaffolding half needs no account. The registering half does: if you are
32
+ not signed in yet, the command opens a browser for the developer to approve
33
+ once, then continues. That is the only human step.
30
34
 
31
35
  3. **Read `AGENTS.md` in the new project, then stop.** The scaffold is already a
32
36
  working starter. **Do not invent an app or start building a scene.** Tell the
@@ -37,25 +41,39 @@ order. It matters:
37
41
  project root) are the authoritative guides for the dev loop and the SDK API.
38
42
  Read the SDK reference at the point you write a scene, not before.
39
43
 
40
- The short version: **ask for a name, scaffold, confirm it is ready, wait for the
44
+ The short version: **ask for a name, create, confirm it is ready, wait for the
41
45
  idea.** Everything after first contact is driven from the project's own
42
46
  `AGENTS.md`.
43
47
 
44
48
  ## Commands
45
49
 
50
+ `init` needs no account, ever — the template is yours to scaffold and run locally
51
+ whether or not you sign in. `create` also scaffolds an empty folder, and then
52
+ registers the project, which is what needs an account.
53
+
46
54
  ```
47
55
  Auth
48
56
  login Sign in; save an access token to ~/.vincentt/config.json
49
57
  logout Remove the saved access token
50
58
  whoami Show the signed-in account
51
59
 
60
+ Project
61
+ init [dir] Scaffold a Vincentt XR app — no account needed, ever
62
+ [--no-install] [--template <version>]
63
+ [--from <owner>/<repo>@<tag>]
64
+ create [name] Register a project and reserve its address; scaffolds first
65
+ if the folder is empty
66
+ [--name <s>] [--slug <s>] [--org <s>] [--preview]
67
+ [--force] [--no-install]
68
+ link <project-id> Link this directory to an existing project
69
+ unlink Detach this directory from its project
70
+ projects List the workspace's projects and their ids
71
+ [--json] [--org <s>]
72
+
52
73
  Dev loop
53
- create Scaffold + bind a project (empty dir -> full starter)
54
- [--name <s>] [--slug <s>] [--preview] [--force]
55
74
  publish Upload the built dist; go live at <slug>.vincentt.app
56
75
  preview Serve + tunnel the app for on-device preview
57
76
  (prints a desktop QR page to scan) [--stop]
58
- unbind Detach this directory from its project
59
77
 
60
78
  Diagnostics (need a running preview)
61
79
  logs [--errors] Console logs from the device [--json]
@@ -75,9 +93,10 @@ Meta
75
93
  Common options: --dir <path> (project dir, default cwd)
76
94
  ```
77
95
 
78
- Auth-needing verbs (`create`, `preview`, `publish`) fold sign-in into the first
79
- run: with no saved token they open the browser to authorize this device, then the
80
- token lives in `~/.vincentt/config.json` and later verbs run without prompting.
96
+ Auth-needing verbs (`create`'s registering half, `preview`, `publish`) fold
97
+ sign-in into the first run: with no saved token they open the browser to
98
+ authorize this device, then the token lives in `~/.vincentt/config.json` and
99
+ later verbs run without prompting. `init` never reaches that gate at all.
81
100
 
82
101
  ## The loop, once a project exists
83
102
 
@@ -89,8 +108,16 @@ token lives in `~/.vincentt/config.json` and later verbs run without prompting.
89
108
  preview relay. Debug on-device misbehavior instead of guessing.
90
109
  - `npx vincentt feedback --wait` — block for the next annotation the developer
91
110
  draws on the phone preview, print it as JSON, and exit.
111
+ - `npx vincentt preview --stop` — stop a preview started from another terminal.
112
+ When the relay can still be reached it reports how many connections are
113
+ attached first, so nobody blanks four phones without seeing that they are
114
+ there. A count that cannot be read prints no line rather than a guess.
92
115
  - `npx vincentt publish` — build (`pnpm build`), then upload the built `dist/` and
93
116
  return the live `<slug>.vincentt.app` URL. Nothing builds server-side.
94
117
 
118
+ In a directory that is not linked to anything, `npx vincentt projects` lists the
119
+ workspace's projects with their ids, which is what `vincentt link <project-id>`
120
+ needs. `--json` prints the same rows for a program to read.
121
+
95
122
  `vincentt` is a project devDependency in the scaffold, so invoke it as
96
123
  `npx vincentt <verb>` and it resolves to the local copy — no global install.
@@ -32,6 +32,18 @@ export interface ArgConflict {
32
32
  * work begins. Returns the conflict to report, or undefined.
33
33
  */
34
34
  export declare function fromFlagConflict(args: string[]): ArgConflict | undefined;
35
+ /**
36
+ * The offending flag on a `create` invocation, or undefined.
37
+ *
38
+ * The `.split("=")[0]` is load-bearing and is NOT what `flag()` does. `flag()` is a
39
+ * bare `argv.indexOf(name)`, which cannot see `--template=1.0.0` at all — copying
40
+ * its idiom here would let the equals spelling through in silence, which is the
41
+ * whole of the control. Case-SENSITIVE, deliberately: case-folding would turn
42
+ * `--TEMPLATE` into a flag that this refusal recognises and the rest of the CLI
43
+ * does not, i.e. a refusal for an input that was never going to work anyway, while
44
+ * teaching a reader that the two spellings are equivalent.
45
+ */
46
+ export declare function createSourceFlagRefusal(args: string[]): string | undefined;
35
47
  export declare function refusedFlag(args: string[]): string | undefined;
36
48
  /**
37
49
  * The bare arguments, with flag VALUES removed. Without this, `vincentt link --dir
package/dist/cli/args.js CHANGED
@@ -75,6 +75,46 @@ export function fromFlagConflict(args) {
75
75
  }
76
76
  return undefined;
77
77
  }
78
+ /**
79
+ * Source-selecting flags `create` must never honor.
80
+ *
81
+ * `create` clones TEMPLATE_REPO at `latest` and nothing else, and the decision to
82
+ * INSTALL dependencies on the unauthenticated scaffold path rests entirely on that
83
+ * being structurally true (f6's S-1 refuses an install only for a repo WE DO NOT
84
+ * CONTROL; scoping it, rather than overriding it, requires that `create` cannot be
85
+ * pointed anywhere else).
86
+ *
87
+ * Refused HERE rather than by not reading the flag, for the same reason
88
+ * INSTALL_ENABLING_FLAGS is: `flag()` is a global argv scan with no per-verb gate,
89
+ * so honoring one is a one-line accident, while defeating this refusal means
90
+ * deleting it, which is a reviewable act.
91
+ *
92
+ * Same flag, same code, different blast radius: on `init` the scaffold IS the
93
+ * command and a creator typed the ref; on `create` the scaffold is a side effect on
94
+ * a path an agent drives. Do not "harmonize" these.
95
+ */
96
+ const CREATE_REFUSED_SOURCE_FLAGS = new Set(["--from", "--template"]);
97
+ /**
98
+ * The offending flag on a `create` invocation, or undefined.
99
+ *
100
+ * The `.split("=")[0]` is load-bearing and is NOT what `flag()` does. `flag()` is a
101
+ * bare `argv.indexOf(name)`, which cannot see `--template=1.0.0` at all — copying
102
+ * its idiom here would let the equals spelling through in silence, which is the
103
+ * whole of the control. Case-SENSITIVE, deliberately: case-folding would turn
104
+ * `--TEMPLATE` into a flag that this refusal recognises and the rest of the CLI
105
+ * does not, i.e. a refusal for an input that was never going to work anyway, while
106
+ * teaching a reader that the two spellings are equivalent.
107
+ */
108
+ export function createSourceFlagRefusal(args) {
109
+ for (const a of args) {
110
+ if (!a.startsWith("-"))
111
+ continue;
112
+ const name = a.split("=")[0];
113
+ if (CREATE_REFUSED_SOURCE_FLAGS.has(name))
114
+ return name;
115
+ }
116
+ return undefined;
117
+ }
78
118
  /**
79
119
  * Flags the CLI deliberately does NOT have. The checklist reports and never
80
120
  * writes: a suggested value is one keystroke from a tool that writes it, and
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ export declare function usage(): string;