aionix 1.0.10 โ†’ 1.1.0

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/aionix.cmd CHANGED
@@ -1,3 +1,2 @@
1
-
2
1
  @echo off
3
2
  node "%~dp0index.js" %*
package/bin/index.js CHANGED
@@ -1,91 +1,153 @@
1
-
1
+ #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
4
  const chalk = require('chalk');
5
- const readline = require('readline');
5
+ const net = require('net');
6
6
  const fs = require('fs');
7
7
  const path = require('path');
8
8
  const os = require('os');
9
9
 
10
- const CONFIG_DIR = path.join(os.homedir(), '.aionix');
11
- const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
12
-
13
- console.log(chalk.cyan.bold(`
14
- +==============================+
15
- | ๐Ÿš€ AIONIX |
16
- | Offline Developer Toolkit |
17
- +==============================+
18
- `));
19
-
20
- console.log(chalk.green('โœ… AIONIX successfully installed!\n'));
10
+ const CONFIG_FILE = path.join(os.homedir(), '.aionix', 'config.json');
21
11
 
22
- let config = {};
12
+ let config = { name: 'Developer', port: 3000, autoOpen: true };
23
13
  try {
24
14
  if (fs.existsSync(CONFIG_FILE)) {
25
15
  config = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
26
16
  }
27
17
  } catch(e) {}
28
18
 
