@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.
- package/README.md +94 -0
- package/dist/cli/args.d.ts +14 -0
- package/dist/cli/args.js +51 -0
- package/dist/cli/index.js +416 -100
- package/dist/lib/backend.d.ts +44 -20
- package/dist/lib/backend.js +98 -51
- 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 +85 -19
- package/dist/lib/lifecycle.js +133 -130
- 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 +52 -25
- 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/publish/api.d.ts +67 -0
- package/dist/publish/api.js +96 -0
- package/dist/publish/bounds.d.ts +25 -0
- package/dist/publish/bounds.js +53 -0
- package/dist/publish/classify.d.ts +51 -0
- package/dist/publish/classify.js +138 -0
- package/dist/publish/command.d.ts +27 -0
- package/dist/publish/command.js +328 -0
- package/dist/publish/consoleVerbs.d.ts +17 -0
- package/dist/publish/consoleVerbs.js +26 -0
- package/dist/publish/copy.d.ts +180 -0
- package/dist/publish/copy.js +606 -0
- package/dist/publish/defaults.d.ts +16 -0
- package/dist/publish/defaults.js +52 -0
- package/dist/publish/manifest.d.ts +27 -0
- package/dist/publish/manifest.js +81 -0
- package/dist/publish/paths.d.ts +25 -0
- package/dist/publish/paths.js +78 -0
- package/dist/publish/progress.d.ts +17 -0
- package/dist/publish/progress.js +45 -0
- package/dist/publish/prompt.d.ts +4 -0
- package/dist/publish/prompt.js +31 -0
- package/dist/publish/qa.f4.fixtures.d.ts +25 -0
- package/dist/publish/qa.f4.fixtures.js +140 -0
- package/dist/publish/upload.d.ts +30 -0
- package/dist/publish/upload.js +93 -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
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { FileFindings } from "./classify.js";
|
|
2
|
+
import type { BoundViolation } from "./bounds.js";
|
|
3
|
+
export declare function truncate(value: string, max?: number): string;
|
|
4
|
+
/** Bytes as the creator reads them. Decimal MB, matching what a build tool prints. */
|
|
5
|
+
export declare function formatBytes(bytes: number): string;
|
|
6
|
+
/** The limit, printed as a plain number and never as policy. */
|
|
7
|
+
export declare function formatLimit(bytes: number): string;
|
|
8
|
+
export declare function relativeTime(iso: string, now: number): string;
|
|
9
|
+
/**
|
|
10
|
+
* Flow L25. Three registers of copy because the platform's confidence genuinely
|
|
11
|
+
* differs:
|
|
12
|
+
* - TEMPLATE-DEFAULT is flat and assertive. The CLI matched a string in a
|
|
13
|
+
* corpus it ships; it knows.
|
|
14
|
+
* - LIKELY-DEFAULT is hedged. The heuristic will be wrong sometimes, and a
|
|
15
|
+
* creator whose experience is genuinely called "AR" must not be told they
|
|
16
|
+
* made a mistake.
|
|
17
|
+
* - The dead og:image is the only ✗ the checklist ever emits, and it earns it:
|
|
18
|
+
* the manifest either contains the path or it does not.
|
|
19
|
+
*
|
|
20
|
+
* BOTH default tiers print the offending value. "Still the template default"
|
|
21
|
+
* without the string is a claim the creator has to go and verify; with it they
|
|
22
|
+
* either recognise it instantly or spot that we are wrong.
|
|
23
|
+
*
|
|
24
|
+
* A FINDING IS NEVER A COUNT. No "2 issues found", no summary line, and no exit
|
|
25
|
+
* code that varies with findings.
|
|
26
|
+
*/
|
|
27
|
+
export declare function findingLines(byFile: FileFindings[], withSubtitle: boolean): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Mandatory and always present. A screen with a red ✗ on it reads as a gate
|
|
30
|
+
* unless it explicitly says otherwise, and a creator who believes the platform
|
|
31
|
+
* is gating their publish on our opinion of their <meta> tags has learned
|
|
32
|
+
* something false about who owns the dist.
|
|
33
|
+
*/
|
|
34
|
+
export declare function nothingBlocksYou(): string[];
|
|
35
|
+
export interface ChecklistInput {
|
|
36
|
+
projectName: string;
|
|
37
|
+
orgName: string;
|
|
38
|
+
address: string;
|
|
39
|
+
fileCount: number;
|
|
40
|
+
totalBytes: number;
|
|
41
|
+
nextVersion: number;
|
|
42
|
+
findings: FileFindings[];
|
|
43
|
+
}
|
|
44
|
+
export declare function readingLine(fileCount: number, totalBytes: number): string;
|
|
45
|
+
export declare function headerLine(projectName: string, orgName: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Flow L22 — the single most consequential screen in the product, and its ORDER
|
|
48
|
+
* is the design.
|
|
49
|
+
*
|
|
50
|
+
* The address block is FIRST and it is fenced: a creator who reads nothing else
|
|
51
|
+
* reads the address and the sentence under it. The findings come AFTER, never
|
|
52
|
+
* before — the address is the irreversible thing and the metadata is fixable
|
|
53
|
+
* forever, so putting a red ✗ above the permanence block would make the eye land
|
|
54
|
+
* on the recoverable problem and skim the unrecoverable one.
|
|
55
|
+
*/
|
|
56
|
+
export declare function firstPublishChecklist(i: ChecklistInput): string[];
|
|
57
|
+
/** The prompt line restates the address AND the version. `[y/N]` — an accidental Enter does nothing. */
|
|
58
|
+
export declare function firstPublishPrompt(address: string, version: number): string;
|
|
59
|
+
/**
|
|
60
|
+
* Declining. Glyphless, exit 0, zero network calls beyond the project read.
|
|
61
|
+
* Declining is not a failure and is not an error; it is the prompt working.
|
|
62
|
+
*
|
|
63
|
+
* The second line is the one that matters — a creator who backed out because the
|
|
64
|
+
* address was wrong needs to know the address is still theirs to change.
|
|
65
|
+
*/
|
|
66
|
+
export declare function declined(): string[];
|
|
67
|
+
export interface RepublishInput extends ChecklistInput {
|
|
68
|
+
liveVersion: number;
|
|
69
|
+
/** ISO8601 from the SAME project read — no second call to render one parenthetical. */
|
|
70
|
+
livePublishedAt?: string;
|
|
71
|
+
now: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Flow L24. No fence, no permanence block, no disclosure: the address is already
|
|
75
|
+
* permanent and the creator already knows, and presenting a frozen fact as a
|
|
76
|
+
* choice is worse than not presenting it at all.
|
|
77
|
+
*
|
|
78
|
+
* `(v5, published 3 days ago)` is rendered from the project read ALONE —
|
|
79
|
+
* liveVersion and livePublishedAt both ride GET /projects/{id}.
|
|
80
|
+
*/
|
|
81
|
+
export declare function republishChecklist(i: RepublishInput): string[];
|
|
82
|
+
/** `[Y/n]` — on a republish an accidental Enter does the thing the creator typed the command to do. */
|
|
83
|
+
export declare function republishPrompt(version: number): string;
|
|
84
|
+
/**
|
|
85
|
+
* A publish onto an offline address brings it online, because publish always
|
|
86
|
+
* goes live. The creator must be told: they took it offline on purpose and might
|
|
87
|
+
* not intend to reverse that, so the default reverts to [y/N].
|
|
88
|
+
*/
|
|
89
|
+
export declare function offlineChecklist(i: ChecklistInput): string[];
|
|
90
|
+
export declare function offlinePrompt(version: number): string;
|
|
91
|
+
/**
|
|
92
|
+
* f1's line verbatim, with f4's reason. Note what is ABSENT, deliberately: f3's
|
|
93
|
+
* "your local dev loop doesn't need one" paragraph. It is the right copy for
|
|
94
|
+
* preview and the wrong copy here — a creator trying to publish is not looking
|
|
95
|
+
* for a smaller room, and offering one at this gate reads as a deflection.
|
|
96
|
+
*/
|
|
97
|
+
export declare function notSignedIn(): string[];
|
|
98
|
+
/**
|
|
99
|
+
* Loud, local, instant, and it carries the real number. This fires before a
|
|
100
|
+
* single byte moves and before a single request is made.
|
|
101
|
+
*
|
|
102
|
+
* The two numbers are STACKED AND ALIGNED — the judgement the creator must make
|
|
103
|
+
* is a comparison, and prose defeats it. The three largest files are named
|
|
104
|
+
* because that is almost always the entire diagnosis: one uncompressed asset is
|
|
105
|
+
* nearly always the cause.
|
|
106
|
+
*
|
|
107
|
+
* The limit is printed as a number, never as policy. No "on your plan", no
|
|
108
|
+
* "upgrade" — it is a correctness limit and not a quota, and copy implying
|
|
109
|
+
* otherwise would be the first sentence of a billing model this feature does not
|
|
110
|
+
* have.
|
|
111
|
+
*/
|
|
112
|
+
export declare function tooLarge(v: BoundViolation): string[];
|
|
113
|
+
/** No dist at all, or no index.html at its root. Zero network calls. */
|
|
114
|
+
export declare function noDist(distDir: string): string[];
|
|
115
|
+
export declare function noIndexHtml(distDir: string): string[];
|
|
116
|
+
/** A local path rule the creator's own build broke. Local, before any request. */
|
|
117
|
+
export declare function badPath(reason: string, offending: string): string[];
|
|
118
|
+
/** The one redrawn line in f4. A bounded progress bar with a known total is not a stream. */
|
|
119
|
+
export declare function progressBar(done: number, total: number, bytesDone: number, bytesTotal: number): string;
|
|
120
|
+
/** The non-TTY degrade: periodic plain lines, at most one per 2s. */
|
|
121
|
+
export declare function progressPlain(done: number, total: number, bytesDone: number): string;
|
|
122
|
+
export declare function uploadStart(fileCount: number): string;
|
|
123
|
+
export declare function uploadDone(fileCount: number, totalBytes: number, ms: number): string;
|
|
124
|
+
/** Covers the commit. The pause between the last byte and the live URL is real. */
|
|
125
|
+
export declare function finishing(): string;
|
|
126
|
+
/**
|
|
127
|
+
* The payload of the entire command: the live URL, full and clickable, with the
|
|
128
|
+
* version in parentheses. The caching sentence is one line and ALWAYS present —
|
|
129
|
+
* a creator refreshing a phone that has the old page in memory will see the old
|
|
130
|
+
* page, decide publish is broken, and publish again.
|
|
131
|
+
*/
|
|
132
|
+
export declare function liveAt(liveUrl: string, version: number): string[];
|
|
133
|
+
/** Prints only if a retry is needed. It says nothing about a failure, because nothing has failed yet. */
|
|
134
|
+
export declare function takingLonger(): string;
|
|
135
|
+
/**
|
|
136
|
+
* The cause is NOT named. Every non-healing arm of the commit state machine
|
|
137
|
+
* returns this identically by design, and the CLI must not invent a distinction
|
|
138
|
+
* the wire does not carry. "Had to be restarted" is honest about what happened
|
|
139
|
+
* and is correct for all three arms.
|
|
140
|
+
*/
|
|
141
|
+
export declare function publishExpired(address: string, liveVersion?: number): string[];
|
|
142
|
+
/** All three retries failed. "Nothing was lost" is the true and load-bearing sentence. */
|
|
143
|
+
export declare function flipFailed(address: string, liveVersion?: number): string[];
|
|
144
|
+
/**
|
|
145
|
+
* Two sentences, no explanation of version allocation. The real case is a
|
|
146
|
+
* teammate and an agent publishing in the same second, and "someone else
|
|
147
|
+
* published this project" tells the creator to check with a person before
|
|
148
|
+
* re-running — the correct next action, and not something a retry loop can do
|
|
149
|
+
* for them.
|
|
150
|
+
*/
|
|
151
|
+
export declare function publishContended(): string[];
|
|
152
|
+
/**
|
|
153
|
+
* The commit found fewer objects than the manifest declared. The response
|
|
154
|
+
* carries COUNTS, never paths, so the CLI diffs against its OWN manifest and
|
|
155
|
+
* prints its own strings.
|
|
156
|
+
*/
|
|
157
|
+
export declare function publishIncomplete(address: string, counts: {
|
|
158
|
+
missing?: number;
|
|
159
|
+
mismatched?: number;
|
|
160
|
+
}, liveVersion?: number): string[];
|
|
161
|
+
/** A file's bytes changed under the CLI between hashing and PUT. Names the file. */
|
|
162
|
+
export declare function badDigest(filePath: string, address: string, liveVersion?: number): string[];
|
|
163
|
+
export declare function tooLargeFromServer(observed: number, limit: number): string[];
|
|
164
|
+
export declare function rateLimited(retryAfterSec: number): string[];
|
|
165
|
+
/**
|
|
166
|
+
* The same block serves rollback, unpublish, republish, versions, revert and
|
|
167
|
+
* take-offline. These are the words a creator will actually type, and every one
|
|
168
|
+
* of them lands on one screen that names the real home. A bare "unknown command"
|
|
169
|
+
* here would be the product failing to answer a question it knows the answer to.
|
|
170
|
+
*
|
|
171
|
+
* The reason is given in one clause and it is the honest one. Not "not
|
|
172
|
+
* supported", not "coming soon" — neither is true.
|
|
173
|
+
*
|
|
174
|
+
* IF THE FOLDER IS NOT LINKED THE LAST TWO LINES ARE DROPPED. The CLI does not
|
|
175
|
+
* know which project they meant, and guessing a console URL would be worse than
|
|
176
|
+
* none.
|
|
177
|
+
*/
|
|
178
|
+
export declare function consoleVerb(verb: string, versionsUrl?: string): string[];
|
|
179
|
+
/** The six verbs that land on that block. */
|
|
180
|
+
export declare const CONSOLE_ONLY_VERBS: readonly string[];
|