kentutai-app 1.1.0 → 1.1.1

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/cli/cli.js +0 -49
  2. package/package.json +1 -1
package/cli/cli.js CHANGED
@@ -7,7 +7,6 @@ const os = require("os");
7
7
 
8
8
  const pkg = require("./package.json");
9
9
 
10
- // ─── Configuration ────────────────────────────────────────────────────
11
10
  const DEFAULT_PORT = 20123;
12
11
  const DEFAULT_HOST = "0.0.0.0";
13
12
 
@@ -17,7 +16,6 @@ let noBrowser = false;
17
16
  let showLog = false;
18
17
  let trayMode = false;
19
18
 
20
- // Parse arguments
21
19
  const args = process.argv.slice(2);
22
20
  for (let i = 0; i < args.length; i++) {
23
21
  if (args[i] === "--port" || args[i] === "-p") {
@@ -52,7 +50,6 @@ Options:
52
50
  }
53
51
  }
54
52
 
55
- // ─── Standalone server path ───────────────────────────────────────────
56
53
  const standaloneDir = path.join(__dirname, "app");
57
54
  const serverPath = path.join(standaloneDir, "server.js");
58
55
 
@@ -62,8 +59,6 @@ if (!fs.existsSync(serverPath)) {
62
59
  process.exit(1);
63
60
  }
64
61
 
65
- // ─── Helpers ──────────────────────────────────────────────────────────
66
-
67
62
  function openBrowser(url) {
68
63
  const cmd = process.platform === "darwin" ? "open"
69
64
  : process.platform === "win32" ? "start"
@@ -94,8 +89,6 @@ function killProcessOnPort(port) {
94
89
  });
95
90
  }
96
91
 
97
- // ─── Start Server ─────────────────────────────────────────────────────
98
-
99
92
  function startServer() {
100
93
  const displayHost = host === DEFAULT_HOST ? "localhost" : host;
101
94
  const url = `http://${displayHost}:${port}/dashboard`;
@@ -118,7 +111,6 @@ function startServer() {
118
111
  process.exit(code || 0);
119
112
  });
120
113
 
121
- // Cleanup on exit
122
114
  const cleanup = () => {
123
115
  try { server.kill(); } catch {}
124
116
  };
@@ -149,14 +141,11 @@ async function checkForUpdate() {
149
141
  } catch { return null; }
150
142
  }
151
143
 
152
- // ─── Main ─────────────────────────────────────────────────────────────
153
-
154
144
  async function main() {
155
145
  await killProcessOnPort(port);
156
146
 
157
147
  const { server, url } = startServer();
158
148
 
159
- // Tray mode: no interactive menu
160
149
  if (trayMode) {
161
150
  console.log(`\n ${pkg.name} v${pkg.version}`);
162
151
  console.log(` Server: ${url}`);
@@ -164,14 +153,11 @@ async function main() {
164
153
  return;
165
154
  }
166
155
 
167
- // Wait for server to be ready
168
156
  const { selectMenu, pause } = require("./src/cli/utils/input");
169
157
  const { clearScreen } = require("./src/cli/utils/display");
170
158
 
171
- // Wait a bit for server startup
172
159
  await new Promise(r => setTimeout(r, 3000));
173
160
 
174
- // If --no-browser, just show info and wait
175
161
  if (noBrowser) {
176
162
  console.log(`\n ${pkg.name} v${pkg.version}`);
177
163
  console.log(` Server: ${url}`);
@@ -208,12 +194,10 @@ async function main() {
208
194
  `\ud83d\ude80 Server: ${serverUrl}`
209
195
  );
210
196
 
211
- // Handle choice
212
197
  const adjustedChoice = latestVersion ? choice : choice + 1;
213
198
 
214
199
  if (adjustedChoice === 0 && latestVersion) {
215
200
  console.log("\n Updating...");
216
- const { execSync } = require("child_process");
217
201
  try {
218
202
  execSync(`npm install -g ${pkg.name}`, { stdio: "inherit" });
219
203
  console.log("\n Update complete! Please restart the application.");
@@ -251,39 +235,6 @@ async function main() {
251
235
  }
252
236
  }
253
237
  }
254
- } else if (adjustedChoice === 1 || (adjustedChoice === 0 && !latestVersion)) {
255
- // Web UI
256
- openBrowser(url);
257
- await pause("\nPress Enter to go back to menu...");
258
- } else if (adjustedChoice === 2) {
259
- // Terminal UI
260
- try {
261
- const { startTerminalUI } = require("./src/cli/terminalUI");
262
- await startTerminalUI(port);
263
- } catch (err) {
264
- console.error("\n Terminal UI error:", err.message);
265
- await pause("\nPress Enter to continue...");
266
- }
267
- } else if (adjustedChoice === 3) {
268
- // Hide to Tray
269
- clearScreen();
270
- console.log(`\n \ud83d\udd14 ${pkg.name} is running in background`);
271
- console.log(` Server: ${serverUrl}`);
272
- console.log(` PID: ${server.pid}`);
273
- console.log(`\n Press Ctrl+C to stop.\n`);
274
- // Keep process alive, remove stdin listeners
275
- process.stdin.removeAllListeners("keypress");
276
- if (process.stdin.isTTY) try { process.stdin.setRawMode(false); } catch {}
277
- return;
278
- } else {
279
- // Exit
280
- console.log("\nExiting...");
281
- server.kill();
282
- setTimeout(() => process.exit(0), 100);
283
- return;
284
- }
285
- }
286
- }
287
238
 
288
239
  main().catch((err) => {
289
240
  console.error("Fatal:", err.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kentutai-app",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "KentutAI web dashboard",
5
5
  "private": false,
6
6
  "bin": {