kentutai 1.7.2 → 1.7.3

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.
@@ -1,45 +1,48 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { execSync } = require("child_process");
4
3
  const path = require("path");
5
4
  const fs = require("fs");
5
+ const { execSync } = require("child_process");
6
6
 
7
+ const packageDir = path.resolve(__dirname, "..", "..");
7
8
  const appDir = path.join(__dirname, "..", "app");
8
- const serverPath = path.join(appDir, "server.js");
9
- const nodeModulesDir = path.join(appDir, "node_modules");
9
+ const tarball = path.join(__dirname, "..", "kentutai-1.3.2.tgz");
10
10
 
11
- if (!fs.existsSync(serverPath)) {
12
- console.log("[kentutai] Standalone build not found. Skipping postinstall.");
11
+ if (fs.existsSync(path.join(appDir, "server.js"))) {
12
+ console.log("[kentutai] Standalone build already exists.");
13
13
  process.exit(0);
14
14
  }
15
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.");
16
+ if (!fs.existsSync(tarball)) {
17
+ console.log("[kentutai] Tarball not found. Skipping extraction.");
21
18
  process.exit(0);
22
19
  }
23
20
 
24
- console.log("[kentutai] Installing runtime dependencies...");
21
+ console.log("[kentutai] Extracting standalone build...");
25
22
 
26
23
  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);
24
+ const tempDir = path.join(packageDir, ".kentutai-extract");
25
+ if (fs.existsSync(tempDir)) {
26
+ fs.rmSync(tempDir, { recursive: true, force: true });
27
+ }
28
+ fs.mkdirSync(tempDir, { recursive: true });
29
+
30
+ execSync(`tar -xzf "${tarball}" -C "${tempDir}"`, { stdio: "pipe" });
31
+
32
+ const extractedApp = path.join(tempDir, "package", "cli", "app");
33
+ if (fs.existsSync(extractedApp)) {
34
+ if (fs.existsSync(appDir)) {
35
+ fs.rmSync(appDir, { recursive: true, force: true });
36
+ }
37
+ fs.renameSync(extractedApp, appDir);
38
+ console.log("[kentutai] Standalone build extracted successfully!");
39
+ } else {
40
+ console.log("[kentutai] Could not find app in tarball.");
31
41
  }
32
42
 
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!");
43
+ fs.rmSync(tempDir, { recursive: true, force: true });
40
44
  } 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");
45
+ console.warn("[kentutai] Extraction failed:", err.message);
43
46
  }
44
47
 
45
48
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kentutai",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "KentutAI - AI Router & Token Saver CLI",
5
5
  "private": false,
6
6
  "bin": {
@@ -387,18 +387,16 @@ export default function UserDetailPage() {
387
387
  >
388
388
  Set Custom Limits
389
389
  </Button>
390
- </div>
391
- )}
392
- </div>
393
-
394
- <div className="border-t border-border my-4"></div>
395
-
396
- {/* Subscription Package Section */}
397
- <div>
398
- <p className="text-sm font-medium text-text-main mb-3">Subscription Package</p>
390
+ </div>
391
+ )}
392
+ </div>
393
+ </Card>
399
394
 
395
+ {/* Subscription Package */}
396
+ <Card title="Subscription Package" icon="inventory_2" data-testid="package-card">
397
+ <div className="flex flex-col gap-4">
400
398
  {userPackage ? (
401
- <div className="flex flex-col gap-4">
399
+ <>
402
400
  <div className="flex items-center justify-between">
403
401
  <div className="flex items-center gap-3">
404
402
  <div className="p-2 rounded-lg bg-primary/10">
@@ -474,7 +472,7 @@ export default function UserDetailPage() {
474
472
  </span>
475
473
  )}
476
474
  </div>
477
- </div>
475
+ </>
478
476
  ) : (
479
477
  <div className="flex flex-col items-center justify-center py-8 text-center">
480
478
  <span className="material-symbols-outlined text-[48px] text-text-muted/30 mb-4">workspace_premium</span>