@devness/useai-cli 0.5.40 → 0.5.41
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 +63 -7
- 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.41";
|
|
34
34
|
|
|
35
35
|
// ../shared/dist/constants/defaults.js
|
|
36
36
|
var DEFAULT_CONFIG = {
|
|
@@ -6472,7 +6472,7 @@ var logoutCommand = new Command10("logout").description("Logout from useai.dev")
|
|
|
6472
6472
|
// src/commands/update.ts
|
|
6473
6473
|
import { Command as Command11 } from "commander";
|
|
6474
6474
|
import chalk10 from "chalk";
|
|
6475
|
-
var updateCommand = new Command11("update").description("Update UseAI
|
|
6475
|
+
var updateCommand = new Command11("update").description("Update UseAI to the latest version (daemon + MCP configs)").action(async () => {
|
|
6476
6476
|
console.log(chalk10.dim(" Checking for updates..."));
|
|
6477
6477
|
const latest = await fetchLatestVersion();
|
|
6478
6478
|
if (!latest) {
|
|
@@ -6488,21 +6488,77 @@ var updateCommand = new Command11("update").description("Update UseAI daemon to
|
|
|
6488
6488
|
console.log(` ${chalk10.dim("Current:")} v${currentVersion}`);
|
|
6489
6489
|
console.log(` ${chalk10.dim("Latest:")} v${latest}`);
|
|
6490
6490
|
console.log();
|
|
6491
|
+
const configuredTools = AI_TOOLS.filter((t) => {
|
|
6492
|
+
try {
|
|
6493
|
+
return t.isConfigured();
|
|
6494
|
+
} catch {
|
|
6495
|
+
return false;
|
|
6496
|
+
}
|
|
6497
|
+
});
|
|
6498
|
+
if (configuredTools.length > 0) {
|
|
6499
|
+
console.log(chalk10.dim(" Removing MCP configs from configured tools..."));
|
|
6500
|
+
for (const tool of configuredTools) {
|
|
6501
|
+
try {
|
|
6502
|
+
tool.remove();
|
|
6503
|
+
console.log(info(` \u21BB ${tool.name}`));
|
|
6504
|
+
} catch {
|
|
6505
|
+
console.log(error(` \u2717 Failed to remove ${tool.name}`));
|
|
6506
|
+
}
|
|
6507
|
+
}
|
|
6508
|
+
console.log();
|
|
6509
|
+
}
|
|
6491
6510
|
console.log(chalk10.dim(" Stopping current daemon..."));
|
|
6492
6511
|
await killDaemon();
|
|
6493
6512
|
console.log(chalk10.dim(" Starting updated daemon..."));
|
|
6494
|
-
const
|
|
6495
|
-
if (!
|
|
6513
|
+
const daemonOk = await ensureDaemon();
|
|
6514
|
+
if (!daemonOk) {
|
|
6496
6515
|
console.log(chalk10.red(" \u2717 Failed to start updated daemon"));
|
|
6497
6516
|
console.log(chalk10.dim(" Try running in foreground to debug:"));
|
|
6498
6517
|
console.log(chalk10.dim(` npx -y --prefer-online @devness/useai@latest daemon --port ${DAEMON_PORT}`));
|
|
6518
|
+
if (configuredTools.length > 0) {
|
|
6519
|
+
console.log(chalk10.dim("\n Reinstalling MCP configs (stdio fallback)..."));
|
|
6520
|
+
for (const tool of configuredTools) {
|
|
6521
|
+
try {
|
|
6522
|
+
tool.install();
|
|
6523
|
+
console.log(success(` \u2713 ${tool.name} \u2192 ${chalk10.dim("stdio")}`));
|
|
6524
|
+
} catch {
|
|
6525
|
+
console.log(error(` \u2717 ${tool.name}`));
|
|
6526
|
+
}
|
|
6527
|
+
}
|
|
6528
|
+
}
|
|
6499
6529
|
return;
|
|
6500
6530
|
}
|
|
6501
6531
|
const newHealth = await fetchDaemonHealth();
|
|
6502
6532
|
const newVersion = newHealth?.["version"] ?? "unknown";
|
|
6503
|
-
console.log(
|
|
6504
|
-
|
|
6505
|
-
|
|
6533
|
+
console.log(chalk10.green(`
|
|
6534
|
+
\u2713 Daemon updated: v${currentVersion} \u2192 v${newVersion}`));
|
|
6535
|
+
if (configuredTools.length > 0) {
|
|
6536
|
+
console.log(chalk10.dim("\n Reinstalling MCP configs..."));
|
|
6537
|
+
for (const tool of configuredTools) {
|
|
6538
|
+
try {
|
|
6539
|
+
if (tool.supportsUrl) {
|
|
6540
|
+
tool.installHttp();
|
|
6541
|
+
console.log(success(` \u2713 ${tool.name} \u2192 ${chalk10.dim("HTTP (daemon)")}`));
|
|
6542
|
+
} else {
|
|
6543
|
+
tool.install();
|
|
6544
|
+
console.log(success(` \u2713 ${tool.name} \u2192 ${chalk10.dim("stdio")}`));
|
|
6545
|
+
}
|
|
6546
|
+
} catch {
|
|
6547
|
+
console.log(error(` \u2717 ${tool.name}`));
|
|
6548
|
+
}
|
|
6549
|
+
}
|
|
6550
|
+
}
|
|
6551
|
+
try {
|
|
6552
|
+
const hooksInstalled = installClaudeCodeHooks();
|
|
6553
|
+
if (hooksInstalled) {
|
|
6554
|
+
console.log(success(" \u2713 Claude Code hooks reinstalled"));
|
|
6555
|
+
}
|
|
6556
|
+
} catch {
|
|
6557
|
+
}
|
|
6558
|
+
console.log(`
|
|
6559
|
+
Done! UseAI updated to v${newVersion} in ${chalk10.bold(String(configuredTools.length))} tool${configuredTools.length === 1 ? "" : "s"}.
|
|
6560
|
+
`);
|
|
6561
|
+
console.log(chalk10.dim(` Dashboard: http://127.0.0.1:${DAEMON_PORT}/dashboard`));
|
|
6506
6562
|
});
|
|
6507
6563
|
|
|
6508
6564
|
// src/index.ts
|