29
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
30
- function question(q) {
31
- return new Promise(resolve => rl.question(q, resolve));
19
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
20
+ // NEON ASCII BANNER
21
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
22
+ function showBanner() {
23
+ console.clear();
24
+ console.log(chalk.hex('#00ff9f').bold(`
25
+ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘
26
+ โ–‘ โ–‘
27
+ โ–‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–‘
28
+ โ–‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ• โ–‘
29
+ โ–‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ•”โ• โ–‘
30
+ โ–‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–‘
31
+ โ–‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•— โ–‘
32
+ โ–‘ โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ–‘
33
+ โ–‘ โ–‘
34
+ โ–‘ OFFLINE DEVELOPER TOOLKIT โ–‘
35
+ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘`));
36
+
37
+ console.log(chalk.hex('#00ff9f')(` โ•”${'โ•'.repeat(50)}โ•—`));
38
+ console.log(chalk.hex('#00ff9f')(` โ•‘`) + chalk.hex('#ffffff')(` ๐Ÿ‘พ Welcome back, `) + chalk.hex('#ffff00').bold(`${config.name}`.padEnd(29)) + chalk.hex('#00ff9f')(`โ•‘`));
39
+ console.log(chalk.hex('#00ff9f')(` โ•‘`) + chalk.hex('#888888')(` v1.2.0 ยท AI Chat ยท Image Gen ยท Tools `) + chalk.hex('#00ff9f')(` โ•‘`));
40
+ console.log(chalk.hex('#00ff9f')(` โ•š${'โ•'.repeat(50)}โ•`));
41
+ console.log();
32
42
  }
33
43
 
34
- async function setup() {
35
- console.log(chalk.yellow('โš™๏ธ Quick Setup\n'));
36
-
37
- const name = await question(chalk.white('๐Ÿ‘ค Your name: '));
38
- const port = await question(chalk.white('๐Ÿ”Œ Preferred port (default 3000): '));
39
- const alias = await question(chalk.white('โšก Custom command alias (default: aionix): '));
40
- const autoOpen = await question(chalk.white('๐ŸŒ Auto open browser on start? (y/n, default y): '));
41
-
42
- const finalPort = port.trim() || '3000';
43
- const finalAlias = alias.trim() || 'aionix';
44
- const finalName = name.trim() || 'Developer';
45
- const finalAutoOpen = autoOpen.trim().toLowerCase() !== 'n';
46
-
47
- config = {
48
- name: finalName,
49
- port: parseInt(finalPort),
50
- alias: finalAlias,
51
- autoOpen: finalAutoOpen,
52
- installedAt: new Date().toISOString()
44
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
45
+ // ASCII LOADING BAR
46
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
47
+ function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
48
+
49
+ async function loadingBar(label, duration = 800) {
50
+ const width = 30;
51
+ process.stdout.write(` ${chalk.hex('#888888')(label.padEnd(20))} [`);
52
+ for (let i = 0; i <= width; i++) {
53
+ const filled = chalk.hex('#00ff9f')('โ–ˆ'.repeat(i));
54
+ const empty = chalk.hex('#333333')('โ–‘'.repeat(width - i));
55
+ const pct = Math.round((i / width) * 100);
56
+ process.stdout.write(`\r ${chalk.hex('#888888')(label.padEnd(20))} [${filled}${empty}] ${chalk.hex('#ffff00')(pct + '%')}`);
57
+ await sleep(duration / width);
58
+ }
59
+ process.stdout.write(`\r ${chalk.hex('#00ff9f')(label.padEnd(20))} [${'โ–ˆ'.repeat(width)}] ${chalk.hex('#00ff9f')('DONE โœ“')}\n`);
60
+ }
61
+
62
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
63
+ // SPINNER
64
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
65
+ function spinner(label) {
66
+ const frames = ['โ ‹','โ ™','โ น','โ ธ','โ ผ','โ ด','โ ฆ','โ ง','โ ‡','โ '];
67
+ let i = 0;
68
+ const id = setInterval(() => {
69
+ process.stdout.write(`\r ${chalk.hex('#00ff9f')(frames[i])} ${chalk.hex('#888888')(label)}`);
70
+ i = (i + 1) % frames.length;
71
+ }, 80);
72
+ return () => {
73
+ clearInterval(id);
74
+ process.stdout.write(`\r ${chalk.hex('#00ff9f')('โœ“')} ${chalk.hex('#ffffff')(label)}\n`);
53
75
  };
76
+ }
77
+
78
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
79
+ // PORT CHECK
80
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
81
+ async function checkPort(port) {
82
+ return new Promise((resolve) => {
83
+ const s = net.createServer();
84
+ s.listen(port, () => { s.close(() => resolve(false)); });
85
+ s.on('error', () => resolve(true));
86
+ });
87
+ }
54
88
 
55
- if (!fs.existsSync(CONFIG_DIR)) fs.mkdirSync(CONFIG_DIR, { recursive: true });
56
- fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
57
-
58
- console.log(chalk.green('\nโœ… Config saved!'));
59
- console.log(chalk.gray(`๐Ÿ“ ${CONFIG_FILE}\n`));
60
-
61
- if (finalAlias !== 'aionix') {
62
- console.log(chalk.yellow(`๐Ÿ’ก To use "${finalAlias}" as your command:`));
63
- const isWindows = process.platform === 'win32';
64
- if (isWindows) {
65
- console.log(chalk.cyan(` doskey ${finalAlias}=aionix`));
66
- console.log(chalk.gray(' (Run in terminal or add to AutoRun registry)\n'));
67
- } else {
68
- console.log(chalk.cyan(` echo "alias ${finalAlias}='aionix'" >> ~/.bashrc && source ~/.bashrc\n`));
69
- }
89
+ async function showPortTable(preferredPort) {
90
+ console.log(chalk.hex('#00ff9f')(` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”`));
91
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + chalk.hex('#ffff00').bold(` ๐Ÿ“ก PORT STATUS MONITOR `) + chalk.hex('#00ff9f')(`โ”‚`));
92
+ console.log(chalk.hex('#00ff9f')(` โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค`));
93
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + chalk.hex('#888888')(` PORT `) + chalk.hex('#00ff9f')(`โ”‚`) + chalk.hex('#888888')(` STATUS `) + chalk.hex('#00ff9f')(`โ”‚`));
94
+ console.log(chalk.hex('#00ff9f')(` โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค`));
95
+
96
+ const ports = [preferredPort, preferredPort+1, preferredPort+2, preferredPort+3];
97
+ for (const p of ports) {
98
+ const inUse = await checkPort(p);
99
+ const portStr = String(p).padEnd(6);
100
+ const status = inUse
101
+ ? chalk.hex('#ff4444')('โ— IN USE ')
102
+ : chalk.hex('#00ff9f')('โ—‹ FREE ');
103
+ const star = p === preferredPort ? chalk.hex('#ffff00')(' โ—„') : ' ';
104
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + ` ${chalk.hex('#ffffff')(portStr)}` + chalk.hex('#00ff9f')(`โ”‚`) + ` ${status}` + chalk.hex('#00ff9f')(`โ”‚`) + star);
70
105
  }
106
+ console.log(chalk.hex('#00ff9f')(` โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜`));
107
+ console.log();
108
+ }
71
109
 
72
- rl.close();
73
-
74
- // Ask to launch now
75
- const rl2 = readline.createInterface({ input: process.stdin, output: process.stdout });
76
- rl2.question(chalk.yellow(`๐Ÿš€ Launch AIONIX now? (y/n, default y): `), (ans) => {
77
- rl2.close();
78
- if (ans.trim().toLowerCase() !== 'n') {
79
- console.log(chalk.green('\nStarting server...'));
80
- process.env.AIONIX_PORT = config.port || 3000;
81
- process.env.AIONIX_AUTO_OPEN = config.autoOpen ? 'true' : 'false';
82
- require('../server/app');
83
- } else {
84
- console.log(chalk.cyan('\n๐Ÿ‘‰ Run anytime:'), chalk.white.bold('aionix'));
85
- console.log(chalk.cyan('โš™๏ธ Edit config:'), chalk.white.bold('aionix --config\n'));
86
- process.exit(0);
87
- }
110
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
111
+ // --config FLAG
112
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
113
+ if (process.argv.includes('--config')) {
114
+ showBanner();
115
+ console.log(chalk.hex('#00ff9f')(` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”`));
116
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + chalk.hex('#ffff00').bold(` โš™๏ธ CURRENT CONFIG `) + chalk.hex('#00ff9f')(`โ”‚`));
117
+ console.log(chalk.hex('#00ff9f')(` โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค`));
118
+ Object.entries(config).forEach(([k, v]) => {
119
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + ` ${chalk.hex('#888888')(k.padEnd(15))} ${chalk.hex('#ffffff')(String(v).padEnd(20))}` + chalk.hex('#00ff9f')(`โ”‚`));
88
120
  });
121
+ console.log(chalk.hex('#00ff9f')(` โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜`));
122
+ console.log(chalk.hex('#888888')(`\n ๐Ÿ“ ${CONFIG_FILE}\n`));
123
+ process.exit(0);
124
+ }
125
+
126
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
127
+ // MAIN
128
+ // โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
129
+ async function main() {
130
+ showBanner();
131
+
132
+ await loadingBar('Initializing', 400);
133
+ await loadingBar('Loading modules', 300);
134
+ await loadingBar('Checking system', 300);
135
+ console.log();
136
+
137
+ await showPortTable(config.port || 3000);
138
+
139
+ const stopSpin = spinner('Starting AIONIX server...');
140
+ await sleep(600);
141
+ stopSpin();
142
+
143
+ process.env.AIONIX_PORT = config.port || 3000;
144
+ process.env.AIONIX_AUTO_OPEN = config.autoOpen !== false ? 'true' : 'false';
145
+ process.env.AIONIX_NAME = config.name || 'Developer';
146
+
147
+ require('../server/app');
89
148
  }
90
149
 
91
- setup().catch(e => { console.error(e); rl.close(); process.exit(1); });
150
+ main().catch(e => {
151
+ console.error(chalk.hex('#ff4444')('\n โœ— Error: ' + e.message));
152
+ process.exit(1);
153
+ });
package/bin/install.js CHANGED
@@ -1,89 +1,149 @@
1
-
1
+ #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
4
  const chalk = require('chalk');
5
5
  const readline = require('readline');
6
6
  const fs = require('fs');
7
- const os = require('os');
8
7
  const path = require('path');
8
+ const os = require('os');
9
9
 
10
10
  const CONFIG_DIR = path.join(os.homedir(), '.aionix');
11
11
  const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
12
12
 
13
- console.log(chalk.cyan.bold(`
14
- +==============================+
15
- | ๐Ÿš€ AIONIX |
16
- | Offline Developer Toolkit |
17
- +==============================+
18
- `));
13
+ function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
14
+
15
+ async function typewrite(text, delay = 18) {
16
+ for (const ch of text) {
17
+ process.stdout.write(ch);
18
+ await sleep(delay);
19
+ }
20
+ process.stdout.write('\n');
21
+ }
19
22
 
20
- console.log(chalk.green('โœ… AIONIX successfully installed!\n'));
23
+ async function showBanner() {
24
+ console.clear();
25
+ const lines = [
26
+ ``,
27
+ ` โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘`,
28
+ ` โ–‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–‘`,
29
+ ` โ–‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ• โ–‘`,
30
+ ` โ–‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ•”โ• โ–‘`,
31
+ ` โ–‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–‘`,
32
+ ` โ–‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•— โ–‘`,
33
+ ` โ–‘ โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ–‘`,
34
+ ` โ–‘ โ–‘`,
35
+ ` โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘`,
36
+ ``,
37
+ ];
38
+ for (const line of lines) {
39
+ console.log(chalk.hex('#00ff9f').bold(line));
40
+ await sleep(40);
41
+ }
42
+ await typewrite(chalk.hex('#ffff00').bold(` ๐Ÿš€ WELCOME TO AIONIX INSTALLER`), 12);
43
+ console.log();
44
+ }
21
45
 
22
- let config = {};
23
- try {
24
- if (fs.existsSync(CONFIG_FILE)) {
25
- config = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
46
+ async function animatedLine(char = 'โ•', width = 52, color = '#00ff9f') {
47
+ process.stdout.write(` `);
48
+ for (let i = 0; i < width; i++) {
49
+ process.stdout.write(chalk.hex(color)(char));
50
+ await sleep(8);
26
51
  }
27
- } catch(e) {}
52
+ process.stdout.write('\n');
53
+ }
28
54
 
29
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
30
- function question(q) {
55
+ function question(rl, q) {
31
56
  return new Promise(resolve => rl.question(q, resolve));
32
57
  }
33
58
 
34
59
  async function setup() {
35
- console.log(chalk.yellow('โš™๏ธ Quick Setup\n'));
60
+ await showBanner();
61
+ await animatedLine('โ”€');
62
+
63
+ console.log(chalk.hex('#00ff9f')(` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”`));
64
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + chalk.hex('#ffffff').bold(` โš™๏ธ FIRST TIME SETUP `) + chalk.hex('#00ff9f')(`โ”‚`));
65
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + chalk.hex('#888888')(` Configure your personal AIONIX environment `) + chalk.hex('#00ff9f')(`โ”‚`));
66
+ console.log(chalk.hex('#00ff9f')(` โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜`));
67
+ console.log();
36
68
 
37
- const name = await question(chalk.white('๐Ÿ‘ค Your name: '));
38
- const port = await question(chalk.white('๐Ÿ”Œ Preferred port (default 3000): '));
39
- const alias = await question(chalk.white('โšก Custom command alias (default: aionix): '));
40
- const autoOpen = await question(chalk.white('๐ŸŒ Auto open browser? (y/n, default y): '));
69
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
41
70
 
42
- const finalPort = port.trim() || '3000';
43
- const finalAlias = alias.trim() || 'aionix';
44
- const finalName = name.trim() || 'Developer';
71
+ const name = await question(rl, chalk.hex('#00ff9f')(` โ”ƒ `) + chalk.hex('#ffff00')(`๐Ÿ‘ค Your name `) + chalk.hex('#888888')(`โ€บ `));
72
+ const port = await question(rl, chalk.hex('#00ff9f')(` โ”ƒ `) + chalk.hex('#ffff00')(`๐Ÿ”Œ Port `) + chalk.hex('#888888')(`โ€บ [3000] `));
73
+ const alias = await question(rl, chalk.hex('#00ff9f')(` โ”ƒ `) + chalk.hex('#ffff00')(`โšก Custom alias `) + chalk.hex('#888888')(`โ€บ [aionix] `));
74
+ const autoOpen = await question(rl, chalk.hex('#00ff9f')(` โ”ƒ `) + chalk.hex('#ffff00')(`๐ŸŒ Auto-open browser `) + chalk.hex('#888888')(`โ€บ [Y/n] `));
75
+ rl.close();
76
+
77
+ const finalName = name.trim() || 'Developer';
78
+ const finalPort = parseInt(port.trim()) || 3000;
79
+ const finalAlias = alias.trim() || 'aionix';
45
80
  const finalAutoOpen = autoOpen.trim().toLowerCase() !== 'n';
46
81
 
47
- config = {
82
+ const config = {
48
83
  name: finalName,
49
- port: parseInt(finalPort),
84
+ port: finalPort,
50
85
  alias: finalAlias,
51
86
  autoOpen: finalAutoOpen,
52
- installedAt: new Date().toISOString()
87
+ installedAt: new Date().toISOString(),
88
+ version: '1.2.0'
53
89
  };
54
90
 
55
91
  if (!fs.existsSync(CONFIG_DIR)) fs.mkdirSync(CONFIG_DIR, { recursive: true });
56
92
  fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
57
93
 
58
- console.log(chalk.green('\nโœ… Config saved!'));
59
- console.log(chalk.gray(`๐Ÿ“ ${CONFIG_FILE}\n`));
94
+ console.log();
95
+ await animatedLine('โ”€');
96
+
97
+ console.log(chalk.hex('#00ff9f').bold(`\n โœ“ Config saved โ†’ ${CONFIG_FILE}\n`));
98
+
99
+ // Show saved config table
100
+ console.log(chalk.hex('#00ff9f')(` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”`));
101
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + chalk.hex('#ffff00').bold(` SETTING `) + chalk.hex('#00ff9f')(`โ”‚`) + chalk.hex('#ffff00').bold(` VALUE `) + chalk.hex('#00ff9f')(`โ”‚`));
102
+ console.log(chalk.hex('#00ff9f')(` โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค`));
103
+ const rows = [
104
+ ['Name', finalName],
105
+ ['Port', finalPort],
106
+ ['Alias', finalAlias],
107
+ ['Auto-open', finalAutoOpen ? 'Yes' : 'No'],
108
+ ];
109
+ rows.forEach(([k, v]) => {
110
+ console.log(chalk.hex('#00ff9f')(` โ”‚`) + ` ${chalk.hex('#888888')(k.padEnd(15))}` + chalk.hex('#00ff9f')(`โ”‚`) + ` ${chalk.hex('#ffffff')(String(v).padEnd(29))}` + chalk.hex('#00ff9f')(`โ”‚`));
111
+ });
112
+ console.log(chalk.hex('#00ff9f')(` โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜`));
60
113
 
61
114
  if (finalAlias !== 'aionix') {
62
- console.log(chalk.yellow(`๐Ÿ’ก To use "${finalAlias}" as your command:`));
63
- const isWindows = process.platform === 'win32';
64
- if (isWindows) {
65
- console.log(chalk.cyan(` doskey ${finalAlias}=aionix`));
115
+ console.log();
116
+ console.log(chalk.hex('#ffff00')(` ๐Ÿ’ก To use "${finalAlias}" command:`));
117
+ const isWin = process.platform === 'win32';
118
+ if (isWin) {
119
+ console.log(chalk.hex('#00ff9f')(` doskey ${finalAlias}=aionix`));
66
120
  } else {
67
- console.log(chalk.cyan(` echo "alias ${finalAlias}='aionix'" >> ~/.bashrc && source ~/.bashrc\n`));
121
+ console.log(chalk.hex('#00ff9f')(` echo "alias ${finalAlias}='aionix'" >> ~/.bashrc && source ~/.bashrc`));
68
122
  }
69
123
  }
70
124
 
71
- rl.close();
72
-
125
+ console.log();
73
126
  const rl2 = readline.createInterface({ input: process.stdin, output: process.stdout });
74
- rl2.question(chalk.yellow('\n๐Ÿš€ Launch AIONIX now? (y/n, default y): '), (ans) => {
75
- rl2.close();
76
- if (ans.trim().toLowerCase() !== 'n') {
77
- console.log(chalk.green('\nStarting server...'));
78
- process.env.AIONIX_PORT = config.port || 3000;
79
- process.env.AIONIX_AUTO_OPEN = config.autoOpen ? 'true' : 'false';
80
- require('../server/app');
81
- } else {
82
- console.log(chalk.cyan('\n๐Ÿ‘‰ Run anytime:'), chalk.white.bold('aionix'));
83
- console.log(chalk.cyan('โš™๏ธ Edit config:'), chalk.white.bold('aionix --config\n'));
84
- process.exit(0);
85
- }
86
- });
127
+ const launch = await question(rl2, chalk.hex('#00ff9f')(` โ”ƒ `) + chalk.hex('#ffff00')(`๐Ÿš€ Launch AIONIX now?`) + chalk.hex('#888888')(` โ€บ [Y/n] `));
128
+ rl2.close();
129
+
130
+ if (launch.trim().toLowerCase() !== 'n') {
131
+ console.log();
132
+ process.env.AIONIX_PORT = finalPort;
133
+ process.env.AIONIX_AUTO_OPEN = finalAutoOpen ? 'true' : 'false';
134
+ process.env.AIONIX_NAME = finalName;
135
+ require('../server/app');
136
+ } else {
137
+ console.log();
138
+ console.log(chalk.hex('#00ff9f').bold(` โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—`));
139
+ console.log(chalk.hex('#00ff9f').bold(` โ•‘`) + chalk.hex('#ffffff')(` Run anytime: `) + chalk.hex('#ffff00').bold(`aionix `) + chalk.hex('#00ff9f').bold(`โ•‘`));
140
+ console.log(chalk.hex('#00ff9f').bold(` โ•‘`) + chalk.hex('#ffffff')(` Edit config: `) + chalk.hex('#ffff00').bold(`aionix --config `) + chalk.hex('#00ff9f').bold(`โ•‘`));
141
+ console.log(chalk.hex('#00ff9f').bold(` โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n`));
142
+ process.exit(0);
143
+ }
87
144
  }
88
145
 
89
- setup().catch(e => { console.error(e); rl.close(); process.exit(1); });
146
+ setup().catch(e => {
147
+ console.error(chalk.hex('#ff4444')('\n โœ— Setup failed: ' + e.message));
148
+ process.exit(1);
149
+ });