uwonbot 1.0.8 → 1.0.9
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 -13
- package/package.json +1 -1
- package/src/auth.js +10 -4
- package/src/config.js +3 -0
- package/src/setup.js +128 -0
package/bin/uwonbot.js
CHANGED
|
@@ -6,13 +6,14 @@ import { listAssistants, selectAssistant } from '../src/assistants.js';
|
|
|
6
6
|
import { startChat } from '../src/chat.js';
|
|
7
7
|
import { getConfig } from '../src/config.js';
|
|
8
8
|
import { startAgent } from '../src/agent.js';
|
|
9
|
+
import { runSetupWizard } from '../src/setup.js';
|
|
9
10
|
|
|
10
11
|
showBanner();
|
|
11
12
|
|
|
12
13
|
program
|
|
13
14
|
.name('uwonbot')
|
|
14
15
|
.description('Uwonbot AI Assistant — Your AI controls your computer')
|
|
15
|
-
.version('1.0.
|
|
16
|
+
.version('1.0.9');
|
|
16
17
|
|
|
17
18
|
program
|
|
18
19
|
.command('login')
|
|
@@ -79,6 +80,19 @@ program
|
|
|
79
80
|
await startAgent(parseInt(opts.port), { noMic: !opts.mic });
|
|
80
81
|
});
|
|
81
82
|
|
|
83
|
+
program
|
|
84
|
+
.command('setup')
|
|
85
|
+
.description('Run initial setup wizard again')
|
|
86
|
+
.action(async () => {
|
|
87
|
+
const config = getConfig();
|
|
88
|
+
if (!config.get('uid')) {
|
|
89
|
+
console.log('\n ⚠️ Please log in first: uwonbot login\n');
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
config.set('setupComplete', false);
|
|
93
|
+
await runSetupWizard();
|
|
94
|
+
});
|
|
95
|
+
|
|
82
96
|
program
|
|
83
97
|
.command('upgrade')
|
|
84
98
|
.description('Upgrade uwonbot to the latest version')
|
|
@@ -127,18 +141,22 @@ if (process.argv.length <= 2) {
|
|
|
127
141
|
const config = getConfig();
|
|
128
142
|
const uid = config.get('uid');
|
|
129
143
|
if (uid) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
if (!config.get('setupComplete')) {
|
|
145
|
+
await runSetupWizard();
|
|
146
|
+
} else {
|
|
147
|
+
const email = config.get('email') || 'unknown';
|
|
148
|
+
console.log(` Logged in as: ${email}`);
|
|
149
|
+
console.log('');
|
|
150
|
+
console.log(' Commands:');
|
|
151
|
+
console.log(' uwonbot chat Start chatting with your AI assistant');
|
|
152
|
+
console.log(' uwonbot assistants List your AI assistants');
|
|
153
|
+
console.log(' uwonbot run "..." Ask AI to run a task');
|
|
154
|
+
console.log(' uwonbot agent Start local agent (OS control)');
|
|
155
|
+
console.log(' uwonbot upgrade Upgrade to latest version');
|
|
156
|
+
console.log(' uwonbot reset-password Reset password via email');
|
|
157
|
+
console.log(' uwonbot logout Log out');
|
|
158
|
+
console.log('');
|
|
159
|
+
}
|
|
142
160
|
} else {
|
|
143
161
|
console.log(' Get started:');
|
|
144
162
|
console.log(' uwonbot login Log in to your account');
|
package/package.json
CHANGED
package/src/auth.js
CHANGED
|
@@ -3,6 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import { getConfig } from './config.js';
|
|
5
5
|
import { loginWithEmail, sendPasswordReset } from './firebase-client.js';
|
|
6
|
+
import { runSetupWizard } from './setup.js';
|
|
6
7
|
|
|
7
8
|
export async function loginCommand() {
|
|
8
9
|
const config = getConfig();
|
|
@@ -44,10 +45,15 @@ export async function loginCommand() {
|
|
|
44
45
|
config.set('idToken', user.idToken);
|
|
45
46
|
config.set('refreshToken', user.refreshToken);
|
|
46
47
|
spinner.succeed(chalk.green(`Logged in as ${user.email}`));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
|
|
49
|
+
if (!config.get('setupComplete')) {
|
|
50
|
+
await runSetupWizard();
|
|
51
|
+
} else {
|
|
52
|
+
console.log('');
|
|
53
|
+
console.log(chalk.gray(' Next: uwonbot chat — Start chatting with your AI assistant'));
|
|
54
|
+
console.log(chalk.gray(' uwonbot assistants — List your assistants'));
|
|
55
|
+
console.log('');
|
|
56
|
+
}
|
|
51
57
|
} catch (err) {
|
|
52
58
|
spinner.fail(chalk.red('Login failed'));
|
|
53
59
|
const msg = (err.message || '').toUpperCase();
|
package/src/config.js
CHANGED
|
@@ -14,6 +14,9 @@ export function getConfig() {
|
|
|
14
14
|
refreshToken: { type: 'string', default: '' },
|
|
15
15
|
activeAssistantId: { type: 'string', default: '' },
|
|
16
16
|
activeAssistantName: { type: 'string', default: '' },
|
|
17
|
+
setupComplete: { type: 'boolean', default: false },
|
|
18
|
+
agentAutoStart: { type: 'boolean', default: false },
|
|
19
|
+
clapDetection: { type: 'boolean', default: true },
|
|
17
20
|
},
|
|
18
21
|
});
|
|
19
22
|
}
|
package/src/setup.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import { getConfig } from './config.js';
|
|
5
|
+
|
|
6
|
+
function checkSoxInstalled() {
|
|
7
|
+
try {
|
|
8
|
+
execSync('which sox', { stdio: 'ignore' });
|
|
9
|
+
return true;
|
|
10
|
+
} catch {
|
|
11
|
+
try {
|
|
12
|
+
execSync('which rec', { stdio: 'ignore' });
|
|
13
|
+
return true;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function runSetupWizard() {
|
|
21
|
+
const config = getConfig();
|
|
22
|
+
|
|
23
|
+
console.log('');
|
|
24
|
+
console.log(chalk.bold.cyan(' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
25
|
+
console.log(chalk.bold.cyan(' 🚀 Uwonbot 초기 설정'));
|
|
26
|
+
console.log(chalk.bold.cyan(' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
27
|
+
console.log('');
|
|
28
|
+
console.log(chalk.white(' 환영합니다! Uwonbot을 최대한 활용하기 위한'));
|
|
29
|
+
console.log(chalk.white(' 초기 설정을 진행합니다.'));
|
|
30
|
+
console.log('');
|
|
31
|
+
|
|
32
|
+
console.log(chalk.bold.white(' 1️⃣ 에이전트 (Agent)'));
|
|
33
|
+
console.log(chalk.gray(' AI 비서가 컴퓨터를 제어하고, 박수로 비서를'));
|
|
34
|
+
console.log(chalk.gray(' 활성화하려면 에이전트가 필요합니다.'));
|
|
35
|
+
console.log('');
|
|
36
|
+
|
|
37
|
+
const { enableAgent } = await inquirer.prompt([{
|
|
38
|
+
type: 'confirm',
|
|
39
|
+
name: 'enableAgent',
|
|
40
|
+
message: '에이전트를 자동 시작하시겠습니까?',
|
|
41
|
+
default: true,
|
|
42
|
+
}]);
|
|
43
|
+
|
|
44
|
+
config.set('agentAutoStart', enableAgent);
|
|
45
|
+
|
|
46
|
+
if (enableAgent) {
|
|
47
|
+
console.log('');
|
|
48
|
+
console.log(chalk.bold.white(' 2️⃣ 박수 감지 (Clap Detection)'));
|
|
49
|
+
console.log(chalk.gray(' 박수 2번으로 비서를 활성화할 수 있습니다.'));
|
|
50
|
+
console.log(chalk.gray(' 마이크와 SoX가 필요합니다.'));
|
|
51
|
+
console.log('');
|
|
52
|
+
|
|
53
|
+
const hasSox = checkSoxInstalled();
|
|
54
|
+
if (!hasSox) {
|
|
55
|
+
console.log(chalk.yellow(' ⚠ SoX가 설치되어 있지 않습니다.'));
|
|
56
|
+
console.log(chalk.gray(' 박수 감지를 위해 SoX를 설치해주세요:'));
|
|
57
|
+
console.log('');
|
|
58
|
+
console.log(chalk.white(' macOS: ') + chalk.cyan('brew install sox'));
|
|
59
|
+
console.log(chalk.white(' Ubuntu: ') + chalk.cyan('sudo apt install sox'));
|
|
60
|
+
console.log('');
|
|
61
|
+
|
|
62
|
+
const { installSox } = await inquirer.prompt([{
|
|
63
|
+
type: 'confirm',
|
|
64
|
+
name: 'installSox',
|
|
65
|
+
message: 'SoX를 지금 설치하시겠습니까? (macOS - Homebrew)',
|
|
66
|
+
default: true,
|
|
67
|
+
}]);
|
|
68
|
+
|
|
69
|
+
if (installSox) {
|
|
70
|
+
try {
|
|
71
|
+
console.log(chalk.cyan(' SoX 설치 중...'));
|
|
72
|
+
execSync('brew install sox', { stdio: 'inherit' });
|
|
73
|
+
console.log(chalk.green(' ✓ SoX 설치 완료'));
|
|
74
|
+
} catch {
|
|
75
|
+
console.log(chalk.yellow(' ⚠ SoX 설치에 실패했습니다. 나중에 수동으로 설치해주세요.'));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
console.log(chalk.green(' ✓ SoX가 이미 설치되어 있습니다.'));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const { enableClap } = await inquirer.prompt([{
|
|
83
|
+
type: 'confirm',
|
|
84
|
+
name: 'enableClap',
|
|
85
|
+
message: '박수 감지를 활성화하시겠습니까?',
|
|
86
|
+
default: true,
|
|
87
|
+
}]);
|
|
88
|
+
|
|
89
|
+
config.set('clapDetection', enableClap);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.log('');
|
|
93
|
+
console.log(chalk.bold.white(' 3️⃣ 기기 생체인증'));
|
|
94
|
+
console.log(chalk.gray(' 보안을 위해 비서 사용 시 지문/Face ID 인증을'));
|
|
95
|
+
console.log(chalk.gray(' 요구할 수 있습니다.'));
|
|
96
|
+
console.log(chalk.gray(' 웹사이트 마이페이지에서 기기를 등록해주세요:'));
|
|
97
|
+
console.log(chalk.cyan(' https://chartapp-653e1.web.app/profile'));
|
|
98
|
+
console.log('');
|
|
99
|
+
|
|
100
|
+
config.set('setupComplete', true);
|
|
101
|
+
|
|
102
|
+
console.log(chalk.bold.cyan(' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
103
|
+
console.log(chalk.bold.green(' ✓ 설정 완료!'));
|
|
104
|
+
console.log(chalk.bold.cyan(' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
105
|
+
console.log('');
|
|
106
|
+
console.log(chalk.white(' 다음 단계:'));
|
|
107
|
+
|
|
108
|
+
if (enableAgent) {
|
|
109
|
+
console.log(chalk.cyan(' uwonbot agent') + chalk.gray(' — 에이전트 시작 (박수 감지 + OS 제어)'));
|
|
110
|
+
}
|
|
111
|
+
console.log(chalk.cyan(' uwonbot chat') + chalk.gray(' — AI 비서와 대화'));
|
|
112
|
+
console.log(chalk.cyan(' uwonbot assistants') + chalk.gray(' — 비서 목록 확인'));
|
|
113
|
+
console.log('');
|
|
114
|
+
|
|
115
|
+
if (enableAgent) {
|
|
116
|
+
const { startNow } = await inquirer.prompt([{
|
|
117
|
+
type: 'confirm',
|
|
118
|
+
name: 'startNow',
|
|
119
|
+
message: '에이전트를 지금 바로 시작하시겠습니까?',
|
|
120
|
+
default: true,
|
|
121
|
+
}]);
|
|
122
|
+
|
|
123
|
+
if (startNow) {
|
|
124
|
+
const { startAgent } = await import('./agent.js');
|
|
125
|
+
await startAgent(9876, { noMic: !config.get('clapDetection') });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|