@devness/useai-cli 0.5.47 → 0.5.48
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/index.js +21 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var SYSTEMD_SERVICE_PATH = join(homedir(), ".config", "systemd", "user", "useai-
|
|
|
30
30
|
var WINDOWS_STARTUP_SCRIPT_PATH = join(process.env["APPDATA"] ?? join(homedir(), "AppData", "Roaming"), "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "useai-daemon.vbs");
|
|
31
31
|
|
|
32
32
|
// ../shared/dist/constants/version.js
|
|
33
|
-
var VERSION = "0.5.
|
|
33
|
+
var VERSION = "0.5.48";
|
|
34
34
|
|
|
35
35
|
// ../shared/dist/constants/defaults.js
|
|
36
36
|
var DEFAULT_CONFIG = {
|
|
@@ -4635,13 +4635,28 @@ var KNOWN_PATHS = isWindows ? [] : [
|
|
|
4635
4635
|
join2(homedir2(), ".bun", "bin", "npx")
|
|
4636
4636
|
];
|
|
4637
4637
|
function resolveNpxPath() {
|
|
4638
|
-
const whichCmd = isWindows ? "where npx" : "which npx";
|
|
4638
|
+
const whichCmd = isWindows ? "where npx.cmd" : "which npx";
|
|
4639
4639
|
try {
|
|
4640
4640
|
const result = execSync(whichCmd, { stdio: ["pipe", "pipe", "ignore"], encoding: "utf-8" }).trim();
|
|
4641
4641
|
if (result)
|
|
4642
4642
|
return result.split("\n")[0].trim();
|
|
4643
4643
|
} catch {
|
|
4644
4644
|
}
|
|
4645
|
+
if (isWindows) {
|
|
4646
|
+
try {
|
|
4647
|
+
const result = execSync("where npx", { stdio: ["pipe", "pipe", "ignore"], encoding: "utf-8" }).trim();
|
|
4648
|
+
if (result) {
|
|
4649
|
+
const first = result.split("\n")[0].trim();
|
|
4650
|
+
if (!first.toLowerCase().endsWith(".cmd")) {
|
|
4651
|
+
const cmdPath = first + ".cmd";
|
|
4652
|
+
if (existsSync3(cmdPath))
|
|
4653
|
+
return cmdPath;
|
|
4654
|
+
}
|
|
4655
|
+
return first;
|
|
4656
|
+
}
|
|
4657
|
+
} catch {
|
|
4658
|
+
}
|
|
4659
|
+
}
|
|
4645
4660
|
if (!isWindows && process.env["SHELL"]) {
|
|
4646
4661
|
try {
|
|
4647
4662
|
const result = execSync(`${process.env["SHELL"]} -lc "which npx"`, {
|
|
@@ -4807,7 +4822,8 @@ async function ensureDaemon(options) {
|
|
|
4807
4822
|
npxArgs.push("@devness/useai@latest", "daemon", "--port", String(DAEMON_PORT));
|
|
4808
4823
|
const child = spawn(npxPath, npxArgs, {
|
|
4809
4824
|
detached: true,
|
|
4810
|
-
stdio: "ignore"
|
|
4825
|
+
stdio: "ignore",
|
|
4826
|
+
shell: process.platform === "win32"
|
|
4811
4827
|
});
|
|
4812
4828
|
child.unref();
|
|
4813
4829
|
const start = Date.now();
|
|
@@ -6522,7 +6538,8 @@ var startCommand = new Command8("start").description("Start the UseAI daemon").o
|
|
|
6522
6538
|
}
|
|
6523
6539
|
if (opts.foreground) {
|
|
6524
6540
|
const child = spawn2("npx", ["-y", "@devness/useai@latest", "daemon", "--port", String(port)], {
|
|
6525
|
-
stdio: "inherit"
|
|
6541
|
+
stdio: "inherit",
|
|
6542
|
+
shell: process.platform === "win32"
|
|
6526
6543
|
});
|
|
6527
6544
|
child.on("exit", (code) => {
|
|
6528
6545
|
process.exit(code ?? 0);
|