nexo-code 0.1.1 → 0.1.2
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/nexo.mjs +19 -1
- package/package.json +1 -1
package/nexo.mjs
CHANGED
|
@@ -14681,6 +14681,8 @@ var require_content_type = __commonJS({
|
|
|
14681
14681
|
|
|
14682
14682
|
// dist/main.js
|
|
14683
14683
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
14684
|
+
import { rmSync } from "node:fs";
|
|
14685
|
+
import { join as join19 } from "node:path";
|
|
14684
14686
|
import { createInterface } from "node:readline";
|
|
14685
14687
|
|
|
14686
14688
|
// dist/update.js
|
|
@@ -14688,7 +14690,7 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
|
14688
14690
|
import { join } from "node:path";
|
|
14689
14691
|
|
|
14690
14692
|
// dist/version.js
|
|
14691
|
-
var VERSION = "0.1.
|
|
14693
|
+
var VERSION = "0.1.2";
|
|
14692
14694
|
|
|
14693
14695
|
// dist/update.js
|
|
14694
14696
|
var PACKAGE = "nexo-code";
|
|
@@ -44261,6 +44263,8 @@ async function login(io, opts) {
|
|
|
44261
44263
|
}
|
|
44262
44264
|
async function emailSignIn(io, apiUrl) {
|
|
44263
44265
|
const { style: s } = io;
|
|
44266
|
+
io.err(`${s.bold("Sign in to Nexo")} ${s.dim("(Ctrl+C to cancel)")}`);
|
|
44267
|
+
io.err("Type your email address and press Enter:");
|
|
44264
44268
|
const email3 = (await io.readLine(`${s.primary("\u203A")} Your email: `))?.trim();
|
|
44265
44269
|
if (!email3)
|
|
44266
44270
|
return null;
|
|
@@ -44274,6 +44278,7 @@ async function emailSignIn(io, apiUrl) {
|
|
|
44274
44278
|
throw await errorFromResponse(started);
|
|
44275
44279
|
io.err(s.dim(` If ${email3} has a Nexo account, a six-digit code is on its way. No account yet? Sign up at https://usenexoai.com`));
|
|
44276
44280
|
for (let tries = 0; tries < 3; tries++) {
|
|
44281
|
+
io.err("Type the six-digit code from the email and press Enter:");
|
|
44277
44282
|
const code = (await io.readLine(`${s.primary("\u203A")} Code from the email: `))?.replace(/\s+/g, "");
|
|
44278
44283
|
if (!code)
|
|
44279
44284
|
return null;
|
|
@@ -46672,6 +46677,8 @@ async function run2(argv, io) {
|
|
|
46672
46677
|
io.err(`${io.style.error(io.style.sym.fail)} Could not run npm. Install the update yourself: npm install -g ${PACKAGE}@latest`);
|
|
46673
46678
|
return 1;
|
|
46674
46679
|
}
|
|
46680
|
+
if (npm.status === 0 && process.platform === "win32")
|
|
46681
|
+
dropBlockedLauncher();
|
|
46675
46682
|
return npm.status ?? 1;
|
|
46676
46683
|
}
|
|
46677
46684
|
if (cmd === "remote") {
|
|
@@ -46764,6 +46771,17 @@ async function headless(io, words, format, yes) {
|
|
|
46764
46771
|
line2({ type: "result", exitCode: code, answer: text2.trim(), ...result ?? { outcome: code === 0 ? "done" : "failed", filesChanged: [], costMicros: 0 } });
|
|
46765
46772
|
return code;
|
|
46766
46773
|
}
|
|
46774
|
+
function dropBlockedLauncher() {
|
|
46775
|
+
try {
|
|
46776
|
+
const policy = spawnSync2("powershell.exe", ["-NoProfile", "-Command", "Get-ExecutionPolicy"], { encoding: "utf8", windowsHide: true }).stdout.trim();
|
|
46777
|
+
if (policy !== "Restricted" && policy !== "AllSigned")
|
|
46778
|
+
return;
|
|
46779
|
+
const prefix = spawnSync2("npm.cmd", ["prefix", "-g"], { encoding: "utf8", shell: true, windowsHide: true }).stdout.trim();
|
|
46780
|
+
if (prefix)
|
|
46781
|
+
rmSync(join19(prefix, "nexo.ps1"), { force: true });
|
|
46782
|
+
} catch {
|
|
46783
|
+
}
|
|
46784
|
+
}
|
|
46767
46785
|
var isMain = true;
|
|
46768
46786
|
if (isMain) {
|
|
46769
46787
|
const settings = loadSettings(configDir(process.env));
|