uwonbot 1.2.6 → 1.2.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/agent.js +19 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uwonbot",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "Uwonbot AI Assistant CLI — Your AI controls your computer",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/agent.js CHANGED
@@ -61,42 +61,30 @@ const platform = process.platform;
61
61
  let robot = null;
62
62
  let screenshotDesktop = null;
63
63
 
64
- async function checkAccessibility() {
65
- if (platform !== 'darwin') return true;
66
- try {
67
- const perms = await import('@nut-tree-fork/node-mac-permissions');
68
- const p = perms.default || perms;
69
- const status = p.getAuthStatus('accessibility');
70
- if (status === 'authorized') return true;
71
- console.log(chalk.yellow(` ⚠ 손쉬운 사용 권한: ${status}`));
72
- console.log(chalk.yellow(' 시스템 설정 > 개인정보 보호 및 보안 > 손쉬운 사용에서 터미널을 허용해주세요.'));
73
- return false;
74
- } catch { return true; }
75
- }
76
-
77
64
  async function loadNativeModules() {
78
- const accessOk = await checkAccessibility();
65
+ robot = null;
79
66
 
80
- try {
81
- robot = (await import('@nut-tree-fork/nut-js')).default || (await import('@nut-tree-fork/nut-js'));
82
- if (robot.mouse) {
83
- robot.mouse.config.autoDelayMs = 0;
84
- robot.mouse.config.mouseSpeed = 2000;
85
- }
86
- console.log(chalk.green(' ✓ nut-js loaded (mouse/keyboard control)'));
87
- if (!accessOk) {
88
- console.log(chalk.yellow(' ⚠ 접근성 권한이 없어 CoreGraphics 폴백을 사용합니다.'));
67
+ if (platform === 'darwin') {
68
+ try {
69
+ await execAsync(`osascript -l JavaScript -e 'ObjC.import("CoreGraphics"); 0'`);
70
+ console.log(chalk.green(' ✓ CoreGraphics 네이티브 마우스/키보드 제어'));
71
+ } catch {
72
+ console.log(chalk.red(' ✗ CoreGraphics 사용 불가'));
89
73
  }
90
- } catch (nutErr) {
74
+ } else {
91
75
  try {
92
- const rjs = await import('robotjs');
93
- robot = rjs.default || rjs;
94
- console.log(chalk.green(' ✓ robotjs loaded (mouse/keyboard control)'));
76
+ robot = (await import('@nut-tree-fork/nut-js')).default || (await import('@nut-tree-fork/nut-js'));
77
+ if (robot.mouse) {
78
+ robot.mouse.config.autoDelayMs = 0;
79
+ robot.mouse.config.mouseSpeed = 2000;
80
+ }
81
+ console.log(chalk.green(' ✓ nut-js loaded (mouse/keyboard control)'));
95
82
  } catch {
96
- robot = null;
97
- if (platform === 'darwin') {
98
- console.log(chalk.green(' ✓ CoreGraphics 직접 제어 모드 (macOS 네이티브)'));
99
- } else {
83
+ try {
84
+ const rjs = await import('robotjs');
85
+ robot = rjs.default || rjs;
86
+ console.log(chalk.green(' ✓ robotjs loaded (mouse/keyboard control)'));
87
+ } catch {
100
88
  console.log(chalk.yellow(' ⚠ No mouse/keyboard module found.'));
101
89
  console.log(chalk.yellow(' Install: npm install -g @nut-tree-fork/nut-js'));
102
90
  }
@@ -108,19 +96,9 @@ async function loadNativeModules() {
108
96
  screenshotDesktop = mod.default || mod;
109
97
  console.log(chalk.green(' ✓ screenshot-desktop loaded'));
110
98
  } catch {
111
- console.log(chalk.yellow(' ⚠ screenshot-desktop not found.'));
112
99
  screenshotDesktop = null;
113
100
  }
114
101
 
115
- if (platform === 'darwin' && !robot) {
116
- try {
117
- await execAsync(`osascript -l JavaScript -e 'ObjC.import("CoreGraphics"); 0'`);
118
- console.log(chalk.green(' ✓ CoreGraphics 마우스 제어 테스트 성공'));
119
- } catch {
120
- console.log(chalk.red(' ✗ CoreGraphics 사용 불가'));
121
- }
122
- }
123
-
124
102
  const screen = await getScreenSize();
125
103
  console.log(chalk.gray(` Screen: ${screen.width}x${screen.height}`));
126
104
  }