uwonbot 1.0.3 → 1.0.4
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/bin/uwonbot.js +31 -1
- package/package.json +1 -1
- package/src/banner.js +15 -1
package/bin/uwonbot.js
CHANGED
|
@@ -12,7 +12,7 @@ showBanner();
|
|
|
12
12
|
program
|
|
13
13
|
.name('uwonbot')
|
|
14
14
|
.description('Uwonbot AI Assistant — Your AI controls your computer')
|
|
15
|
-
.version('1.0.
|
|
15
|
+
.version('1.0.4');
|
|
16
16
|
|
|
17
17
|
program
|
|
18
18
|
.command('login')
|
|
@@ -61,6 +61,35 @@ program
|
|
|
61
61
|
await startAgent(parseInt(opts.port));
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
+
program
|
|
65
|
+
.command('upgrade')
|
|
66
|
+
.description('Upgrade uwonbot to the latest version')
|
|
67
|
+
.action(async () => {
|
|
68
|
+
const { execSync } = await import('child_process');
|
|
69
|
+
const chalk = (await import('chalk')).default;
|
|
70
|
+
console.log(chalk.cyan(' Checking for updates...'));
|
|
71
|
+
try {
|
|
72
|
+
const latest = execSync('npm view uwonbot version', { encoding: 'utf8' }).trim();
|
|
73
|
+
const { readFileSync } = await import('fs');
|
|
74
|
+
const { fileURLToPath } = await import('url');
|
|
75
|
+
const { dirname, join } = await import('path');
|
|
76
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
77
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
78
|
+
const current = pkg.version;
|
|
79
|
+
if (current === latest) {
|
|
80
|
+
console.log(chalk.green(` ✓ Already on latest version (v${current})`));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
console.log(chalk.yellow(` Current: v${current} → Latest: v${latest}`));
|
|
84
|
+
console.log(chalk.cyan(' Upgrading...'));
|
|
85
|
+
execSync(`npm install -g uwonbot@${latest}`, { stdio: 'inherit' });
|
|
86
|
+
console.log(chalk.green(`\n ✓ Upgraded to v${latest}!`));
|
|
87
|
+
} catch (e) {
|
|
88
|
+
console.error(chalk.red(` ✗ Upgrade failed: ${e.message}`));
|
|
89
|
+
console.log(chalk.gray(' Try manually: npm install -g uwonbot@latest'));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
64
93
|
program
|
|
65
94
|
.command('run <command>')
|
|
66
95
|
.description('Ask your assistant to run a task')
|
|
@@ -88,6 +117,7 @@ if (process.argv.length <= 2) {
|
|
|
88
117
|
console.log(' uwonbot assistants List your AI assistants');
|
|
89
118
|
console.log(' uwonbot run "..." Ask AI to run a task');
|
|
90
119
|
console.log(' uwonbot agent Start local agent (OS control)');
|
|
120
|
+
console.log(' uwonbot upgrade Upgrade to latest version');
|
|
91
121
|
console.log(' uwonbot logout Log out');
|
|
92
122
|
console.log('');
|
|
93
123
|
} else {
|
package/package.json
CHANGED
package/src/banner.js
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
|
|
6
|
+
function getVersion() {
|
|
7
|
+
try {
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
10
|
+
return pkg.version || '0.0.0';
|
|
11
|
+
} catch { return '0.0.0'; }
|
|
12
|
+
}
|
|
2
13
|
|
|
3
14
|
export function showBanner() {
|
|
15
|
+
const ver = getVersion();
|
|
4
16
|
const blue = chalk.hex('#2563eb');
|
|
5
17
|
const cyan = chalk.hex('#06b6d4');
|
|
6
18
|
const gray = chalk.hex('#6b7280');
|
|
7
19
|
const white = chalk.white.bold;
|
|
8
20
|
|
|
21
|
+
const verStr = `v${ver}`.padEnd(25);
|
|
22
|
+
|
|
9
23
|
console.log('');
|
|
10
24
|
console.log(blue(' ╔══════════════════════════════════════════════════════════════╗'));
|
|
11
25
|
console.log(blue(' ║ ║'));
|
|
@@ -17,7 +31,7 @@ export function showBanner() {
|
|
|
17
31
|
console.log(blue(' ║') + cyan(' ╚═════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═╝ ') + blue(' ║'));
|
|
18
32
|
console.log(blue(' ║ ║'));
|
|
19
33
|
console.log(blue(' ║') + gray(' AI Assistant — Your AI controls your computer ') + blue(' ║'));
|
|
20
|
-
console.log(blue(' ║') + gray(
|
|
34
|
+
console.log(blue(' ║') + gray(` ${verStr}https://uwonbot.com `) + blue(' ║'));
|
|
21
35
|
console.log(blue(' ║ ║'));
|
|
22
36
|
console.log(blue(' ╚══════════════════════════════════════════════════════════════╝'));
|
|
23
37
|
console.log('');
|