@wspc/cli 0.0.17 → 0.0.19
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.js +23 -11
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/cli.js
CHANGED
|
@@ -1424,9 +1424,9 @@ function createConsistencyFetch(opts) {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
1426
1426
|
// src/version.ts
|
|
1427
|
-
var VERSION = "0.0.
|
|
1427
|
+
var VERSION = "0.0.19";
|
|
1428
1428
|
var SPEC_SHA = "d0ccc741";
|
|
1429
|
-
var SPEC_FETCHED_AT = "2026-06-
|
|
1429
|
+
var SPEC_FETCHED_AT = "2026-06-17T07:38:57.087Z";
|
|
1430
1430
|
var API_BASE = "https://api.wspc.ai";
|
|
1431
1431
|
|
|
1432
1432
|
// src/index.ts
|
|
@@ -3674,6 +3674,24 @@ async function fetchMe(opts) {
|
|
|
3674
3674
|
}
|
|
3675
3675
|
|
|
3676
3676
|
// src/handwritten/auth/login.ts
|
|
3677
|
+
function renderDevicePrompt(prompt) {
|
|
3678
|
+
const mins = Math.max(1, Math.round((prompt.expires_in ?? 0) / 60));
|
|
3679
|
+
const lines = ["", ` ${bold("wspc login")}`, ""];
|
|
3680
|
+
if (prompt.verification_uri_complete) {
|
|
3681
|
+
lines.push(` ${dim("Open this link to sign in (code already filled in):")}`);
|
|
3682
|
+
lines.push(` ${cyan(prompt.verification_uri_complete)}`);
|
|
3683
|
+
lines.push("");
|
|
3684
|
+
lines.push(` ${dim(`Or go to ${prompt.verification_uri} and enter:`)}`);
|
|
3685
|
+
lines.push(` ${bold(prompt.user_code)}`);
|
|
3686
|
+
} else {
|
|
3687
|
+
lines.push(` ${dim(`Go to ${prompt.verification_uri} and enter:`)}`);
|
|
3688
|
+
lines.push(` ${bold(prompt.user_code)}`);
|
|
3689
|
+
}
|
|
3690
|
+
lines.push("");
|
|
3691
|
+
lines.push(` ${dim(`Code expires in ${mins}m \xB7 waiting for approval\u2026`)}`);
|
|
3692
|
+
lines.push("");
|
|
3693
|
+
return lines.join("\n");
|
|
3694
|
+
}
|
|
3677
3695
|
function getOrCreateEnv(c, envName, apiBase) {
|
|
3678
3696
|
const existing = c.envs[envName];
|
|
3679
3697
|
if (existing) {
|
|
@@ -3716,7 +3734,7 @@ async function runLogin(opts) {
|
|
|
3716
3734
|
if (who2.email !== LEGACY_ACCOUNT_KEY) delete env2.accounts[LEGACY_ACCOUNT_KEY];
|
|
3717
3735
|
c2.current_env = envName;
|
|
3718
3736
|
await opts.store.write(c2);
|
|
3719
|
-
opts.output.write(
|
|
3737
|
+
opts.output.write(`${green("\u2713")} logged in (api key) as ${bold(who2.email)} ${dim(`\u2192 env "${envName}"`)}`);
|
|
3720
3738
|
return;
|
|
3721
3739
|
}
|
|
3722
3740
|
const ensureClient = opts.ensureClient ?? ((env2) => ensureClientId({ store: opts.store, envName: env2, baseUrl: opts.baseUrl }));
|
|
@@ -3730,13 +3748,7 @@ async function runLogin(opts) {
|
|
|
3730
3748
|
onPrompt: (p) => {
|
|
3731
3749
|
const prompt = p;
|
|
3732
3750
|
opts.output.writeJson({ event: "device_code_issued", ...prompt });
|
|
3733
|
-
opts.output.write(
|
|
3734
|
-
=== wspc login ===`);
|
|
3735
|
-
opts.output.write(`verification_uri: ${prompt.verification_uri}`);
|
|
3736
|
-
opts.output.write(`user_code: ${prompt.user_code}`);
|
|
3737
|
-
opts.output.write(`expires_in: ${prompt.expires_in}`);
|
|
3738
|
-
opts.output.write(`=== waiting for approval ===
|
|
3739
|
-
`);
|
|
3751
|
+
opts.output.write(renderDevicePrompt(prompt));
|
|
3740
3752
|
}
|
|
3741
3753
|
});
|
|
3742
3754
|
const who = await me({
|
|
@@ -3762,7 +3774,7 @@ async function runLogin(opts) {
|
|
|
3762
3774
|
c.current_env = envName;
|
|
3763
3775
|
await opts.store.write(c);
|
|
3764
3776
|
opts.output.writeJson({ event: "login_success", email: who.email });
|
|
3765
|
-
opts.output.write(
|
|
3777
|
+
opts.output.write(`${green("\u2713")} logged in as ${bold(who.email)} ${dim(`\u2192 env "${envName}"`)}`);
|
|
3766
3778
|
}
|
|
3767
3779
|
|
|
3768
3780
|
// src/handwritten/commands/login.ts
|