kentutai 1.7.0 → 1.7.2

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.
@@ -5,19 +5,41 @@ const path = require("path");
5
5
  const fs = require("fs");
6
6
 
7
7
  const appDir = path.join(__dirname, "..", "app");
8
- const packageJson = path.join(appDir, "package.json");
9
-
10
- if (fs.existsSync(packageJson)) {
11
- console.log("\n Installing KentutAI dependencies...\n");
12
-
13
- try {
14
- execSync("npm install --production", {
15
- cwd: appDir,
16
- stdio: "inherit"
17
- });
18
- console.log("\n Dependencies installed successfully!\n");
19
- } catch (err) {
20
- console.error("\n Failed to install dependencies.");
21
- console.error(" Please run manually: cd cli/app && npm install\n");
8
+ const serverPath = path.join(appDir, "server.js");
9
+ const nodeModulesDir = path.join(appDir, "node_modules");
10
+
11
+ if (!fs.existsSync(serverPath)) {
12
+ console.log("[kentutai] Standalone build not found. Skipping postinstall.");
13
+ process.exit(0);
14
+ }
15
+
16
+ const nodeModulesExists = fs.existsSync(nodeModulesDir);
17
+ const hasPackages = nodeModulesExists && fs.readdirSync(nodeModulesDir).length > 0;
18
+
19
+ if (hasPackages) {
20
+ console.log("[kentutai] Dependencies already installed.");
21
+ process.exit(0);
22
+ }
23
+
24
+ console.log("[kentutai] Installing runtime dependencies...");
25
+
26
+ try {
27
+ const packageJson = path.join(appDir, "package.json");
28
+ if (!fs.existsSync(packageJson)) {
29
+ console.log("[kentutai] No package.json found. Skipping.");
30
+ process.exit(0);
22
31
  }
32
+
33
+ execSync("npm install --production --ignore-scripts", {
34
+ cwd: appDir,
35
+ stdio: "inherit",
36
+ timeout: 120000
37
+ });
38
+
39
+ console.log("[kentutai] Dependencies installed successfully!");
40
+ } catch (err) {
41
+ console.warn("[kentutai] Failed to install dependencies:", err.message);
42
+ console.warn("[kentutai] Server may not work. Try: cd cli/app && npm install");
23
43
  }
44
+
45
+ process.exit(0);
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kentutai-cli",
3
- "version": "1.0.0",
3
+ "version": "1.7.0",
4
4
  "description": "KentutAI - AI Router CLI",
5
5
  "private": false,
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kentutai",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "KentutAI - AI Router & Token Saver CLI",
5
5
  "private": false,
6
6
  "bin": {
@@ -456,29 +456,23 @@ function PackageRow({ pkg, onEdit, onDelete, formatNumber, formatRupiah, tierCon
456
456
 
457
457
  return (
458
458
  <Card padding="md" className="group">
459
- <div className="flex min-w-0 flex-col gap-4">
460
- <div className="flex items-start justify-between gap-4">
461
- <div className="flex min-w-0 items-start gap-3">
462
- <div className="size-10 rounded-lg bg-primary/10 flex items-center justify-center shrink-0">
463
- <span className="material-symbols-outlined text-primary text-[20px]">inventory_2</span>
464
- </div>
465
- <div className="min-w-0">
466
- <div className="flex items-center gap-2 flex-wrap">
467
- <span className="font-semibold text-text-main">{pkg.name}</span>
468
- {tier && (
469
- <Badge variant={tier.variant} size="sm">
470
- <span className="material-symbols-outlined text-[12px] mr-0.5">{tier.icon}</span>
471
- {tier.label}
472
- </Badge>
473
- )}
474
- <Badge variant={statusVariant} size="sm" dot>
475
- {statusLabel}
476
- </Badge>
477
- </div>
478
- {pkg.description && (
479
- <p className="text-xs text-text-muted mt-1">{pkg.description}</p>
480
- )}
481
- </div>
459
+ <div className="flex flex-col gap-3">
460
+ <div className="flex items-center justify-between gap-4">
461
+ <div className="flex items-center gap-3">
462
+ {tier ? (
463
+ <Badge variant={tier.variant} size="lg">
464
+ <span className="material-symbols-outlined text-[16px] mr-0.5">{tier.icon}</span>
465
+ {tier.label}
466
+ </Badge>
467
+ ) : (
468
+ <span className="font-semibold text-text-main capitalize">{pkg.name}</span>
469
+ )}
470
+ <Badge variant={statusVariant} size="sm" dot>
471
+ {statusLabel}
472
+ </Badge>
473
+ {pkg.price > 0 && (
474
+ <span className="text-sm text-text-muted">{formatRupiah(pkg.price)}</span>
475
+ )}
482
476
  </div>
483
477
  <div className="flex items-center gap-1.5 shrink-0">
484
478
  <Button size="sm" variant="ghost" icon="edit" onClick={onEdit}>Edit</Button>
@@ -486,24 +480,21 @@ function PackageRow({ pkg, onEdit, onDelete, formatNumber, formatRupiah, tierCon
486
480
  </div>
487
481
  </div>
488
482
 
483
+ {pkg.description && (
484
+ <p className="text-xs text-text-muted">{pkg.description}</p>
485
+ )}
486
+
489
487
  <div className="grid grid-cols-2 sm:grid-cols-4 gap-3 p-3 rounded-lg bg-surface-2/50">
490
488
  {stats.map((stat, i) => (
491
489
  <div key={i} className="flex items-center gap-2">
492
490
  <span className="material-symbols-outlined text-[16px] text-primary/60">{stat.icon}</span>
493
- <div className="min-w-0">
491
+ <div>
494
492
  <span className="text-sm font-semibold text-text-main">{stat.value}</span>
495
493
  <span className="text-xs text-text-muted ml-1">{stat.label}</span>
496
494
  </div>
497
495
  </div>
498
496
  ))}
499
497
  </div>
500
-
501
- {pkg.price > 0 && (
502
- <div className="flex items-center gap-2 text-sm">
503
- <span className="material-symbols-outlined text-[16px] text-primary/60">payments</span>
504
- <span className="font-medium text-text-main">{formatRupiah(pkg.price)}</span>
505
- </div>
506
- )}
507
498
  </div>
508
499
  </Card>
509
500
  );
@@ -294,16 +294,13 @@ export default function UserDetailPage() {
294
294
  </Card>
295
295
 
296
296
  {/* Access & Limits */}
297
- <Card title="Access & Limits" icon="tune">
298
- {/* Custom Rate Limits Section */}
299
- <div className="mb-4">
300
- <p className="text-sm font-medium text-text-main mb-3">Custom Rate Limits</p>
301
- <div className="mb-4 p-3 rounded-lg bg-brand-500/10 border border-brand-500/20">
302
- <p className="text-xs text-text-muted">
303
- <span className="font-medium text-brand-600 dark:text-brand-400">Priority Override:</span> These limits directly override any package settings. Leave package overrides empty to use these values.
304
- </p>
305
- </div>
306
- {limits ? (
297
+ <Card title="Custom Rate Limits" icon="tune">
298
+ <div className="mb-4 p-3 rounded-lg bg-surface-2 border border-border">
299
+ <p className="text-xs text-text-muted">
300
+ <span className="font-medium text-text-main">Priority:</span> These limits override package settings. Leave empty to use package defaults.
301
+ </p>
302
+ </div>
303
+ {limits ? (
307
304
  <div className="flex flex-col gap-4" data-testid="limits-form">
308
305
  <div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
309
306
  <Input
@@ -399,11 +396,6 @@ export default function UserDetailPage() {
399
396
  {/* Subscription Package Section */}
400
397
  <div>
401
398
  <p className="text-sm font-medium text-text-main mb-3">Subscription Package</p>
402
- <div className="mb-4 p-3 rounded-lg bg-surface-2 border border-border">
403
- <p className="text-xs text-text-muted">
404
- <span className="font-medium text-text-main">Limit Priority:</span> Custom Limits &gt; Package Overrides &gt; Package Defaults
405
- </p>
406
- </div>
407
399
 
408
400
  {userPackage ? (
409
401
  <div className="flex flex-col gap-4">